-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdtou-lang.n3s
95 lines (79 loc) · 2.22 KB
/
dtou-lang.n3s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix : <http://example.org/ns#>.
######
# Domain knowledge -- classes and class relations
######
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
# Common
:TaggingType a rdfs:Class.
:TagType rdfs:subClassOf :TaggingType.
:IntegrityType rdfs:subClassOf :TagType.
:PurposeType rdfs:subClassOf :TagType.
:RequirementType rdfs:subClassOf :TaggingType.
:SecurityType rdfs:subClassOf :RequirementType.
:type a rdfs:Property.
:TagName :sameAs :AttributeClass.
# Data Policy
:Tagging a rdfs:Class.
:Tag :sameAs [
rdfs:subClassOf :Tagging;
rdfs:subClassOf [:type :TagType]
].
:Integrity :sameAs [
rdfs:subClassOf :Tag;
rdfs:subClassOf [:type :IntegrityType]
].
:Purpose :sameAs [
rdfs:subClassOf :Tag;
rdfs:subClassOf [:type :PurposeType]
].
:Requirement :sameAs [
rdfs:subClassOf :Tagging;
rdfs:subClassOf [:type :RequirementType]
].
:Security :sameAs [
rdfs:subClassOf :Requirement;
rdfs:subClassOf [:type :SecurityType]
].
## Assign :name to :Tagging, based on `:attribute_ref [:class]`
(_:tagging _:attr_ref _:C) log:onNegativeSurface {
_:tagging a :Tagging;
:attribute_ref _:attr_ref.
_:attr_ref
:class _:C.
() log:onNegativeSurface {
_:tagging :name _:C.
}.
}.
# Propagate TaggingType tree
(_:x _:type _:superType) log:onNegativeSurface {
_:x a :Tagging;
:type _:type.
_:type rdfs:subClassOf _:superType.
() log:onNegativeSurface {
_:x :type _:superType.
}.
}.
:tagging a rdfs:Property.
:tag rdfs:subPropertyOf :tagging.
:requirement rdfs:subPropertyOf :tagging.
# App Policy
:TaggingInfo a rdfs:Class.
:TagExpectation rdfs:subClassOf :TaggingInfo.
:PurposeExpectation rdfs:subClassOf :TagExpectation;
rdfs:subClassOf [:type :PurposeType].
:IntegrityExpectation rdfs:subClassOf :TagExpectation;
rdfs:subClassOf [:type :IntegrityType].
:RequirementProvide rdfs:subClassOf :TaggingInfo.
:SecurityProvide rdfs:subClassOf :RequirementProvide;
rdfs:subClassOf [:type :SecurityType].
(_:x _:p) log:onNegativeSurface {
_:x a :InputSpec;
:purpose _:p.
() log:onNegativeSurface {
_:x :expect _:p.
}.
}.