Commits

Anonymous committed 284c836

comment out unsupported OWL rules

  • Participants
  • Parent commits 2a25245

Comments (0)

Files changed (2)

File ordf/vocab/n3/owl-rules.n3

 
 
 ### inconsistency detections @@
+# FuXi doesn't support rules with an empty head
+#{?A owl:equivalentClass owl:Nothing. ?X a ?A} => false.
 
-{?A owl:equivalentClass owl:Nothing. ?X a ?A} => false.
+#{rdf:nil rdf:first ?X} => false.
+#{rdf:nil rdf:rest ?X} => false.
 
-{rdf:nil rdf:first ?X} => false.
-{rdf:nil rdf:rest ?X} => false.
+#{?Y owl:disjointWith ?Z. ?X a ?Y, ?Z} => false.
+#{?Y owl:disjointWith ?X; owl:equivalentClass ?X} => false.
 
-{?Y owl:disjointWith ?Z. ?X a ?Y, ?Z} => false.
-{?Y owl:disjointWith ?X; owl:equivalentClass ?X} => false.
+#{?P a owl:FunctionalProperty. ?S ?P ?X, ?Y. ?X owl:differentFrom ?Y} => false.
+#{?P a owl:InverseFunctionalProperty. ?X ?P ?O. ?Y ?P ?O. ?X owl:differentFrom ?Y} => false.
 
-{?P a owl:FunctionalProperty. ?S ?P ?X, ?Y. ?X owl:differentFrom ?Y} => false.
-{?P a owl:InverseFunctionalProperty. ?X ?P ?O. ?Y ?P ?O. ?X owl:differentFrom ?Y} => false.
+#{?A owl:differentFrom ?A} => false.
 
-{?A owl:differentFrom ?A} => false.
+#{?R owl:onProperty ?P; owl:maxCardinality ?M. ?M math:equalTo 0. ?X ?P ?Y; a ?R} => false.
+#{?R owl:onProperty ?P; owl:maxCardinality ?M. ?M math:equalTo 1. ?X ?P ?Y1, ?Y2; a ?R. ?Y2 owl:differentFrom ?Y1} => false.
+#{?R owl:onProperty ?P; owl:maxCardinality ?M. ?M math:equalTo 2. ?X ?P ?Y1, ?Y2, ?Y3; a ?R. ?Y2 owl:differentFrom ?Y1. ?Y3 owl:differentFrom ?Y1, ?Y2} => false.
 
-{?R owl:onProperty ?P; owl:maxCardinality ?M. ?M math:equalTo 0. ?X ?P ?Y; a ?R} => false.
-{?R owl:onProperty ?P; owl:maxCardinality ?M. ?M math:equalTo 1. ?X ?P ?Y1, ?Y2; a ?R. ?Y2 owl:differentFrom ?Y1} => false.
-{?R owl:onProperty ?P; owl:maxCardinality ?M. ?M math:equalTo 2. ?X ?P ?Y1, ?Y2, ?Y3; a ?R. ?Y2 owl:differentFrom ?Y1. ?Y3 owl:differentFrom ?Y1, ?Y2} => false.
+#{?R owl:onProperty ?P; owl:minCardinality ?M. ?P @has rdfs:range ?X. ?X @has owl:oneOf ?L. ?L :memberCount ?N. ?M math:greaterThan ?N} => false.
 
-{?R owl:onProperty ?P; owl:minCardinality ?M. ?P @has rdfs:range ?X. ?X @has owl:oneOf ?L. ?L :memberCount ?N. ?M math:greaterThan ?N} => false.
+#{?R owl:onProperty ?P; owl:hasValue ?V. ?X ?P ?Y; a ?R. ?V owl:differentFrom ?Y} => false.
+#{?R owl:onProperty ?P; owl:someValuesFrom ?S. ?S owl:equivalentClass owl:Nothing. ?X a ?R} => false.
 
-{?R owl:onProperty ?P; owl:hasValue ?V. ?X ?P ?Y; a ?R. ?V owl:differentFrom ?Y} => false.
-{?R owl:onProperty ?P; owl:someValuesFrom ?S. ?S owl:equivalentClass owl:Nothing. ?X a ?R} => false.
-
-{owl:Thing @has owl:oneOf ?L} => false.
-{?C @has owl:oneOf ?L. ?P rdfs:domain ?C. ?X ?P ?O. ?L :notItem ?X} => false.
-{?C @has owl:oneOf ?L. ?P rdfs:range ?C. ?S ?P ?X. ?L :notItem ?X} => false.
-{?C @has owl:oneOf ?L. ?X a ?C. ?L :notItem ?X} => false.
+#{owl:Thing @has owl:oneOf ?L} => false.
+#{?C @has owl:oneOf ?L. ?P rdfs:domain ?C. ?X ?P ?O. ?L :notItem ?X} => false.
+#{?C @has owl:oneOf ?L. ?P rdfs:range ?C. ?S ?P ?X. ?L :notItem ?X} => false.
+#{?C @has owl:oneOf ?L. ?X a ?C. ?L :notItem ?X} => false.
 
 
 ### support @@
 {?S rdf:first ?X} => {?S :item ?X}.
 {?S rdf:rest ?B. ?B :item ?X} => {?S :item ?X}.
 
