Convert OWL/RDFS to SHACL and generate sh:targetClass

266 views
Skip to first unread message

Martin Jergler

unread,
Nov 5, 2018, 4:24:23 PM11/5/18
to TopBraid Suite Users
Hi,

when I'm generating a SHACL file from an OWL ontology with TopBraid Composer the resulting shapes miss the sh:targetClass annotation.
Therefore, I cannot use the SHACL file for checking the conformance of instance data vs the Ontology.

Example: 

plant-technicalsystem:UpdateActuatorEvent a sh:NodeShape ;
sh:property _:node1crhu0u0px8 .

The above is generated. However, I require something like:
plant-technicalsystem:UpdateActuatorEvent a sh:NodeShape ;
sh:targetClass plant-technicalsystem:UpdateActuatorEvent ;
sh:property _:node1crhu0u0px8 .

Is there anyway to generate this automatically with TopBraid Composer.

Thanks a lot.

Irene Polikoff

unread,
Nov 5, 2018, 4:36:29 PM11/5/18
to topbrai...@googlegroups.com
Hi Martin,

This blog descries what is being converted and how https://www.topquadrant.com/2018/05/01/from-owl-to-shacl-in-an-automated-way/

Since there can be many different modeling constructs in OWL and in SHACL the goal for the automated conversion was not to cover all the possibilities - this would be quite difficult, but to auto convert most commonly used patterns.

The logic is implemented as a set of SHACL rules in the file called owl2shacl.ttl under TopBraid/SHACL. If you want to add to it to address your specific needs, feel free to do so.

--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Holger Knublauch

unread,
Nov 5, 2018, 4:46:04 PM11/5/18
to topbrai...@googlegroups.com

The idea is that the generated property shapes are attached to the original (OWL) class, and that class also gets the rdf:type sh:NodeShape. Then, during validation, the implicit class target applies

    https://www.w3.org/TR/shacl/#implicit-targetClass

You just need to make sure that the generated file is building a union graph with the original file, so that plant-technicalsystem:UpdateActuatorEvent is both a sh:NodeShape and a class. This usually happens when you run validation from TopBraid.

Holger

Reply all
Reply to author
Forward
0 new messages