Package RDFClosure :: Module AxiomaticTriples
[hide private]
[frames] | no frames]

Source Code for Module RDFClosure.AxiomaticTriples

  1  #!/d/Bin/Python/python.exe 
  2  # -*- coding: utf-8 -*- 
  3  # 
  4  """ 
  5  Axiomatic triples to be (possibly) added to the final graph. 
  6   
  7  @requires: U{RDFLib<https://github.com/RDFLib/rdflib>}, 4.0.0 and higher 
  8  @license: This software is available for use under the U{W3C Software License<http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231>} 
  9  @organization: U{World Wide Web Consortium<http://www.w3.org>} 
 10  @author: U{Ivan Herman<a href="http://www.w3.org/People/Ivan/">} 
 11   
 12  """ 
 13   
 14  __author__  = 'Ivan Herman' 
 15  __contact__ = 'Ivan Herman, ivan@w3.org' 
 16  __license__ = u'W3C® SOFTWARE NOTICE AND LICENSE, http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231' 
 17   
 18  import rdflib 
 19  from RDFClosure.RDFS import Seq, Bag, Alt, Statement, Property, XMLLiteral, List 
 20  from RDFClosure.RDFS import RDFNS as ns_rdf 
 21  from RDFClosure.RDFS import subject, predicate, object, type, value, first, rest, nil 
 22  from RDFClosure.RDFS import Resource, Class, subClassOf, subPropertyOf, comment, label, domain, range 
 23  from RDFClosure.RDFS import seeAlso, isDefinedBy, Literal, Container, ContainerMembershipProperty, member, Datatype 
 24   
 25  from rdflib.namespace   import XSD as ns_xsd 
 26  from OWL import * 
 27   
 28  #: Simple RDF axiomatic triples (typing of subject, predicate, first, rest, etc) 
 29  _Simple_RDF_axiomatic_triples = [ 
 30          (type, type, Property), 
 31          (subject, type, Property), 
 32          (predicate, type, Property), 
 33          (object, type, Property), 
 34          (first, type, Property), 
 35          (rest, type, Property), 
 36          (value, type, Property), 
 37          (nil, type, List), 
 38  ] 
 39   
 40  #: RDFS axiomatic triples (domain and range, as well as class setting for a number of RDFS symbols) 
 41  _RDFS_axiomatic_triples = [ 
 42          (type, domain, Resource), 
 43          (domain, domain, Property), 
 44          (range, domain, Property), 
 45          (subPropertyOf, domain, Property), 
 46          (subClassOf, domain, Class), 
 47          (subject, domain, Statement), 
 48          (predicate, domain, Statement), 
 49          (object, domain, Statement), 
 50          (member, domain, Resource), 
 51          (first, domain, List), 
 52          (rest, domain, List), 
 53          (seeAlso, domain, Resource), 
 54          (isDefinedBy, domain, Resource), 
 55          (comment, domain, Resource), 
 56          (label, domain, Resource), 
 57          (value, domain, Resource), 
 58          (Property, type, Class), 
 59   
 60          (type, range, Class), 
 61          (domain, range, Class), 
 62          (range, range, Class), 
 63          (subPropertyOf, range, Property), 
 64          (subClassOf, range, Class), 
 65          (subject, range, Resource), 
 66          (predicate, range, Resource), 
 67          (object, range, Resource), 
 68          (member, range, Resource), 
 69          (first, range, Resource), 
 70          (rest, range, List), 
 71          (seeAlso, range, Resource), 
 72          (isDefinedBy, range, Resource), 
 73          (comment, range, Literal), 
 74          (label, range, Literal), 
 75          (value, range, Resource), 
 76   
 77          (Alt, subClassOf, Container), 
 78          (Bag, subClassOf, Container), 
 79          (Seq, subClassOf, Container), 
 80          (ContainerMembershipProperty, subClassOf, Property), 
 81   
 82          (isDefinedBy, subPropertyOf, seeAlso), 
 83   
 84          (XMLLiteral, type, Datatype), 
 85          (XMLLiteral, subClassOf, Literal), 
 86          (Datatype, subClassOf, Class), 
 87   
 88          # rdfs valid triples; these would be inferred by the RDFS expansion, but it may make things 
 89          # a bit faster to add these upfront 
 90          (Resource, type, Class), 
 91          (Class, type, Class), 
 92          (Literal, type, Class), 
 93          (XMLLiteral, type, Class), 
 94          (Datatype, type, Class), 
 95          (Seq, type, Class), 
 96          (Bag, type, Class), 
 97          (Alt, type, Class), 
 98          (Container, type, Class), 
 99          (List, type, Class), 
100          (ContainerMembershipProperty, type, Class), 
101          (Property, type, Class), 
102          (Statement, type, Class), 
103   
104          (domain, type, Property), 
105          (range, type, Property), 
106          (subPropertyOf, type, Property), 
107          (subClassOf, type, Property), 
108          (member, type, Property), 
109          (seeAlso, type, Property), 
110          (isDefinedBy, type, Property), 
111          (comment, type, Property), 
112          (label, type, Property) 
113  ] 
114   
115  #: RDFS Axiomatic Triples all together 
116  RDFS_Axiomatic_Triples    = _Simple_RDF_axiomatic_triples + _RDFS_axiomatic_triples 
117   
118  #: RDFS D-entailement triples, ie, possible subclassing of various datatypes 
119  RDFS_D_Axiomatic_Triples_subclasses = [ 
120          # See http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#built-in-datatypes 
121          (ns_xsd['decimal'], subClassOf, Literal), 
122   
123          (ns_xsd['integer'], subClassOf, ns_xsd['decimal']), 
124   
125          (ns_xsd['long'], subClassOf, ns_xsd['integer']), 
126          (ns_xsd['int'], subClassOf, ns_xsd['long']), 
127          (ns_xsd['short'], subClassOf, ns_xsd['int']), 
128          (ns_xsd['byte'], subClassOf, ns_xsd['short']), 
129   
130          (ns_xsd['nonNegativeInteger'], subClassOf, ns_xsd['integer']), 
131          (ns_xsd['positiveInteger'], subClassOf, ns_xsd['nonNegativeInteger']), 
132          (ns_xsd['unsignedLong'], subClassOf, ns_xsd['nonNegativeInteger']), 
133          (ns_xsd['unsignedInt'], subClassOf, ns_xsd['unsignedLong']), 
134          (ns_xsd['unsignedShort'], subClassOf, ns_xsd['unsignedInt']), 
135          (ns_xsd['unsignedByte'], subClassOf, ns_xsd['unsignedShort']), 
136   
137          (ns_xsd['nonPositiveInteger'], subClassOf, ns_xsd['integer']), 
138          (ns_xsd['negativeInteger'], subClassOf, ns_xsd['nonPositiveInteger']), 
139   
140          (ns_xsd['normalizedString'], subClassOf, ns_xsd['string']), 
141          (ns_xsd['token'], subClassOf, ns_xsd['normalizedString']), 
142          (ns_xsd['language'], subClassOf, ns_xsd['token']), 
143          (ns_xsd['Name'], subClassOf, ns_xsd['token']), 
144          (ns_xsd['NMTOKEN'], subClassOf, ns_xsd['token']), 
145   
146          (ns_xsd['NCName'], subClassOf, ns_xsd['Name']), 
147   
148          (ns_xsd['dateTimeStamp'], subClassOf, ns_xsd['dateTime']), 
149  ] 
150   
151  RDFS_D_Axiomatic_Triples_types = [ 
152          (ns_xsd['integer'], type, Datatype), 
153          (ns_xsd['decimal'], type, Datatype), 
154          (ns_xsd['nonPositiveInteger'], type, Datatype), 
155          (ns_xsd['nonPositiveInteger'], type, Datatype), 
156          (ns_xsd['positiveInteger'], type, Datatype), 
157          (ns_xsd['positiveInteger'], type, Datatype), 
158          (ns_xsd['long'], type, Datatype), 
159          (ns_xsd['int'], type, Datatype), 
160          (ns_xsd['short'], type, Datatype), 
161          (ns_xsd['byte'], type, Datatype), 
162          (ns_xsd['unsignedLong'], type, Datatype), 
163          (ns_xsd['unsignedInt'], type, Datatype), 
164          (ns_xsd['unsignedShort'], type, Datatype), 
165          (ns_xsd['unsignedByte'], type, Datatype), 
166          (ns_xsd['float'], type, Datatype), 
167          (ns_xsd['double'], type, Datatype), 
168          (ns_xsd['string'], type, Datatype), 
169          (ns_xsd['normalizedString'], type, Datatype), 
170          (ns_xsd['token'], type, Datatype), 
171          (ns_xsd['language'], type, Datatype), 
172          (ns_xsd['Name'], type, Datatype), 
173          (ns_xsd['NCName'], type, Datatype), 
174          (ns_xsd['NMTOKEN'], type, Datatype), 
175          (ns_xsd['boolean'], type, Datatype), 
176          (ns_xsd['hexBinary'], type, Datatype), 
177          (ns_xsd['base64Binary'], type, Datatype), 
178          (ns_xsd['anyURI'], type, Datatype), 
179          (ns_xsd['dateTimeStamp'], type, Datatype), 
180          (ns_xsd['dateTime'], type, Datatype), 
181          (Literal, type, Datatype), 
182          (XMLLiteral, type, Datatype), 
183  ] 
184   
185  RDFS_D_Axiomatic_Triples = RDFS_D_Axiomatic_Triples_types + RDFS_D_Axiomatic_Triples_subclasses 
186   
187  #: OWL Class axiomatic triples: definition of special classes 
188  _OWL_axiomatic_triples_Classes = [ 
189          (AllDifferent, type, Class), 
190          (AllDifferent, subClassOf, Resource), 
191   
192          (AllDisjointClasses, type, Class), 
193          (AllDisjointClasses, subClassOf, Resource), 
194   
195          (AllDisjointProperties, type, Class), 
196          (AllDisjointProperties, subClassOf, Resource), 
197   
198          (Annotation, type, Class), 
199          (Annotation, subClassOf, Resource), 
200   
201          (AnnotationProperty, type, Class), 
202          (AnnotationProperty, subClassOf, Property), 
203   
204          (AsymmetricProperty, type, Class), 
205          (AsymmetricProperty, subClassOf, Property), 
206   
207          (OWLClass, type, Class), 
208          (OWLClass, equivalentClass, Class), 
209   
210  #       (DataRange, type, Class), 
211  #       (DataRange, equivalentClass, Datatype), 
212   
213          (Datatype, type, Class), 
214   
215          (DatatypeProperty, type, Class), 
216          (DatatypeProperty, subClassOf, Property), 
217   
218          (DeprecatedClass, type, Class), 
219          (DeprecatedClass, subClassOf, Class), 
220   
221          (DeprecatedProperty, type, Class), 
222          (DeprecatedProperty, subClassOf, Property), 
223   
224          (FunctionalProperty, type, Class), 
225          (FunctionalProperty, subClassOf, Property), 
226   
227          (InverseFunctionalProperty, type, Class), 
228          (InverseFunctionalProperty, subClassOf, Property), 
229   
230          (IrreflexiveProperty, type, Class), 
231          (IrreflexiveProperty, subClassOf, Property), 
232   
233          (Literal, type, Datatype), 
234   
235  #       (NamedIndividual, type, Class), 
236  #       (NamedIndividual, equivalentClass, Resource), 
237   
238          (NegativePropertyAssertion, type, Class), 
239          (NegativePropertyAssertion, subClassOf, Resource), 
240   
241          (Nothing, type, Class), 
242          (Nothing, subClassOf, Thing ), 
243   
244          (ObjectProperty, type, Class), 
245          (ObjectProperty, equivalentClass, Property), 
246   
247          (Ontology, type, Class), 
248          (Ontology, subClassOf, Resource), 
249   
250          (OntologyProperty, type, Class), 
251          (OntologyProperty, subClassOf, Property), 
252   
253          (Property, type, Class), 
254   
255          (ReflexiveProperty, type, Class), 
256          (ReflexiveProperty, subClassOf, Property), 
257   
258          (Restriction, type, Class), 
259          (Restriction, subClassOf, Class), 
260   
261   
262          (SymmetricProperty, type, Class), 
263          (SymmetricProperty, subClassOf, Property), 
264   
265          (Thing, type, Class), 
266          (Thing, subClassOf, Resource), 
267   
268          (TransitiveProperty, type, Class), 
269          (TransitiveProperty, subClassOf, Property), 
270   
271          # OWL valid triples; some of these would be inferred by the OWL RL expansion, but it may make things 
272          # a bit faster to add these upfront 
273          (AllDisjointProperties, type, OWLClass), 
274          (AllDisjointClasses, type, OWLClass), 
275          (AllDisjointProperties, type, OWLClass), 
276          (Annotation, type, OWLClass), 
277          (AsymmetricProperty, type, OWLClass), 
278          (Axiom, type, OWLClass), 
279          (DataRange, type, OWLClass), 
280          (Datatype, type, OWLClass), 
281          (DatatypeProperty, type, OWLClass), 
282          (DeprecatedClass, type, OWLClass), 
283          (DeprecatedClass, subClassOf, OWLClass), 
284          (DeprecatedProperty, type, OWLClass), 
285          (FunctionalProperty, type, OWLClass), 
286          (InverseFunctionalProperty, type, OWLClass), 
287          (IrreflexiveProperty, type, OWLClass), 
288          (NamedIndividual, type, OWLClass), 
289          (NegativePropertyAssertion, type, OWLClass), 
290          (Nothing, type, OWLClass), 
291          (ObjectProperty, type, OWLClass), 
292          (Ontology, type, OWLClass), 
293          (OntologyProperty, type, OWLClass), 
294          (Property, type, OWLClass), 
295          (ReflexiveProperty, type, OWLClass), 
296          (Restriction, type, OWLClass), 
297          (Restriction, subClassOf, OWLClass), 
298  #       (SelfRestriction, type, OWLClass), 
299          (SymmetricProperty, type, OWLClass), 
300          (Thing, type, OWLClass), 
301          (TransitiveProperty, type, OWLClass), 
302  ] 
303   
304  #: OWL Property axiomatic triples: definition of domains and ranges 
305  _OWL_axiomatic_triples_Properties = [ 
306          (allValuesFrom, type, Property), 
307          (allValuesFrom, domain, Restriction), 
308          (allValuesFrom, range, Class), 
309   
310          (assertionProperty, type, Property), 
311          (assertionProperty, domain, NegativePropertyAssertion), 
312          (assertionProperty, range, Property), 
313   
314          (backwardCompatibleWith, type, OntologyProperty), 
315          (backwardCompatibleWith, type, AnnotationProperty), 
316          (backwardCompatibleWith, domain, Ontology), 
317          (backwardCompatibleWith, range, Ontology), 
318   
319  #       (bottomDataProperty, type, DatatypeProperty), 
320  # 
321  #       (bottomObjectProperty, type, ObjectProperty), 
322   
323  #       (cardinality, type, Property), 
324  #       (cardinality, domain, Restriction), 
325  #       (cardinality, range, ns_xsd["nonNegativeInteger"]), 
326   
327          (comment, type, AnnotationProperty), 
328          (comment, domain, Resource), 
329          (comment, range, Literal), 
330   
331          (complementOf, type, Property), 
332          (complementOf, domain, Class), 
333          (complementOf, range, Class), 
334   
335  # 
336  #       (datatypeComplementOf, type, Property), 
337  #       (datatypeComplementOf, domain, Datatype), 
338  #       (datatypeComplementOf, range, Datatype), 
339   
340          (deprecated, type, AnnotationProperty), 
341          (deprecated, domain, Resource), 
342          (deprecated, range, Resource), 
343   
344          (differentFrom, type, Property), 
345          (differentFrom, domain, Resource), 
346          (differentFrom, range, Resource), 
347   
348  #       (disjointUnionOf, type, Property), 
349  #       (disjointUnionOf, domain, Class), 
350  #       (disjointUnionOf, range, List), 
351   
352          (disjointWith, type, Property), 
353          (disjointWith, domain, Class), 
354          (disjointWith, range, Class), 
355   
356          (distinctMembers, type, Property), 
357          (distinctMembers, domain, AllDifferent), 
358          (distinctMembers, range, List), 
359   
360          (equivalentClass, type, Property), 
361          (equivalentClass, domain, Class), 
362          (equivalentClass, range, Class), 
363   
364          (equivalentProperty, type, Property), 
365          (equivalentProperty, domain, Property), 
366          (equivalentProperty, range, Property), 
367   
368          (hasKey, type, Property), 
369          (hasKey, domain, Class), 
370          (hasKey, range, List), 
371   
372          (hasValue, type, Property), 
373          (hasValue, domain, Restriction), 
374          (hasValue, range, Resource), 
375   
376          (imports, type, OntologyProperty), 
377          (imports, domain, Ontology), 
378          (imports, range, Ontology), 
379   
380          (incompatibleWith, type, OntologyProperty), 
381          (incompatibleWith, type, AnnotationProperty), 
382          (incompatibleWith, domain, Ontology), 
383          (incompatibleWith, range, Ontology), 
384   
385          (intersectionOf, type, Property), 
386          (intersectionOf, domain, Class), 
387          (intersectionOf, range, List), 
388   
389          (inverseOf, type, Property), 
390          (inverseOf, domain, Property), 
391          (inverseOf, range, Property), 
392   
393          (isDefinedBy, type, AnnotationProperty), 
394          (isDefinedBy, domain, Resource), 
395          (isDefinedBy, range, Resource), 
396   
397          (label, type, AnnotationProperty), 
398          (label, domain, Resource), 
399          (label, range, Literal), 
400   
401          (maxCardinality, type, Property), 
402          (maxCardinality, domain, Restriction), 
403          (maxCardinality, range, ns_xsd["nonNegativeInteger"]), 
404   
405          (maxQualifiedCardinality, type, Property), 
406          (maxQualifiedCardinality, domain, Restriction), 
407          (maxQualifiedCardinality, range, ns_xsd["nonNegativeInteger"]), 
408   
409          (members, type, Property), 
410          (members, domain, Resource), 
411          (members, range, List), 
412   
413  #       (minCardinality, type, Property), 
414  #       (minCardinality, domain, Restriction), 
415  #       (minCardinality, range, ns_xsd["nonNegativeInteger"]), 
416   
417  #       (minQualifiedCardinality, type, Property), 
418  #       (minQualifiedCardinality, domain, Restriction), 
419  #       (minQualifiedCardinality, range, ns_xsd["nonNegativeInteger"]), 
420   
421  #       (annotatedTarget, type, Property), 
422  #       (annotatedTarget, domain, Resource), 
423  #       (annotatedTarget, range, Resource), 
424   
425          (onClass, type, Property), 
426          (onClass, domain, Restriction), 
427          (onClass, range, Class), 
428   
429  #       (onDataRange, type, Property), 
430  #       (onDataRange, domain, Restriction), 
431  #       (onDataRange, range, Datatype), 
432   
433          (onDatatype, type, Property), 
434          (onDatatype, domain, Datatype), 
435          (onDatatype, range, Datatype), 
436   
437          (oneOf, type, Property), 
438          (oneOf, domain, Class), 
439          (oneOf, range, List), 
440   
441          (onProperty, type, Property), 
442          (onProperty, domain, Restriction), 
443          (onProperty, range, Property), 
444   
445  #       (onProperties, type, Property), 
446  #       (onProperties, domain, Restriction), 
447  #       (onProperties, range, List), 
448   
449  #       (annotatedProperty, type, Property), 
450  #       (annotatedProperty, domain, Resource), 
451  #       (annotatedProperty, range, Property), 
452   
453          (priorVersion, type, OntologyProperty), 
454          (priorVersion, type, AnnotationProperty), 
455          (priorVersion, domain, Ontology), 
456          (priorVersion, range, Ontology), 
457   
458          (propertyChainAxiom, type, Property), 
459          (propertyChainAxiom, domain, Property), 
460          (propertyChainAxiom, range, List), 
461   
462  #       (propertyDisjointWith, type, Property), 
463  #       (propertyDisjointWith, domain, Property), 
464  #       (propertyDisjointWith, range, Property), 
465  # 
466  #       (qualifiedCardinality, type, Property), 
467  #       (qualifiedCardinality, domain, Restriction), 
468  #       (qualifiedCardinality, range, ns_xsd["nonNegativeInteger"]), 
469   
470          (sameAs, type, Property), 
471          (sameAs, domain, Resource), 
472          (sameAs, range, Resource), 
473   
474          (seeAlso, type, AnnotationProperty), 
475          (seeAlso, domain, Resource), 
476          (seeAlso, range, Resource), 
477   
478          (someValuesFrom, type, Property), 
479          (someValuesFrom, domain, Restriction), 
480          (someValuesFrom, range, Class), 
481   
482          (sourceIndividual, type, Property), 
483          (sourceIndividual, domain, NegativePropertyAssertion), 
484          (sourceIndividual, range, Resource), 
485  # 
486  #       (annotatedSource, type, Property), 
487  #       (annotatedSource, domain, Resource), 
488  #       (annotatedSource, range, Resource), 
489  # 
490          (targetIndividual, type, Property), 
491          (targetIndividual, domain, NegativePropertyAssertion), 
492          (targetIndividual, range, Resource), 
493   
494          (targetValue, type, Property), 
495          (targetValue, domain, NegativePropertyAssertion), 
496          (targetValue, range, Literal), 
497   
498  #       (topDataProperty, type, DatatypeProperty), 
499  #       (topDataProperty, domain, Resource), 
500  #       (topDataProperty, range, Literal), 
501  # 
502  #       (topObjectProperty, type, ObjectProperty), 
503  #       (topObjectProperty, domain, Resource), 
504  #       (topObjectProperty, range, Resource), 
505   
506          (unionOf, type, Property), 
507          (unionOf, domain, Class), 
508          (unionOf, range, List), 
509   
510          (versionInfo, type, AnnotationProperty), 
511          (versionInfo, domain, Resource), 
512          (versionInfo, range, Resource), 
513   
514          (versionIRI, type, AnnotationProperty), 
515          (versionIRI, domain, Resource), 
516          (versionIRI, range, Resource), 
517   
518          (withRestrictions, type, Property), 
519          (withRestrictions, domain, Datatype), 
520          (withRestrictions, range, List), 
521   
522          # some OWL valid triples; these would be inferred by the OWL RL expansion, but it may make things 
523          # a bit faster to add these upfront 
524          (allValuesFrom, range, OWLClass), 
525          (complementOf, domain, OWLClass), 
526          (complementOf, range, OWLClass), 
527   
528  #       (datatypeComplementOf, domain, DataRange), 
529  #       (datatypeComplementOf, range, DataRange), 
530          (disjointUnionOf, domain, OWLClass), 
531          (disjointWith, domain, OWLClass), 
532          (disjointWith, range, OWLClass), 
533          (equivalentClass, domain, OWLClass), 
534          (equivalentClass, range, OWLClass), 
535          (hasKey, domain, OWLClass), 
536          (intersectionOf, domain, OWLClass), 
537          (onClass, range, OWLClass), 
538  #       (onDataRange, range, DataRange), 
539          (onDatatype, domain, DataRange), 
540          (onDatatype, range, DataRange), 
541          (oneOf, domain, OWLClass), 
542          (someValuesFrom, range, OWLClass), 
543          (unionOf, range, OWLClass), 
544  #       (withRestrictions, domain, DataRange) 
545  ] 
546   
547  #: OWL RL axiomatic triples: combination of the RDFS triples plus the OWL specific ones 
548  OWLRL_Axiomatic_Triples   = _OWL_axiomatic_triples_Classes   + _OWL_axiomatic_triples_Properties 
549   
550  # Note that this is not used anywhere. But I encoded it once and I did not want to remove it...:-) 
551  _OWL_axiomatic_triples_Facets = [ 
552          # langPattern 
553          (ns_xsd['length'],type,Property), 
554          (ns_xsd['maxExclusive'],type,Property), 
555          (ns_xsd['maxInclusive'],type,Property), 
556          (ns_xsd['maxLength'],type,Property), 
557          (ns_xsd['minExclusive'],type,Property), 
558          (ns_xsd['minInclusive'],type,Property), 
559          (ns_xsd['minLength'],type,Property), 
560          (ns_xsd['pattern'],type,Property), 
561   
562          (ns_xsd['length'],domain,Resource), 
563          (ns_xsd['maxExclusive'],domain,Resource), 
564          (ns_xsd['maxInclusive'],domain,Resource), 
565          (ns_xsd['maxLength'],domain,Resource), 
566          (ns_xsd['minExclusive'],domain,Resource), 
567          (ns_xsd['minInclusive'],domain,Resource), 
568          (ns_xsd['minLength'],domain,Resource), 
569          (ns_xsd['pattern'],domain,Resource), 
570          (ns_xsd['length'],domain,Resource), 
571   
572          (ns_xsd['maxExclusive'],range,Literal), 
573          (ns_xsd['maxInclusive'],range,Literal), 
574          (ns_xsd['maxLength'],range,Literal), 
575          (ns_xsd['minExclusive'],range,Literal), 
576          (ns_xsd['minInclusive'],range,Literal), 
577          (ns_xsd['minLength'],range,Literal), 
578          (ns_xsd['pattern'],range,Literal), 
579  ] 
580   
581  #: OWL D-entailment triples (additionally to the RDFS ones), ie, possible subclassing of various extra datatypes 
582  _OWL_D_Axiomatic_Triples_types = [ 
583          (ns_rdf['PlainLiteral'], type, Datatype) 
584  ] 
585   
586  OWL_D_Axiomatic_Triples_subclasses = [ 
587          (ns_xsd['string'], subClassOf, ns_rdf['PlainLiteral']), 
588          (ns_xsd['normalizedString'], subClassOf, ns_rdf['PlainLiteral']), 
589          (ns_xsd['token'], subClassOf, ns_rdf['PlainLiteral']), 
590          (ns_xsd['Name'], subClassOf, ns_rdf['PlainLiteral']), 
591          (ns_xsd['NCName'], subClassOf, ns_rdf['PlainLiteral']), 
592          (ns_xsd['NMTOKEN'], subClassOf, ns_rdf['PlainLiteral']) 
593  ] 
594   
595  OWLRL_Datatypes_Disjointness = [ 
596          (ns_xsd["anyURI"], disjointWith, ns_xsd['base64Binary']), 
597          (ns_xsd["anyURI"], disjointWith, ns_xsd['boolean']), 
598          (ns_xsd["anyURI"], disjointWith, ns_xsd['dateTime']), 
599          (ns_xsd["anyURI"], disjointWith, ns_xsd['decimal']), 
600          (ns_xsd["anyURI"], disjointWith, ns_xsd['double']), 
601          (ns_xsd["anyURI"], disjointWith, ns_xsd['float']), 
602          (ns_xsd["anyURI"], disjointWith, ns_xsd['hexBinary']), 
603          (ns_xsd["anyURI"], disjointWith, ns_xsd['string']), 
604          (ns_xsd["anyURI"], disjointWith, ns_rdf['PlainLiteral']), 
605          (ns_xsd["anyURI"], disjointWith, XMLLiteral), 
606   
607          (ns_xsd["base64Binary"], disjointWith, ns_xsd['boolean']), 
608          (ns_xsd["base64Binary"], disjointWith, ns_xsd['dateTime']), 
609          (ns_xsd["base64Binary"], disjointWith, ns_xsd['decimal']), 
610          (ns_xsd["base64Binary"], disjointWith, ns_xsd['double']), 
611          (ns_xsd["base64Binary"], disjointWith, ns_xsd['float']), 
612          (ns_xsd["base64Binary"], disjointWith, ns_xsd['hexBinary']), 
613          (ns_xsd["base64Binary"], disjointWith, ns_xsd['string']), 
614          (ns_xsd["base64Binary"], disjointWith, ns_rdf['PlainLiteral']), 
615          (ns_xsd["base64Binary"], disjointWith, XMLLiteral), 
616   
617          (ns_xsd["boolean"], disjointWith, ns_xsd['dateTime']), 
618          (ns_xsd["boolean"], disjointWith, ns_xsd['decimal']), 
619          (ns_xsd["boolean"], disjointWith, ns_xsd['double']), 
620          (ns_xsd["boolean"], disjointWith, ns_xsd['float']), 
621          (ns_xsd["boolean"], disjointWith, ns_xsd['hexBinary']), 
622          (ns_xsd["boolean"], disjointWith, ns_xsd['string']), 
623          (ns_xsd["boolean"], disjointWith, ns_rdf['PlainLiteral']), 
624          (ns_xsd["boolean"], disjointWith, XMLLiteral), 
625   
626          (ns_xsd["dateTime"], disjointWith, ns_xsd['decimal']), 
627          (ns_xsd["dateTime"], disjointWith, ns_xsd['double']), 
628          (ns_xsd["dateTime"], disjointWith, ns_xsd['float']), 
629          (ns_xsd["dateTime"], disjointWith, ns_xsd['hexBinary']), 
630          (ns_xsd["dateTime"], disjointWith, ns_xsd['string']), 
631          (ns_xsd["dateTime"], disjointWith, ns_rdf['PlainLiteral']), 
632          (ns_xsd["dateTime"], disjointWith, XMLLiteral), 
633   
634          (ns_xsd["decimal"], disjointWith, ns_xsd['double']), 
635          (ns_xsd["decimal"], disjointWith, ns_xsd['float']), 
636          (ns_xsd["decimal"], disjointWith, ns_xsd['hexBinary']), 
637          (ns_xsd["decimal"], disjointWith, ns_xsd['string']), 
638          (ns_xsd["decimal"], disjointWith, ns_rdf['PlainLiteral']), 
639          (ns_xsd["decimal"], disjointWith, XMLLiteral), 
640   
641          (ns_xsd["double"], disjointWith, ns_xsd['float']), 
642          (ns_xsd["double"], disjointWith, ns_xsd['hexBinary']), 
643          (ns_xsd["double"], disjointWith, ns_xsd['string']), 
644          (ns_xsd["double"], disjointWith, ns_rdf['PlainLiteral']), 
645          (ns_xsd["double"], disjointWith, XMLLiteral), 
646   
647          (ns_xsd["float"], disjointWith, ns_xsd['hexBinary']), 
648          (ns_xsd["float"], disjointWith, ns_xsd['string']), 
649          (ns_xsd["float"], disjointWith, ns_rdf['PlainLiteral']), 
650          (ns_xsd["float"], disjointWith, XMLLiteral), 
651   
652          (ns_xsd["hexBinary"], disjointWith, ns_xsd['string']), 
653          (ns_xsd["hexBinary"], disjointWith, ns_rdf['PlainLiteral']), 
654          (ns_xsd["hexBinary"], disjointWith, XMLLiteral), 
655   
656          (ns_xsd["string"], disjointWith, XMLLiteral), 
657  ] 
658   
659  #: OWL RL D Axiomatic triples: combination of the RDFS ones, plus some extra statements on ranges and domains, plus some OWL specific datatypes 
660  OWLRL_D_Axiomatic_Triples = RDFS_D_Axiomatic_Triples + _OWL_D_Axiomatic_Triples_types + OWL_D_Axiomatic_Triples_subclasses + OWLRL_Datatypes_Disjointness 
661