W3C home > Mailing lists > Public > public-rdf-shapes@w3.org > October 2016

on what is a shape

From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
Date: Tue, 4 Oct 2016 10:25:39 -0700
To: "public-rdf-shapes@w3.org" <public-rdf-shapes@w3.org>
Message-ID: <a7641535-d853-aa7b-1c1b-5df9b1f16fa4@gmail.com>
Just what are shapes?

The terminology section says:

A shape is a node in a shapes graph that is typically a SHACL instance of
sh:Shape. A shape provides a collection of targets, filters, constraints and
parameters of constraint components that specify how a data graph is
validated against the shape. Shapes can also provide non-validating
information, such as labels and comments."

Section 2 says:

"Shapes define constraints that a set of focus nodes can be validated

This doesn't, however, provide guidance in determining what the shapes in a
shapes graph are.

Consider the following shapes graph:

[prefix stuff as needed]

s:s1 a sh:Shape ;
  sh:targetClass ex:c1 ;
  sh:nodeKind sh:IRI ;
  ex:p ex:q .

s:s2 a sh:Shape ;
  sh:targetClass ex:c1 ;
  ex:p ex:q .

s:s3 a sh:Shape ;
  sh:nodeKind sh:IRI ;
  ex:p ex:q .

s:s4 a sh:Shape ;
  ex:p ex:q .

s:s5 sh:targetClass ex:c1 ;
  sh:nodeKind sh:IRI ;
  ex:p ex:q .

s:s6 sh:targetClass ex:c1 ;
  ex:p ex:q .

s:s7 sh:nodeKind sh:IRI ;
  ex:p ex:q .

s:s8 ex:q ex:p .

s:s9 a sh:Shape ;
  sh:targetClass ex:c1 ;
  sh:sparql [
      ""SELECT $this WHERE {
       GRAPH $shapesGraph { $currentShape ex:p ?shape }
       BIND (sh:hasShape($this, ?shape) AS ?hasShape)
       BIND (!bound(?hasShape) AS ?failure) .
       FILTER (?failure || ?hasShape) . }""" ] ;
  ex:p ex:q .

s:s10 rdf:type sh:Shape ;
  sh:targetClass ex:foo ;
  sh:sparql [
      """SELECT $this WHERE {
        $this s:shape ?shape ;
	BIND (sh:hasShape($this,?shape,$shapesGraph) AS ?hasShape)
        BIND (!bound(?hasShape) AS ?failure )
        FILTER (?failure || !?hasShape) }""" ] .

Which of the ex:si are shapes and which are not shapes?  Are there any nodes
in the graph besides the ex:si that are shapes?

Peter F. Patel-Schneider
Nuance Communications
Received on Tuesday, 4 October 2016 17:26:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:02:45 UTC