-{} => {rdf:nil :notItem ?X}.
-{?S rdf:first ?A. ?A owl:differentFrom ?X. ?S rdf:rest ?B. ?B :notItem ?X} => {?S :notItem ?X}.
+#{} => {rdf:nil :notItem ?X}.
+#{?S rdf:first ?A. ?A owl:differentFrom ?X. ?S rdf:rest ?B. ?B :notItem ?X} => {?S :notItem ?X}.
 
-{} => {?X :includes rdf:nil}.
-{?S rdf:first ?A. ?X :item ?E. ?E @has owl:equivalentClass ?A. ?S rdf:rest ?B. ?X :includes ?B} => {?X :includes ?S}.
+#{} => {?X :includes rdf:nil}.
+#{?S rdf:first ?A. ?X :item ?E. ?E @has owl:equivalentClass ?A. ?S rdf:rest ?B. ?X :includes ?B} => {?X :includes ?S}.
 
-{} => {?X :inAllOf rdf:nil}.
-{?S rdf:first ?A. ?X a ?A. ?S rdf:rest ?B. ?X :inAllOf ?B} => {?X :inAllOf ?S}.
+#{} => {?X :inAllOf rdf:nil}.
+#{?S rdf:first ?A. ?X a ?A. ?S rdf:rest ?B. ?X :inAllOf ?B} => {?X :inAllOf ?S}.
 
 {?S rdf:first ?A. ?X a ?A} => {?X :inSomeOf ?S}.
 {?S rdf:rest ?B. ?X :inSomeOf ?B} => {?X :inSomeOf ?S}.
 
-{} => {rdf:nil :memberCount 0}.
-{?A rdf:rest ?B. ?B :memberCount ?M. (?M 1) math:sum ?N} => {?A :memberCount ?N}.
+#{} => {rdf:nil :memberCount 0}.
+#{?A rdf:rest ?B. ?B :memberCount ?M. (?M 1) math:sum ?N} => {?A :memberCount ?N}.
 
-{} => {rdf:nil :allClasses ?C}.
-{?L rdf:first ?A; rdf:rest ?B. ?A owl:equivalentClass ?C. ?B :allClasses ?C} => {?L :allClasses ?C}.
+#{} => {rdf:nil :allClasses ?C}.
+#{?L rdf:first ?A; rdf:rest ?B. ?A owl:equivalentClass ?C. ?B :allClasses ?C} => {?L :allClasses ?C}.
 
 {?L rdf:first ?A. ?A owl:equivalentClass ?C} => {?L :someClasses ?C}.
 {?L rdf:rest ?B. ?B :someClasses ?C} => {?L :someClasses ?C}.
 
-{} => {?P :reflexive rdf:nil}.
-{?S rdf:first ?A. ?A ?P ?A. ?S rdf:rest ?B. ?P :reflexive ?B} => {?P :reflexive ?S}.
+#{} => {?P :reflexive rdf:nil}.
+#{?S rdf:first ?A. ?A ?P ?A. ?S rdf:rest ?B. ?P :reflexive ?B} => {?P :reflexive ?S}.
 
 {?L rdf:first ?O. ?O @has owl:oneOf ?J. ?J :item ?A} => {?L :oneItem ?A}.
 {?L rdf:rest ?B. ?B :oneItem ?A} => {?L :oneItem ?A}.

File ordf/vocab/owl.py

     yield g
 
 def inference_rules(handler, network):
-    ### owl-rules.n3 doesn't parse properly!!
     from FuXi.Horn.HornRules import HornFromN3
     import os, pkg_resources
     rule_file = pkg_resources.resource_filename("ordf.vocab", os.path.join("n3", "owl-rules.n3"))
     rules = HornFromN3(rule_file)
     for rule in rules:
         network.buildNetworkFromClause(rule)
-    return rules
+    
+    from FuXi.DLP.DLNormalization import NormalFormReduction
+    dlp = network.setupDescriptionLogicProgramming(Graph(), addPDSemantics=True)
+    return list(rules) + dlp
 
 # definition of an Infix operator class
 # this recipe also works in jython