SubClassOf ambiguity in SHACL

27/09/2019, Ben De Meester

Please see the example shape and data.

Data

@prefix : <https://ben.de-meester/#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

:me a :Researcher .

:Researcher rdfs:subClassOf foaf:Person .

SHACL Shape

@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <https://ben.de-meester/#> .

:profile a sh:NodeShape ;
  sh:targetClass foaf:Person ;
  sh:property [
    sh:path rdf:type ;
    sh:hasValue foaf:Person ;
    sh:minCount 1
  ] .

This example might seem trivial or unrealistic, but we could for example see such a shape being built on the fly by integrating complementary sub-shapes (taking advantage of SHACL’s RDF model).

This example shows how inherent rdfs:subClassOf inference leads to ambiguity: :me is targeted using sh:targetClass foaf:Person, however, a violation occurs saying that :me should have at least the property-object rdf:type-foaf:Person.

Primary contact: Ben De Meester.

Ghent UniversityimecIDLab,
Ghent, Belgium