rei.n3
4.29 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Reification of N3 (including RDF) in a useful fashion
#
#
@prefix : <http://www.w3.org/2004/06/rei#>.
@prefix rei: <http://www.w3.org/2004/06/swap/rei#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix s: <http://www.w3.org/2000/01/rdf-schema#> .
@keywords is, a, of.
# Each element of the language can be described as a bnode
#
#
# see why.py, check.py etc
Term a s:Class;
s:label "term".
BNode s:subClassOf Term;
s:label "blank node".
RDFTerm s:subClassOf Term.
Symbol s:subClassOf RDFTerm;
s:label "RDF symbol, identified by a URI".
#:id a rdf:Property; s:label "symbol URI, arbirary or not".
# a owl:FunctionalProperty, owl:InverseFunctionalProperty;
# s:comment
# """The URI of the symbol is all that is needed to identify it""".
uri a rdf:Property; s:label "symbol URI, not arbitray";
s:comment
"""The URI of the symbol is all that is needed to identify it.
This is the name string.""".
Literal s:subClassOf RDFTerm;
s:label "Literal";
s:comment
"""Literals are identified by their string value, their
datatype (or absence thereof) and their language code
(or absencethereof). As we are modeling RDF in RDF,
we can just use a literal the value of a literal.
""".
value a rdf:Property;
s:label "Value";
s:domain :iteral;
# a owl:DataProperty;
s:comment """The value of a literal.
Value is the relation between a node (which happens to be a literal, list etc,..) and the value it takes.""".
Formula s:subClassOf :Term;
s:label "Formula";
s:comment
"""A formula is identified by an unordered set of statements,
with a sets of existentially and universally quantified symbols.
For example,
[ :forAll ( [:uri "ex:#x"] [:uri "ex:#y"]);
:forSome ( [:uri "ex:#a"] [:uri "ex:#b"]);
:statements ( :s1 :s2 :s3 )
]
is equivalent to e.g. in loose math
forall x,y,x there exists a,b,c such that s1 and s2 and s3
That is, the universals are always outside the existentials.
Two formulae are the equal if the contents
of their forAll, forSome, and statements lists are the same
irrespective of order.
Two formulae are equivalent if there is a 1:1 mapping between
variable names of one and variable names in the other
which used as subsitution bindings on one gives a formula
equal to the other.
""".
RDFGraph s:subClassOf Formula;
s:comment """A formula which meets the constaints of being
an RDF Graph as per the RDF spec. No universally qualified variables,
no nested formulae, no literals as subject, etc.""".
universals a rdf:Property;
s:label "for all";
s:domain :Formula;
s:range s:Class.
existentials a rdf:Property;
s:label "for all";
s:domain :Formula;
s:range s:Class.
statements a rdf:Property;
s:label "statements";
s:domain :Formula;
s:range s:Class;
s:comment
"""The order of the statements is irrelevant.
They are given as a rdf:List because rdf:Lists exist,
and we want a closed set.
""".
Statement a s:Class;
s:label "Statement";
s:comment
"""A statement is the unit of information.
It expresses a binary relation.
Its significance is determined by the realtion,
generally referred to as its predicate.
""".
subject a rdf:Property;
s:label "subject";
s:domain Statement;
s:range Term. # For RDF 1.0, :Symbol
predicate a rdf:Property;
s:label "predicate";
s:domain Statement;
s:range Term. # For RDF 1.0, :Symbol
object a rdf:Property;
s:label "object";
s:domain Statement;
s:range Term. # For RDF 1.0, :RDFTerm
# Shortcut properties
subjURI a rdf:Property;
s:label "subject URI";
s:comment "Shorhand for subject!uri";
s:domain Statement;
s:range String.
predURI a rdf:Property;
s:label "predicate URI";
s:comment "Shorhand for predicate!uri";
s:domain Statement;
s:range String.
objURI a rdf:Property;
s:label "object URI";
s:comment "Shorhand for object!uri";
s:domain Statement;
s:range String.
#----
subjValue a rdf:Property;
s:label "subject value";
s:comment "Shorhand for subject!Literal. Not in RDF 1.0";
s:domain Statement;
s:range String.
predValue a rdf:Property;
s:label "predicate value";
s:comment "Shorhand for predicate!Literal. Not RDF 1.0.";
s:domain Statement;
s:range String.
objValue a rdf:Property;
s:label "object value";
s:comment "Shorhand for object!Literal";
s:domain Statement;
s:range String.
#ends