2 years ago

#65260

test-img

Konrad Höffner

How to apply SHACL to subclasses instead of instances?

If I have a class, for example "Animal", then I can use SHACL to validate its instances:

:Elefant a :Animal;
 :family    :Elephantidae;
 :order     :Proboscidea.
:AnimalShape a sh:NodeShape;
 sh:targetClass :Animal;
 sh:property [sh:Path :family], [sh:Path :order].

This works on DBpedia, where animals are modeled as instances, for example https://dbpedia.org/page/Elephant has rdf:type dbo:Mammal, which is an rdfs:subClass of dbo:Animal.

However assume I want to model animals as classes, because an elefant is just a set of actual elefant individuals:

:Elefant rdf:type owl:Class;
 rdfs:subClassOf :Animal;
 :family    :Elephantidae;
 :order     :Proboscidea.

This will not be validated using the before mentioned SHACL shape. How would do I need to adapt that shape to validate this?

ontology

shacl

0 Answers

Your Answer

Accepted video resources