Selective sh:equals?

Skip to first unread message

Boris Pelakh

Jul 6, 2021, 12:26:55 PMJul 6
to TopBraid Suite Users
I am writing some basic shapes to validate that an ontology is well-formed, and one of checks I would like to add is that subPropertyOf and inverseOf only target the same type of property. For example:

a sh:NodeShape ;
sh:targetSubjectsOf owl:inverseOf ;
sh:property [
a sh:PropertyShape ;
sh:path ( owl:inverseOf rdf:type ) ;
sh:equals rdf:type ;
sh:message "Inverse property must be same type."
] .

a sh:NodeShape ;
sh:targetSubjectsOf rdfs:subPropertyOf ;
sh:property [
a sh:PropertyShape ;
sh:path ( rdfs:subPropertyOf rdf:type ) ;
sh:equals rdf:type ;
sh:message "Super-property must be same type."
] .

The problem I run into is with additional types like owl:FunctionalProperty and owl:TransitiveProperty, which break the above shapes. Is there a nice SHACL-native way for me to ignore those and only pay attention to values such as ObjectProperty and DatatypeProperty, or will I have to drop down to SPARQL queries to handle this validation?

Holger Knublauch

Jul 6, 2021, 7:28:00 PMJul 6

Hi Boris,

I cannot think of a solution in SHACL Core, but SHACL-SPARQL is one option to implement this.


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
To view this discussion on the web visit
Reply all
Reply to author
0 new messages