-
Notifications
You must be signed in to change notification settings - Fork 12
/
log.n3
319 lines (258 loc) · 11.1 KB
/
log.n3
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# n3 definition of some Semantic Web terms
#
# These raise the level above RDF's pure relational data,
# and Web Ontology's ontological level, to allow rules to be expressed
# and inference done. They connect the inference to the web,
# allowing data to be fetched from resources elsewhere, and remote
# servers to be queried.
#
# $Id$
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix doc: <http://www.w3.org/2000/10/swap/pim/doc#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix : <#>.
log:N3Document a rdfs:Class;
rdfs:comment """A document which, which parsed as Notation3
as defined in general by http://www.w3.org/DesignIssues/Notation3.html
and this schema, conveys the intent of the author by the semantics defined
on those specifications, and the semantics defined by the specifications
of any other identifiers used in the document.
""" .
################################################## Syntactic level
#
# It isn't clear to me that these should be described as Properties
# and Classes. They operate at a level of symbol identity, not identity of the things referred to.
#
log:equalTo a rdf:Property;
rdfs:comment
"""True if the subject and object are the same RDF node (symbol or literal).
Do not confuse with owl:sameAs.
A cwm built-in logical operator, RDF graph level.
""".
log:notEqualTo a rdf:Property; owl:inverse log:equalTo;
rdfs:comment
"""Equality in this sense is actually the same URI.
A cwm built-in logical operator.
""".
log:rawType a rdf:Property;
rdfs:comment """
This is a low-level language type, one of log:Formula, log:Literal,
log:List, log:Set or log:Other.
Example: log:semanticsOrError returns either a formula or a string,
and you can check which using log:rawType.
""".
log:Formula a rdfs:Class.
log:String a rdfs:Class.
log:List a rdfs:Class. # Syntactic things
log:Other a rdfs:Class. # Not one of the above.
# The following are inherent in the translation of N3 syntax to quad representation:
#log:forSome a rdf:SyntaxArc; #@@@@@ NOT a real property. A pseudo property
# rdfs:comment """A is true for some object for which here we use B. This
# is NOT a real rdf property in its behavior - a pseudo-property.
# For example, removal of it from a formula does nor
# preserve truth, and substitution is not permitted on its object.""" ;
# rdfs:domain log:Formula.
#log:forAll a log:SyntaxArc;
# rdfs:label "for All";
# rdfs:comment """A is true for any object in place of B.
# This is NOT a real rdf property in its behavior - a pseudo-property.
# For examples substitution is not permitted on its object.""".
#########################################################
#
# The following are used for inference
#
log:Truth a rdfs:Class;
rdfs:comment """Something which is true: believe it as you would believe this.
Understood natively by cwm in that it will execute rules in a formula
declared a Truth within a formula it is already taking rules from.""".
#log:Falsehood a rdf:Class;
# rdfs:comment "Something which is not true. Not the complement of True!";
# rdfs:domain log:context.
#
log:implies a rdf:Property;
rdfs:comment """Logical implication.
This is the relation between the antecedent (subject) and
conclusion (object) of a rule.
The application of a rule to a knowledge-base is as follows.
For every substitution which, applied to the antecedent,
gives a formula which is a subset of the knowledge-base,
then the result of applying that same substitution to the
conclusion may be added to the knowledge-base.
related: See log:conclusion.
(See the CWM manual for command line options to determine how
rules from different sources are applied to and the results
added to various formula.)
""";
rdfs:range log:Formula;
rdfs:isDefinedBy <>;
rdfs:range log:Formula.
log:includes a rdf:Property;
rdfs:comment """The subject formula includes the object formula.
Formula A includes formula B if there exists some substitution
which when applied to B creates a formula B' such that for
every statement in B' is also in A, every variable
universally (or existentially) quantified in B' is quantified in
the same way in A.
Variable substitution is applied recursively to nested compound terms such as
formulae, lists and sets.
(Understood natively by cwm when in in the antecedent of a rule.
You can use this to peer inside nested formulae.)""";
rdfs:range log:Formula;
rdfs:isDefinedBy <>;
rdfs:range log:Formula.
log:notIncludes a rdf:Property;
rdfs:comment """The object formula is NOT a subset of subject.
True iff log:includes is false.
The converse of log:includes. (Understood natively by cwm.
The subject formula may contain variables.
(In cwm, variables must of course end up getting bound
before the log:include test can be done, or an infinite result set
would result)
Related: See includes""";
rdfs:domain log:Formula;
rdfs:isDefinedBy <>;
rdfs:range log:Formula.
# The following connect the inference engine to the web
log:parsedAsN3 a rdf:Property;
rdfs:comment "The subject string, parsed as N3, gives this formula.";
rdfs:label "parses to";
rdfs:domain log:String;
rdfs:range log:Formula.
log:n3String a rdf:Property;
rdfs:comment "The subject formula, expressed as N3, gives this string.";
rdfs:label "n3 string";
rdfs:domain log:Formula;
rdfs:range log:String.
log:semantics a rdf:Property;
rdfs:domain doc:Work;
rdfs:range log:Formula;
rdfs:label "semantics";
rdfs:comment """The log:semantics of a document is the formula.
achieved by parsing representation of the document.
For a document in Notation3, log:semantics is the
log:parsedAsN3 of the log:contents of the document.
For a document in RDF/XML, it is parsed according to the
RDF/XML specification to yield an RDF formula
(a subclass of N3 log:Formula).
[Aside: Philosophers will be distracted here into worrying about the meaning
of meaning. At least we didn't call this function "meaning"!
In as much as N3 is used as an interlingua for interoperability
for different systems, this for an N3 based system is the meaning
expressed by a document.]
(Cwm knows how to go get a document and parse N3 and RDF/XML
it in order to evaluate this.
Other languages for web documents
may be defined whose N3 semantics are therefore
also calculable, and so they could be added in due course.
See for example GRDDL, RDFa, etc)""".
log:semanticsOrError a rdf:Property;
rdfs:domain doc:Work;
rdfs:label "semantics or error message";
rdfs:comment """This connects a document and either the formula it parses to,
or an error message explaining what went wrong with trying. See log:semantics.
(Cwm knows how to go get a document and parse it in order to evaluate this.)
""".
log:content a rdf:Property;
rdfs:domain doc:Work;
rdfs:range log:String;
rdfs:label "content";
rdfs:comment """This connects a document and a string that represents it.
(Cwm knows how to go get a document in order to evaluate this.)
Note that the content-type of the information is not given and
so must be known or guessed.""".
# Merge two formulae
log:conjunction a rdf:Property;
rdfs:label "conjunction";
rdfs:domain log:List;
rdfs:range log:Formula;
rdfs:comment """"A function to merge formulae: logical AND.
The subject is a list of formulae.
The object, which can be generated, is a formula containing a copy
of each of the formulae in the list on the left.
A cwm built-in function.
""".
# Find the set of ALL statements entailed by a given formula.
log:conclusion a rdf:Property;
rdfs:label "conclusion";
rdfs:domain log:Formula;
rdfs:range log:Formula;
rdfs:comment """All possible conclusions which can be drawn from a formula.
The object of this function, a formula, is the set of conclusions which can be
drawn from the subject formula, by successively applying any
rules it contains to the data it contains. This is equivalent to
cwm's "--think" command line function. It does use built-ins, so
it may for example indirectly invoke other documents, validate
signatures, etc.
""".
############# Automatic processing steered by metadata
log:definitiveDocument a rdf:Property;
rdfs:label "definitive document";
rdfs:domain rdf:Property;
rdfs:range doc:Work;
rdfs:comment
""" When document D is the definitiveDocument for property P,
any statement X P Y is true iff and only if the semantics of document D
include that statement.
For example, there may be a definitive document for the zipcode of
airports by airport code, and so on. This is useful to let a reasoner
know that it can extend its query to the given document.
(Cwm will do this if its mode includes "r").
""".
log:definitiveService a rdf:Property;
rdfs:label "definitive service";
rdfs:domain rdf:Property;
# rdfs:range doc:Work;
rdfs:comment
""" When service S is the definitiveService for property P,
any statement X P Y is true iff and only if a query to S returns
that it is. The protocol for the service S depends on the scheme.
For mysql protocol, the URI of the service is like
sql://user:password@host.domain/database/.
For example, there may be a definitive service for the zipcode of
airports by airport code, and so on. This is useful to let a reasoner
know that it can help resolve a query by delegating it to the service
in question.
(Cwm will do this if its mode includes "r").
""".
################### String output
log:outputString a rdf:Property;
rdfs:label "output string";
rdfs:comment """The subject is a key and the object is a string,
where the strings are to be output in the order of the keys.
See cwm --strings in cwm --help.
""".
################### Purge control
log:Chaff a rdfs:Class;
rdfs:comment """Any statement mentioning anything in this class
is considered boring and purged by the cwm --purge option.
This is a convenience, and does not have any value when published as a
general fact on the web.""".
################# Simple Builtins:
#
log:uri a rdf:Property;
rdfs:comment
"""This allows one to look at the actual string of the URI which identifies this.
(Cwm can get the URI of a resource or get the resource from the URI.)
This is a level breaker, breaking the rule of not looking inside a
URI. Use (eg with string:match) to replace RDF's old "aboutEach"
functionality. Use to implement the URI spec and protocol specs, etc.
""";
rdfs:range log:String.
log:rawUri a rdf:Property;
rdfs:comment
"""This allows one to look at the actual string of the URI which identifies this,
for anything, even a blank node or a formula. This peeks into the internal
workings of cwm, and so is not normally used. Use log:uri instead.
""";
rdfs:range log:String.
log:racine a rdf:Property;
rdfs:comment """For anything identified by a URI with a fragid, this is the
thing identified by the same URI without a hash or fragid.
For anything else, it is itself.""".
log:dtlit a rdf:Property;
rdfs:comment """Takes a list of a string and a URI and creates a datatyped
literal. For example, { ("2005-03-30T11:00:00" :tz) log:dtlit ?X } => { ?X a :Answer } .
will produce "2005-03-30T11:00:00"^^:tz a :Answer .""" .
# ends