Selective sh:equals?

5 views
Skip to first unread message

Boris Pelakh

unread,
Jul 6, 2021, 12:26:55 PM7/6/21
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:

gshapes:InversePropertyShape
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."
] .

gshapes:SuperPropertySameType
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

unread,
Jul 6, 2021, 7:28:00 PM7/6/21
to topbrai...@googlegroups.com

Hi Boris,

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

Holger

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/bbe679d4-71d5-4107-aa6a-47c41432b784n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages