buda-base / owl-schema

BDRC Ontology Schema
11 stars 2 forks source link

owl equivalence for root works #116

Closed eroux closed 5 years ago

eroux commented 5 years ago

I'm not sure we want to use it but I thought it was an interesting thing to consider. The powla ontology has an interesting pattern where a Corpus is a Document with no super document, it's expressed in terms of owl equivalence:

powla:Corpus rdf:type owl:Class ;
             owl:equivalentClass [ owl:intersectionOf ( powla:Document
                                                        [ rdf:type owl:Restriction ;
                                                          owl:onProperty powla:hasSuperDocument ;
                                                          owl:maxCardinality "0"^^xsd:nonNegativeInteger
                                                        ]
                                                      ) ;
                                   rdf:type owl:Class
                                 ] ;
             rdfs:subClassOf powla:Document .
xristy commented 5 years ago

The above pattern is accomplished in shacl via:

powla:Corpus
  a sh:NodeShape ;
  rdfs:subClassOf powla:Document ;
  sh:property [
      a sh:PropertyShape ;
      sh:path powla:hasSuperDocument ;
      sh:class powla:Document ;
      sh:maxCount 0 ;
    ] ;
.
powla:Document
  a sh:NodeShape ;
  sh:property [
      a sh:PropertyShape ;
      sh:path powla:hasSuperDocument ;
      sh:class powla:Document ;
    ] ;
.

A common use of owl:equivalentClass is to attach property restrictions to a named class to clarify allowed membership. The same is done in shacl via defining shapes that express constraints on the properties that apply to members of a class.

There's already some examples of this pattern in the bdo.shapes.ttl

xristy commented 5 years ago

For me the take-away is to consider using sh:maxCount 0 as a way of signaling a root.