Re: shapes-ISSUE-86 (dimitris): Associating shapes with ontologies or vocabularies [SHACL Spec]

On 10/01/2015 12:12 AM, Eric Prud'hommeaux wrote:

[...]

 on determining whether a node in a
>> data graph is a SHACL instance of a class.
> 
> I'd this a term of art to express that an RDF node confirms to a shape?

[...]

Not at all.

When validating shapes or determining their scope, it is sometimes necessary
to determine whether a node in an RDF data graph is a SHACL instance of a
classs.  My view is that this determination is done only by looking at the
data graph - nothing in the shapes graph is consulted.

Consider, for example the following:

Shape graph:

ex:Rock rdfs:subclassOf foaf:Person . .

sx:USPShape rdf:type sh:Shape ;
  shh:scopeClass ex:Person ;
  sh:property [ sh:predicate foaf:knows ;
                sh:valueClass foaf:Person ] .

Data graph:

ex:Student rdfs:subClassOf foaf:Person .

ex:John rdf:type foaf:Person ;
  foaf:knows ex:Harry .

ex:Harry rdf:type ex:Student ;
  foaf:knows ex:John .

ex:Bill rdf:type foaf:Person ;
  foaf:knows ex:Arnold .

ex:Arnold rdf:type foaf:Rock .


When validating this data graph against this shape graph, all of ex:John,
ex:Harry, and ex:Bill are checked against the constraints in sx:UPSShape
because they are all SHACL instances of foaf:Person.   However, ex:Arnold is
not checked because that node is not a SHACL instance of foaf:Person even
though the shapes graph appears to so indicate.  Both ex:John and ex:Harry
validate successfully but ex:Bill does not.

No one should write a shapes graph like this, precisely because it would give
rise to the expectation that rocks are people.   There should probably be some
warning about writing ontology axioms in the shapes graph.

peter

PS:  Why do I say "SHACL instance"?   The following addition to the data graph
above

  ex:mySub rdfs:subPropertyOf rdfs:subclassOf .
  ex:Rock ex:mySub foaf:Person .

does *not* change the analysis here because SHACL does not perform instance
determination the same way that RDFS does.

Received on Thursday, 1 October 2015 10:37:47 UTC