rdflib icon indicating copy to clipboard operation
rdflib copied to clipboard

owl:qualifiedCardinality support lacked

Open shenqingyi9 opened this issue 7 months ago • 1 comments

According to OWL2 Primer, Functional-Style Syntax

 ClassAssertion( 
   ObjectExactCardinality( 3 :hasChild :Parent ) 
   :John
 ) 

is valid, and is equal to Turtle Syntax

 :John  rdf:type  [
   rdf:type                  owl:Restriction ;
   owl:qualifiedCardinality  "3"^^xsd:nonNegativeInteger ;
   owl:onProperty            :hasChild ;
   owl:onClass               :Parent
 ] .

However, ns.John.type = rdflib.extras.infixowl.Restriction(ns.hasChild, graph=g, cardinality=Literal(3), someValuesFrom=Class(ns.Parent, graph=g)) will only generate Turtle Syntax

 ns:John  rdf:type  [
   rdf:type                  owl:Restriction ;
   owl:cardinality  "3"^^xsd:nonNegativeInteger ;
   owl:onProperty            ns:hasChild ;
 ] .

without owl:onClass field.

shenqingyi9 avatar Jul 20 '24 11:07 shenqingyi9