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