graphdb-workbench-tests 2.7.4-RC1 → 2.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fixtures/locale-en.json +1 -1
- package/fixtures/repositories/builtin_Rules.pie +741 -0
- package/fixtures/repositories/invalid_builtin_Rules.pie +741 -0
- package/integration/repository/repositories.spec.js +61 -1
- package/integration/setup/aclmanagement/create-rule.spec.js +16 -11
- package/integration/setup/aclmanagement/scopes.spec.js +8 -4
- package/integration/setup/user-and-access.spec.js +2 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/steps/repository-steps.js +36 -0
- package/steps/setup/acl-management-steps.js +6 -9
|
@@ -0,0 +1,741 @@
|
|
|
1
|
+
/* OWLIM rules and axioms for the TRREE engine
|
|
2
|
+
*
|
|
3
|
+
* From Thu 03-03-2006
|
|
4
|
+
*
|
|
5
|
+
* Every rule consists of one or more premises and one or more corollaries
|
|
6
|
+
* in the following format:
|
|
7
|
+
*
|
|
8
|
+
* Rules
|
|
9
|
+
* {
|
|
10
|
+
* Id: Rule_Id
|
|
11
|
+
* < Premise #1 >
|
|
12
|
+
* < Premise #2 >
|
|
13
|
+
* . . .
|
|
14
|
+
* < Premise #n >
|
|
15
|
+
* ---------------------
|
|
16
|
+
* < Corollary #1 >
|
|
17
|
+
* < Corollary #2 >
|
|
18
|
+
* . . .
|
|
19
|
+
* < Corollary #m >
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* Every premise may contain constraints stating that the value of one or
|
|
23
|
+
* more variables in the statement must not be equal to a full URI, a short name
|
|
24
|
+
* or the value of another variable from the same rule.
|
|
25
|
+
* This is written in the following format:
|
|
26
|
+
*
|
|
27
|
+
* . . . . . . . . . . .
|
|
28
|
+
* a <mynamespace:myproperty> b [Constraint a != b]
|
|
29
|
+
* <mynamespace:Instance_1.0> a c [Constraint a != <rdf:type>, c != a, c != b]
|
|
30
|
+
* -----------------------------------
|
|
31
|
+
* c a b
|
|
32
|
+
* b <rdf:type> <mynamespace:Instance_1.0> [Constraint b != <http://www.w3.org/2000/01/rdf-schema#Class>]
|
|
33
|
+
*
|
|
34
|
+
* Every left value in the not-equal constraint must denote a variable
|
|
35
|
+
* and every right value can be a variable, a short name or a full URI.
|
|
36
|
+
* Not-equal constraints may be used to force the engine not to apply
|
|
37
|
+
* the rule when the constraints are not satisfied. This will improve
|
|
38
|
+
* engine's performance.
|
|
39
|
+
* Constraints are valid anywhere within the rule-body.
|
|
40
|
+
* If a variable is not bound yet then the constraint is considered satisfied
|
|
41
|
+
* (and therefore does not apply).
|
|
42
|
+
* In the rule head, a constraint only affects the production of the rule conclusion it neighbours.
|
|
43
|
+
*
|
|
44
|
+
* In addition one or more axioms may be added in the following format:
|
|
45
|
+
*
|
|
46
|
+
* Axioms
|
|
47
|
+
* {
|
|
48
|
+
* < Axiom #1 >
|
|
49
|
+
* < Axiom #2 >
|
|
50
|
+
* . . .
|
|
51
|
+
* < Axiom #n >
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* The premises, the corollaries and the axioms must be written in N-Triple format.
|
|
55
|
+
* The subject, the predicate and the object must denote a full URI or
|
|
56
|
+
* a short name in format <Prefix>:<LocalName> where <Prefix> is defined in
|
|
57
|
+
* the prefix section written in the following format:
|
|
58
|
+
*
|
|
59
|
+
* Prefices
|
|
60
|
+
* {
|
|
61
|
+
* < Prefix #1 > : < Full URI for prefix #1 >
|
|
62
|
+
* < Prefix #2 > : < Full URI for prefix #2 >
|
|
63
|
+
* . . . . . . . . . . . . . .
|
|
64
|
+
* < Prefix #n > : < Full URI for prefix #n >
|
|
65
|
+
* }
|
|
66
|
+
*
|
|
67
|
+
* The sections must be arranged in the following order:
|
|
68
|
+
*
|
|
69
|
+
* Prefices // If any
|
|
70
|
+
* {
|
|
71
|
+
* . . .
|
|
72
|
+
* }
|
|
73
|
+
* Axioms // If any
|
|
74
|
+
* {
|
|
75
|
+
* . . .
|
|
76
|
+
* }
|
|
77
|
+
* Rules // Must necessarily be present
|
|
78
|
+
* {
|
|
79
|
+
* . . .
|
|
80
|
+
* }
|
|
81
|
+
*
|
|
82
|
+
* Variables in the rules must be literals consisting of one symbol only.
|
|
83
|
+
* They must NOT be surrounded by angle braces.
|
|
84
|
+
* ONLY rule statements may contain variables.
|
|
85
|
+
*
|
|
86
|
+
* The contents of this file is translated into java code and is output
|
|
87
|
+
* to com.ontotext.trree.RdfsHashInferencer and com.ontotext.trree.OwlHashInferencer.
|
|
88
|
+
* Use program RuleCompiler.java in order to compile this file.
|
|
89
|
+
* Please do not make changes in file generated files because
|
|
90
|
+
* next time the translator is started the changes will disappear.
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
Prefices
|
|
95
|
+
{
|
|
96
|
+
rdf : http://www.w3.org/1999/02/22-rdf-syntax-ns#
|
|
97
|
+
rdfs : http://www.w3.org/2000/01/rdf-schema#
|
|
98
|
+
owl : http://www.w3.org/2002/07/owl#
|
|
99
|
+
xsd : http://www.w3.org/2001/XMLSchema#
|
|
100
|
+
onto : http://www.ontotext.com/
|
|
101
|
+
psys : http://proton.semanticweb.org/protonsys#
|
|
102
|
+
pext : http://proton.semanticweb.org/protonext#
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
Axioms
|
|
106
|
+
{
|
|
107
|
+
// RDF axiomatic triples (from RDF Semantics, section 3.1):
|
|
108
|
+
|
|
109
|
+
<rdf:type> <rdf:type> <rdf:Property>
|
|
110
|
+
<rdf:subject> <rdf:type> <rdf:Property>
|
|
111
|
+
<rdf:predicate> <rdf:type> <rdf:Property>
|
|
112
|
+
<rdf:object> <rdf:type> <rdf:Property>
|
|
113
|
+
<rdf:first> <rdf:type> <rdf:Property>
|
|
114
|
+
<rdf:rest> <rdf:type> <rdf:Property>
|
|
115
|
+
<rdf:value> <rdf:type> <rdf:Property>
|
|
116
|
+
<rdf:nil> <rdf:type> <rdf:List>
|
|
117
|
+
|
|
118
|
+
// RDFS axiomatic triples (from RDF Semantics, section 4.1):
|
|
119
|
+
|
|
120
|
+
/*[partialRDFS]*/
|
|
121
|
+
<rdf:type> <rdfs:domain> <rdfs:Resource>
|
|
122
|
+
|
|
123
|
+
<rdfs:domain> <rdfs:domain> <rdf:Property>
|
|
124
|
+
<rdfs:range> <rdfs:domain> <rdf:Property>
|
|
125
|
+
<rdfs:subPropertyOf> <rdfs:domain> <rdf:Property>
|
|
126
|
+
<rdfs:subClassOf> <rdfs:domain> <rdfs:Class>
|
|
127
|
+
/*[partialRDFS]*/
|
|
128
|
+
|
|
129
|
+
<rdf:subject> <rdfs:domain> <rdf:Statement>
|
|
130
|
+
<rdf:predicate> <rdfs:domain> <rdf:Statement>
|
|
131
|
+
<rdf:object> <rdfs:domain> <rdf:Statement>
|
|
132
|
+
|
|
133
|
+
/*[partialRDFS]*/
|
|
134
|
+
<rdfs:member> <rdfs:domain> <rdfs:Resource>
|
|
135
|
+
<rdf:first> <rdfs:domain> <rdf:List>
|
|
136
|
+
<rdf:rest> <rdfs:domain> <rdf:List>
|
|
137
|
+
<rdfs:seeAlso> <rdfs:domain> <rdfs:Resource>
|
|
138
|
+
<rdfs:isDefinedBy> <rdfs:domain> <rdfs:Resource>
|
|
139
|
+
<rdfs:comment> <rdfs:domain> <rdfs:Resource>
|
|
140
|
+
<rdfs:label> <rdfs:domain> <rdfs:Resource>
|
|
141
|
+
<rdf:value> <rdfs:domain> <rdfs:Resource>
|
|
142
|
+
|
|
143
|
+
// <rdf:type> <rdfs:range> <rdfs:Class>
|
|
144
|
+
<rdfs:domain> <rdfs:range> <rdfs:Class>
|
|
145
|
+
<rdfs:range> <rdfs:range> <rdfs:Class>
|
|
146
|
+
<rdfs:subPropertyOf> <rdfs:range> <rdf:Property>
|
|
147
|
+
<rdfs:subClassOf> <rdfs:range> <rdfs:Class>
|
|
148
|
+
|
|
149
|
+
<rdf:subject> <rdfs:range> <rdfs:Resource>
|
|
150
|
+
<rdf:predicate> <rdfs:range> <rdfs:Resource>
|
|
151
|
+
<rdf:object> <rdfs:range> <rdfs:Resource>
|
|
152
|
+
<rdfs:member> <rdfs:range> <rdfs:Resource>
|
|
153
|
+
<rdf:first> <rdfs:range> <rdfs:Resource>
|
|
154
|
+
<rdf:rest> <rdfs:range> <rdf:List>
|
|
155
|
+
|
|
156
|
+
<rdfs:seeAlso> <rdfs:range> <rdfs:Resource>
|
|
157
|
+
<rdfs:isDefinedBy> <rdfs:range> <rdfs:Resource>
|
|
158
|
+
<rdfs:comment> <rdfs:range> <rdfs:Literal>
|
|
159
|
+
<rdfs:label> <rdfs:range> <rdfs:Literal>
|
|
160
|
+
|
|
161
|
+
<rdf:value> <rdfs:range> <rdfs:Resource>
|
|
162
|
+
/*[partialRDFS]*/
|
|
163
|
+
|
|
164
|
+
<rdf:Alt> <rdfs:subClassOf> <rdfs:Container>
|
|
165
|
+
<rdf:Bag> <rdfs:subClassOf> <rdfs:Container>
|
|
166
|
+
<rdf:Seq> <rdfs:subClassOf> <rdfs:Container>
|
|
167
|
+
<rdfs:ContainerMembershipProperty> <rdfs:subClassOf> <rdf:Property>
|
|
168
|
+
|
|
169
|
+
<rdfs:isDefinedBy> <rdfs:subPropertyOf> <rdfs:seeAlso>
|
|
170
|
+
|
|
171
|
+
<rdf:XMLLiteral> <rdf:type> <rdfs:Datatype>
|
|
172
|
+
<rdf:XMLLiteral> <rdfs:subClassOf> <rdfs:Literal>
|
|
173
|
+
<rdfs:Datatype> <rdfs:subClassOf> <rdfs:Class>
|
|
174
|
+
|
|
175
|
+
// OWL trivial statements in addition (OWL Horst)
|
|
176
|
+
// the OWL schema should be imported as part of the OWLMemSchemaRepository initialization:
|
|
177
|
+
|
|
178
|
+
<owl:equivalentClass> <rdf:type> <owl:TransitiveProperty>
|
|
179
|
+
<owl:equivalentClass> <rdf:type> <owl:SymmetricProperty>
|
|
180
|
+
<owl:equivalentClass> <rdfs:subPropertyOf> <rdfs:subClassOf>
|
|
181
|
+
<owl:equivalentProperty> <rdf:type> <owl:TransitiveProperty>
|
|
182
|
+
<owl:equivalentProperty> <rdf:type> <owl:SymmetricProperty>
|
|
183
|
+
<owl:equivalentProperty> <rdfs:subPropertyOf> <rdfs:subPropertyOf>
|
|
184
|
+
|
|
185
|
+
// redundant! supported by special rules for owl:sameAs
|
|
186
|
+
// <owl:sameAs> <rdf:type> <owl:TransitiveProperty>
|
|
187
|
+
// <owl:sameAs> <rdf:type> <owl:SymmetricProperty>
|
|
188
|
+
<owl:inverseOf> <rdf:type> <owl:SymmetricProperty>
|
|
189
|
+
|
|
190
|
+
// those properties are implemented using owl:TransitiveProperty for performance reasons
|
|
191
|
+
// The specific RDFS rule are removed from the final ruleset [rdfs5, rdfs11]
|
|
192
|
+
<rdfs:subClassOf> <rdf:type> <owl:TransitiveProperty>
|
|
193
|
+
<rdfs:subPropertyOf> <rdf:type> <owl:TransitiveProperty>
|
|
194
|
+
|
|
195
|
+
// The [rdfs9] rule is removed from the final ruleset. Impelemnted as follows
|
|
196
|
+
<rdf:type> <psys:transitiveOver> <rdfs:subClassOf>
|
|
197
|
+
|
|
198
|
+
/*
|
|
199
|
+
// Rules rdfs_ext1 and rdfs_ext2
|
|
200
|
+
<rdfs:domain> <psys:transitiveOver> <rdfs:subClassOf>
|
|
201
|
+
<rdfs:range> <psys:transitiveOver> <rdfs:subClassOf>
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
// owl:differentFrom is symmetric
|
|
205
|
+
<owl:differentFrom> <rdf:type> <owl:SymmetricProperty>
|
|
206
|
+
<xsd:nonNegativeInteger> <rdf:type> <rdfs:Datatype>
|
|
207
|
+
<xsd:string> <rdf:type> <rdfs:Datatype>
|
|
208
|
+
|
|
209
|
+
<rdf:_1> <rdf:type> <rdf:Property>
|
|
210
|
+
<rdf:_1> <rdf:type> <rdfs:ContainerMembershipProperty>
|
|
211
|
+
<rdf:_1> <rdfs:domain> <rdfs:Resource>
|
|
212
|
+
<rdf:_1> <rdfs:range> <rdfs:Resource>
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
Rules
|
|
216
|
+
{
|
|
217
|
+
/*[partialRDFS]*/
|
|
218
|
+
Id: rdf1_rdfs4a_4b
|
|
219
|
+
x a y
|
|
220
|
+
-------------------------------
|
|
221
|
+
x <rdf:type> <rdfs:Resource>
|
|
222
|
+
a <rdf:type> <rdfs:Resource>
|
|
223
|
+
y <rdf:type> <rdfs:Resource>
|
|
224
|
+
/*[partialRDFS]*/
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
Id: rdfs2
|
|
228
|
+
x a y [Constraint a != <rdf:type>]
|
|
229
|
+
a <rdfs:domain> z [Constraint z != <rdfs:Resource>]
|
|
230
|
+
-------------------------------
|
|
231
|
+
x <rdf:type> z
|
|
232
|
+
|
|
233
|
+
Id: rdfs3
|
|
234
|
+
x a u
|
|
235
|
+
a <rdfs:range> z [Constraint z != <rdfs:Resource>]
|
|
236
|
+
-------------------------------
|
|
237
|
+
u <rdf:type> z
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
Id: rdfs6
|
|
241
|
+
a <rdf:type> <rdf:Property>
|
|
242
|
+
-------------------------------
|
|
243
|
+
a <rdfs:subPropertyOf> a
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
Id: rdfs7
|
|
247
|
+
x a y
|
|
248
|
+
a <rdfs:subPropertyOf> b [Constraint a != b]
|
|
249
|
+
-------------------------------
|
|
250
|
+
x b y
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
Id: rdfs8_10
|
|
254
|
+
x <rdf:type> <rdfs:Class>
|
|
255
|
+
-------------------------------
|
|
256
|
+
|
|
257
|
+
x <rdfs:subClassOf> <rdfs:Resource>
|
|
258
|
+
x <rdfs:subClassOf> x
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
Id: rdfs12
|
|
262
|
+
x <rdf:type> <rdfs:ContainerMembershipProperty>
|
|
263
|
+
-------------------------------
|
|
264
|
+
x <rdfs:subPropertyOf> <rdfs:member>
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
Id: rdfs13
|
|
268
|
+
x <rdf:type> <rdfs:Datatype>
|
|
269
|
+
-------------------------------
|
|
270
|
+
x <rdfs:subClassOf> <rdfs:Literal>
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
//==============================================================================
|
|
274
|
+
// PROTON specific rules
|
|
275
|
+
//==============================================================================
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
// Support for property psys:transitiveOver. With its aid it is possible
|
|
279
|
+
// to define relationships as that between the rdf:type and rdfs:subClassOf.
|
|
280
|
+
//
|
|
281
|
+
Id: proton_TransitiveOver
|
|
282
|
+
p <psys:transitiveOver> q
|
|
283
|
+
x p y
|
|
284
|
+
y q z
|
|
285
|
+
-------------------------------
|
|
286
|
+
x p z
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
Id: proton_TransProp
|
|
290
|
+
// Infers OWL property transitivity from psys:transitiveOver.
|
|
291
|
+
// It serves as a replacement for owl_TransProp.
|
|
292
|
+
//
|
|
293
|
+
p <rdf:type> <owl:TransitiveProperty>
|
|
294
|
+
-------------------------------
|
|
295
|
+
p <psys:transitiveOver> p
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
Id: proton_TransPropInduct
|
|
299
|
+
// Infers psys:transitiveOver from OWL property transitivity.
|
|
300
|
+
//
|
|
301
|
+
p <psys:transitiveOver> p
|
|
302
|
+
-------------------------------
|
|
303
|
+
p <rdf:type> <owl:TransitiveProperty>
|
|
304
|
+
|
|
305
|
+
Id: Proton_roleHolder
|
|
306
|
+
//
|
|
307
|
+
x <pext:roleHolder> y
|
|
308
|
+
x <pext:roleIn> z
|
|
309
|
+
y <rdf:type> <pext:Agent>
|
|
310
|
+
-------------------------------
|
|
311
|
+
y <pext:involvedIn> z
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
//==============================================================================
|
|
315
|
+
// OWL-Horst supporting rules
|
|
316
|
+
//==============================================================================
|
|
317
|
+
|
|
318
|
+
Id: owl_invOf
|
|
319
|
+
// Support for owl:inverseOf
|
|
320
|
+
x p y
|
|
321
|
+
p <owl:inverseOf> q
|
|
322
|
+
-------------------------------
|
|
323
|
+
y q x
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
Id: owl_invOfBySymProp
|
|
327
|
+
// Support for owl:SymmetricProperty. The symmetric properties are defined
|
|
328
|
+
// as inverse to themselves, which is sufficient to cover their semantics
|
|
329
|
+
//
|
|
330
|
+
p <rdf:type> <owl:SymmetricProperty>
|
|
331
|
+
-------------------------------
|
|
332
|
+
p <owl:inverseOf> p
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
Id: owl_SymPropByInverse
|
|
336
|
+
// Related to owl_invOfBySymProp
|
|
337
|
+
//
|
|
338
|
+
p <owl:inverseOf> p
|
|
339
|
+
-------------------------------
|
|
340
|
+
p <rdf:type> <owl:SymmetricProperty>
|
|
341
|
+
|
|
342
|
+
/*
|
|
343
|
+
Id: owl_TransProp
|
|
344
|
+
// Standard support for owl:TransitiveProperty. In fact, this rule is not used;
|
|
345
|
+
// for performance reasons, it is replaced by proton_TransProp.
|
|
346
|
+
//
|
|
347
|
+
p <rdf:type> <owl:TransitiveProperty>
|
|
348
|
+
x p y [Constraint x != y]
|
|
349
|
+
y p z [Constraint y != z]
|
|
350
|
+
-------------------------------
|
|
351
|
+
x p z
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
Id: owl_FunctProp
|
|
356
|
+
// Support for owl:FunctionalProperty. Implemented as equality (owl:sameAs)
|
|
357
|
+
// between the multiple objects of the same subject in statements where a
|
|
358
|
+
// functional property is used as a predicate.
|
|
359
|
+
//
|
|
360
|
+
p <rdf:type> <owl:FunctionalProperty>
|
|
361
|
+
x p y [Constraint y != z, p != <rdf:type>]
|
|
362
|
+
x p z [Constraint z != y] [Cut]
|
|
363
|
+
-------------------------------
|
|
364
|
+
y <owl:sameAs> z
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
Id: owl_InvFunctProp
|
|
368
|
+
// Support for owl:InverseFunctionalProperty. An implementation analogous to
|
|
369
|
+
// that of owl:FunctionalProperty
|
|
370
|
+
//
|
|
371
|
+
p <rdf:type> <owl:InverseFunctionalProperty>
|
|
372
|
+
y p x [Constraint y != z, p != <rdf:type>]
|
|
373
|
+
z p x [Constraint z != y] [Cut]
|
|
374
|
+
-------------------------------
|
|
375
|
+
y <owl:sameAs> z
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
Id: owl_sameAsCopySubj
|
|
379
|
+
// Copy of statement over owl:sameAs on the subject. The support for owl:sameAs
|
|
380
|
+
// is implemented through replication of the statements where the equivalent
|
|
381
|
+
// resources appear as subject, predicate, or object. See also the couple of
|
|
382
|
+
// rules below
|
|
383
|
+
//
|
|
384
|
+
x <owl:sameAs> y [Constraint x != y]
|
|
385
|
+
x p z //[Constraint p != <owl:sameAs>]
|
|
386
|
+
-------------------------------
|
|
387
|
+
y p z
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
Id: owl_sameAsCopyPred
|
|
391
|
+
// Copy of statement over owl:sameAs on the predicate
|
|
392
|
+
//
|
|
393
|
+
p <owl:sameAs> q [Constraint p != q]
|
|
394
|
+
x p y
|
|
395
|
+
-------------------------------
|
|
396
|
+
x q y
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
Id: owl_sameAsCopyObj
|
|
400
|
+
// Copy of statement over owl:sameAs on the object
|
|
401
|
+
//
|
|
402
|
+
x <owl:sameAs> y [Constraint x != y]
|
|
403
|
+
z p x //[Constraint p != <owl:sameAs>]
|
|
404
|
+
-------------------------------
|
|
405
|
+
z p y
|
|
406
|
+
**/
|
|
407
|
+
|
|
408
|
+
Id: owl_EquivClassBySubClass
|
|
409
|
+
// The support for property owl:equivalentClass is implemented since it was
|
|
410
|
+
// declared to be symmetric and transitive and thus a sub-property of
|
|
411
|
+
// rdfs:subClassOf. This particular approach was chosen in order to achieve
|
|
412
|
+
// performance optimization, but the user should be aware of the possible
|
|
413
|
+
// "side effects" when traversing the class hierarchy. By means of this
|
|
414
|
+
// property and of the following rule, it is possible to conclude the class
|
|
415
|
+
// equivalence for classes that are each other�s sub classes.
|
|
416
|
+
//
|
|
417
|
+
x <rdfs:subClassOf> y [Constraint y != x]
|
|
418
|
+
y <rdfs:subClassOf> x [Cut]
|
|
419
|
+
-------------------------------
|
|
420
|
+
x <owl:equivalentClass> y
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
Id: owl_EquivPropBySubProp
|
|
424
|
+
// The support for property owl:equivalentProperty is implemented since it was
|
|
425
|
+
// declared to be symmetric and transitive and thus a sub-property of
|
|
426
|
+
// rdfs:subPropertyOf. This particular approach was chosen in order to achieve
|
|
427
|
+
// performance optimization, but the user should be aware of the possible
|
|
428
|
+
// "side effects" when traversing the property hierarchy. By means of this
|
|
429
|
+
// property and of the following rule, it is possible to conclude the property
|
|
430
|
+
// equivalence for properties that are each other�s sub properties.
|
|
431
|
+
//
|
|
432
|
+
x <rdfs:subPropertyOf> y [Constraint y != x]
|
|
433
|
+
y <rdfs:subPropertyOf> x [Cut]
|
|
434
|
+
-------------------------------
|
|
435
|
+
x <owl:equivalentProperty> y
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
Id: owl_typeByAllVal
|
|
439
|
+
// Support for restrictions owl:onProperty of type owl:allValuesFrom.
|
|
440
|
+
// The support is limited to the inference of a class membership for all the
|
|
441
|
+
// values of the triples, whose subjects are members of the restriction.
|
|
442
|
+
// No inference of the restriction membership in the opposite direction of
|
|
443
|
+
// the rule is made.
|
|
444
|
+
//
|
|
445
|
+
x <owl:onProperty> p
|
|
446
|
+
u <rdf:type> x
|
|
447
|
+
x <owl:allValuesFrom> y
|
|
448
|
+
u p v
|
|
449
|
+
-------------------------------
|
|
450
|
+
v <rdf:type> y
|
|
451
|
+
|
|
452
|
+
Id: owl_typeByHasVal
|
|
453
|
+
// Support for restrictions owl:onProperty of type owl:hasValue.
|
|
454
|
+
// Derives a Restriction membership for nodes involved as subjects in
|
|
455
|
+
// statements, where the predicate and the object match those specified in the
|
|
456
|
+
// restriction.
|
|
457
|
+
//
|
|
458
|
+
r <owl:onProperty> p
|
|
459
|
+
r <owl:hasValue> v
|
|
460
|
+
i p v
|
|
461
|
+
-------------------------------
|
|
462
|
+
i <rdf:type> r
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
Id: owl_AttrByHasVal
|
|
466
|
+
// Support for restrictions owl:onProperty of type owl:hasValue.
|
|
467
|
+
// A new triple with the defined predicate and the value for the nodes that are
|
|
468
|
+
// members of the restriction.
|
|
469
|
+
//
|
|
470
|
+
x <owl:hasValue> y
|
|
471
|
+
x <owl:onProperty> p
|
|
472
|
+
u <rdf:type> x
|
|
473
|
+
-------------------------------
|
|
474
|
+
u p y
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
Id: owl_typeBySomeVal
|
|
478
|
+
// Support for restrictions owl:onProperty of type owl:someValuesFrom. The
|
|
479
|
+
// support is limited to the inference of a restriction membership for nodes
|
|
480
|
+
// related to other nodes (values) of the corresponding class through the
|
|
481
|
+
// restricted property.
|
|
482
|
+
//
|
|
483
|
+
q <rdf:type> c
|
|
484
|
+
r <owl:onProperty> p
|
|
485
|
+
r <owl:someValuesFrom> c
|
|
486
|
+
i p q
|
|
487
|
+
-------------------------------
|
|
488
|
+
i <rdf:type> r
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
//==============================================================================
|
|
492
|
+
// LUBM supporting rules (included in owl-horst ruleset)
|
|
493
|
+
//==============================================================================
|
|
494
|
+
|
|
495
|
+
// The support for owl:intersectionOf relies on the four rules, given bellow,
|
|
496
|
+
// by means of which the inference of class membership is possible in both
|
|
497
|
+
// directions. First, for the explicit members of the intersection, the rules
|
|
498
|
+
// derive the class membership of each of the intersecting classes and then,
|
|
499
|
+
// for each instance (member) of all of the intersecting classes, they derive
|
|
500
|
+
// the class membership of the intersection.
|
|
501
|
+
//
|
|
502
|
+
|
|
503
|
+
Id: owl_subclassByIntersect1
|
|
504
|
+
c <owl:intersectionOf> x
|
|
505
|
+
-------------------------------
|
|
506
|
+
c <onto:_interOf> x [Context <onto:scm_int>]
|
|
507
|
+
|
|
508
|
+
Id: owl_subclassByIntersect2
|
|
509
|
+
c <onto:_interOf> x [Context <onto:scm_int>]
|
|
510
|
+
x <rdf:first> y
|
|
511
|
+
x <rdf:rest> z
|
|
512
|
+
-------------------------------
|
|
513
|
+
c <rdfs:subClassOf> y
|
|
514
|
+
c <onto:_interOf> z [Context <onto:scm_int>]
|
|
515
|
+
|
|
516
|
+
Id: owl_typeByIntersect_1
|
|
517
|
+
i <onto:_allTypes> b [Context <onto:_typeByInt>]
|
|
518
|
+
z <owl:intersectionOf> b
|
|
519
|
+
--------------------------------
|
|
520
|
+
i <rdf:type> z
|
|
521
|
+
|
|
522
|
+
Id: owl_typeByIntersect_2
|
|
523
|
+
b <rdf:first> c
|
|
524
|
+
b <rdf:rest> <rdf:nil>
|
|
525
|
+
i <rdf:type> c
|
|
526
|
+
--------------------------------
|
|
527
|
+
i <onto:_allTypes> b [Context <onto:_typeByInt>]
|
|
528
|
+
|
|
529
|
+
Id: owl_typeByIntersect_3
|
|
530
|
+
b <rdf:first> c
|
|
531
|
+
b <rdf:rest> b1
|
|
532
|
+
i <onto:_allTypes> b1 [Context <onto:_typeByInt>]
|
|
533
|
+
i <rdf:type> c
|
|
534
|
+
--------------------------------
|
|
535
|
+
i <onto:_allTypes> b [Context <onto:_typeByInt>]
|
|
536
|
+
|
|
537
|
+
//==============================================================================
|
|
538
|
+
// This rule file contains both OWL-Horst rules and OWL-Max rules.
|
|
539
|
+
// The OWL-Horst rule set is a subset of the OWL-Max rules
|
|
540
|
+
// The rules above this point all belong to OWL-Horst AND OWL-Max
|
|
541
|
+
// The rules below this point only belong to OWL-Max
|
|
542
|
+
// The next line is the dividing point:
|
|
543
|
+
// OWL-Max supporting rules
|
|
544
|
+
//==============================================================================
|
|
545
|
+
|
|
546
|
+
Id: rdfs_ext3
|
|
547
|
+
// From the standards RDFS semantics
|
|
548
|
+
//
|
|
549
|
+
p <rdfs:subPropertyOf> q [Constraint p != q]
|
|
550
|
+
q <rdfs:domain> c
|
|
551
|
+
-------------------------------
|
|
552
|
+
p <rdfs:domain> c
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
Id: rdfs_ext4
|
|
556
|
+
// From the standards RDFS semantics
|
|
557
|
+
//
|
|
558
|
+
p <rdfs:subPropertyOf> q [Constraint p != q]
|
|
559
|
+
q <rdfs:range> c
|
|
560
|
+
-------------------------------
|
|
561
|
+
p <rdfs:range> c
|
|
562
|
+
|
|
563
|
+
Id: owl_FunctPropByInvFunc
|
|
564
|
+
// Inference of membership to FunctionalProperty by inverse property, which is
|
|
565
|
+
// an InverseFunctionalProperty
|
|
566
|
+
//
|
|
567
|
+
p <rdf:type> <owl:InverseFunctionalProperty>
|
|
568
|
+
p <owl:inverseOf> q
|
|
569
|
+
-------------------------------
|
|
570
|
+
q <rdf:type> <owl:FunctionalProperty>
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
Id: owl_InvFunctPropByFunctProp
|
|
574
|
+
// Inference of membership to InverseFunctionalProperty by inverse property,
|
|
575
|
+
// which is an FunctionalProperty. [TBOX]
|
|
576
|
+
//
|
|
577
|
+
p <rdf:type> <owl:FunctionalProperty>
|
|
578
|
+
p <owl:inverseOf> q
|
|
579
|
+
-------------------------------
|
|
580
|
+
q <rdf:type> <owl:InverseFunctionalProperty>
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
Id: owl_allDiff1
|
|
584
|
+
// The support for owl:AllDifferent is implemented using pair of rules that entail
|
|
585
|
+
// owl:differentFrom statements for all the distinct members of a collection by
|
|
586
|
+
// which the owl:AllDifferent restriction is defined.
|
|
587
|
+
// CHECK
|
|
588
|
+
x <owl:distinctMembers> m
|
|
589
|
+
m <rdf:rest> n [Constraint n != <rdf:nil>]
|
|
590
|
+
-------------------------------
|
|
591
|
+
x <owl:distinctMembers> n
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
Id: owl_allDiff2
|
|
595
|
+
// Related to rule owl_allDiff1
|
|
596
|
+
//
|
|
597
|
+
x <owl:distinctMembers> m
|
|
598
|
+
x <owl:distinctMembers> n [Constraint n != m ]
|
|
599
|
+
m <rdf:first> i
|
|
600
|
+
n <rdf:first> j [Constraint j != i]
|
|
601
|
+
-------------------------------
|
|
602
|
+
i <owl:differentFrom> j
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
// The support for owl:unionOf is limited to the derivation of a class
|
|
606
|
+
// membership for classes that form the union and note: only for the
|
|
607
|
+
// explicit members of the union.
|
|
608
|
+
// This rule generates a class that is the union of the rest and makes
|
|
609
|
+
// it a subClass of the 'big' union
|
|
610
|
+
|
|
611
|
+
Id: owl_subClassByUnion1
|
|
612
|
+
a <onto:_unionOf> m [Context <onto:_union>]
|
|
613
|
+
m <rdf:first> c
|
|
614
|
+
m <rdf:rest> d
|
|
615
|
+
-------------------------------
|
|
616
|
+
c <rdfs:subClassOf> a
|
|
617
|
+
a <onto:_unionOf> d [Context <onto:_union>]
|
|
618
|
+
|
|
619
|
+
// Related to rule owl_subClassByUnion1
|
|
620
|
+
Id: owl_subClassByUnion2
|
|
621
|
+
a <owl:unionOf> m
|
|
622
|
+
-------------------------------
|
|
623
|
+
a <onto:_unionOf> m [Context <onto:_union>]
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
// The support for owl:oneOf is implemented, in order to derive the class
|
|
627
|
+
// membership of the instances that form an enumerated class, thus introducing
|
|
628
|
+
// smaller intermediate enumerations that are subclasses of larger collections.
|
|
629
|
+
|
|
630
|
+
Id: owl_oneOf1
|
|
631
|
+
c <owl:oneOf> x
|
|
632
|
+
------------------
|
|
633
|
+
c <onto:_oneOf> x [Context <onto:_cls-oo>]
|
|
634
|
+
|
|
635
|
+
// Related to rule owl_oneOf1
|
|
636
|
+
Id: owl_oneOf2
|
|
637
|
+
c <onto:_oneOf> x [Context <onto:_cls-oo>]
|
|
638
|
+
x <rdf:first> y
|
|
639
|
+
x <rdf:rest> z
|
|
640
|
+
-------------------------------
|
|
641
|
+
y <rdf:type> c
|
|
642
|
+
c <onto:_oneOf> z [Context <onto:_cls-oo>][Constraint z != <rdf:nil>]
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
// rule: OWL someVF subclass over similar someValues over subProperties
|
|
647
|
+
Id: owl_subClassBetweenSomeVal
|
|
648
|
+
r <owl:onProperty> p
|
|
649
|
+
r <owl:someValuesFrom> c
|
|
650
|
+
s <owl:onProperty> q
|
|
651
|
+
s <owl:someValuesFrom> d
|
|
652
|
+
q <rdfs:subPropertyOf> p
|
|
653
|
+
d <rdfs:subClassOf> c
|
|
654
|
+
-------------------------------
|
|
655
|
+
s <rdfs:subClassOf> r
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
// rule: OWL allVF subclass over similar allValues over subProperties
|
|
659
|
+
Id: owl_subClassBetweenAllVal
|
|
660
|
+
r <owl:onProperty> p
|
|
661
|
+
r <owl:allValuesFrom> c
|
|
662
|
+
s <owl:onProperty> q
|
|
663
|
+
s <owl:allValuesFrom> d
|
|
664
|
+
p <rdfs:subPropertyOf> q
|
|
665
|
+
d <rdfs:subClassOf> c
|
|
666
|
+
-------------------------------
|
|
667
|
+
s <rdfs:subClassOf> r
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
// rule: OWL hasValue subclass over similar hasValue over subProperties
|
|
671
|
+
Id: owl_subClassBetweenHasVal
|
|
672
|
+
r <owl:onProperty> p
|
|
673
|
+
r <owl:hasValue> i
|
|
674
|
+
s <owl:onProperty> q
|
|
675
|
+
s <owl:hasValue> i
|
|
676
|
+
q <rdfs:subPropertyOf> p
|
|
677
|
+
-------------------------------
|
|
678
|
+
s <rdfs:subClassOf> r
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
Id: owl_subClassFromHasValToSomeVal
|
|
682
|
+
r <owl:onProperty> p
|
|
683
|
+
r <owl:hasValue> i
|
|
684
|
+
i <rdf:type> c
|
|
685
|
+
s <owl:onProperty> q
|
|
686
|
+
s <owl:someValuesFrom> c
|
|
687
|
+
p <rdfs:subPropertyOf> q
|
|
688
|
+
-------------------------------
|
|
689
|
+
r <rdfs:subClassOf> s
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
Id: owl_subClassFromSomeValToMinCard1
|
|
693
|
+
r <owl:onProperty> p
|
|
694
|
+
r <owl:someValuesFrom> c
|
|
695
|
+
s <owl:onProperty> q
|
|
696
|
+
s <owl:minCardinality> "1"^^xsd:nonNegativeInteger
|
|
697
|
+
p <rdfs:subPropertyOf> q
|
|
698
|
+
-------------------------------
|
|
699
|
+
r <rdfs:subClassOf> s
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
Id: owl_typeByMinCard1
|
|
703
|
+
r <owl:onProperty> p
|
|
704
|
+
r <owl:minCardinality> "1"^^xsd:nonNegativeInteger
|
|
705
|
+
i p j
|
|
706
|
+
-------------------------------
|
|
707
|
+
i <rdf:type> r
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
Id: owl_sameAsByMaxCard1
|
|
711
|
+
i <rdf:type> r
|
|
712
|
+
r <owl:onProperty> p
|
|
713
|
+
r <owl:maxCardinality> "1"^^xsd:nonNegativeInteger
|
|
714
|
+
i p j
|
|
715
|
+
i p k [Constraint k != j]
|
|
716
|
+
-------------------------------
|
|
717
|
+
j <owl:sameAs> k
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
Id: owl_sameAsByCard1
|
|
721
|
+
i <rdf:type> r
|
|
722
|
+
r <owl:onProperty> p
|
|
723
|
+
r <owl:cardinality> "1"^^xsd:nonNegativeInteger
|
|
724
|
+
i p j
|
|
725
|
+
i p k [Constraint k != j]
|
|
726
|
+
-------------------------------
|
|
727
|
+
j <owl:sameAs> k
|
|
728
|
+
|
|
729
|
+
/* CHECK
|
|
730
|
+
Id: owl_minMaxCardByCard
|
|
731
|
+
r <owl:onProperty> p
|
|
732
|
+
r <owl:cardinality> "1"^^xsd:nonNegativeInteger
|
|
733
|
+
-------------------------------
|
|
734
|
+
w <owl:onProperty> p
|
|
735
|
+
w <owl:minCardinality> "1"^^xsd:nonNegativeInteger
|
|
736
|
+
z <owl:onProperty> p
|
|
737
|
+
z <owl:maxCardinality> "1"^^xsd:nonNegativeInteger
|
|
738
|
+
r <rdfs:subClassOf> w
|
|
739
|
+
r <rdfs:subClassOf> z
|
|
740
|
+
*/
|
|
741
|
+
}
|