Description
SHACL 1.0 carefully defines support of rdfs:subClassOf
in how classes are identified, sought, and reviewed.
However, rdfs:subPropertyOf
does not get the same treatment, even though it is possible to have subproperty hierarchies. Searching 1.0's document for "subproperty" returns 0 hits with just the substring "ubp".
This causes SHACL users to need to enable RDFS or OWL entailment as a preprocessing step before their shapes that target with sh:targetSubjectsOf
or sh:targetObjectsOf
go into effect on properties that are implied through entailment. This can also lead to surprises when turning on entailments suddenly lights up shapes from higher in the subproperty hierarchy.
This example demonstrates what I mean:
@prefix ex: <http://example.org/> .
ex:Class1
a rdfs:Class ;
.
ex:Class2
a rdfs:Class ;
.
# Property hierarchy is a diamond:
#
# A
# / \
# B C
# \ /
# D
#
# So, `ex:a ex:propertyD ex:b .` entails:
#
# `ex:a ex:propertyB ex:b .`
# `ex:a ex:propertyC ex:b .`
# `ex:a ex:propertyA ex:b .`
ex:propertyA
a rdfs:Property ;
.
ex:propertyB
a rdfs:Property ;
rdfs:subPropertyOf ex:propertyA ;
.
ex:propertyC
a rdfs:Property ;
rdfs:subPropertyOf ex:propertyA ;
.
ex:propertyD
a rdfs:Property ;
rdfs:subPropertyOf
ex:propertyB ,
ex:propertyC
;
.
ex:propertyB-subjects-shape
a sh:NodeShape ;
sh:class ex:Class1 ;
sh:targetSubjectsOf ex:propertyB ;
.
ex:propertyC-objects-shape
a sh:NodeShape ;
sh:class ex:Class2 ;
sh:targetObjectsOf ex:propertyC ;
.
# This triple, with no other supporting data graph, should
# trigger two sh:Violations, due to `ex:a` and `ex:b` not
# having class assignments.
# But with SHACL 1.0, entailment (whether RDFS, OWL, or
# just their rdfs:subPropertyOf expansion rules) is
# necessary.
ex:a
ex:propertyD ex:b ;
.
Can SHACL 1.2 include property hierarchy review?