W3C home > Mailing lists > Public > public-data-shapes-wg@w3.org > April 2016

valid and invalid shapes (ISSUE-134)

From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
Date: Mon, 11 Apr 2016 07:33:27 -0700
To: RDF Data Shapes Working Group <public-data-shapes-wg@w3.org>
Message-ID: <570BB5B7.4000800@gmail.com>
Here are some valid and invalid shapes according to Section 4.1.1 "Invalid
Shapes Graphs" and the rest of the current version of
http://w3c.github.io/data-shapes/shacl/ as far as I can determine.


VALID (no type so constraint gets the default value type)

ex:s1 rdf:type sh:Shape ;
  sh:constraint [ sh:nodeKind sh:IRI ] .

VALID (explicit type same as default value type)

ex:s1 rdf:type sh:Shape ;
  sh:constraint [ rdf:type sh:NodeConstraint ;
  		  sh:nodeKind sh:IRI ] .

INVALID (explicit type blocks default value type determination)

ex:s1 rdf:type sh:Shape ;
  sh:constraint [ rdf:type rdfs:Resource ;
  		  sh:nodeKind sh:IRI ] .

VALID (sh:Constraint is an acceptable type for sh:constraint)

ex:s1 rdf:type sh:Shape ;
  sh:constraint [ rdf:type sh:Constraint ;
  		  sh:nodeKind sh:IRI ] .

VALID (there is no prohibition against sh:predicate for sh:NodeConstraint)

ex:s1 rdf:type sh:Shape ;
  sh:constraint [ rdf:type sh:NodeConstraint ;
  		  sh:predicate ex:p ;
  		  sh:nodeKind sh:IRI ] .

VALID (sh:PropertyConstraint is a subclass of sh:Constraint which makes it
acceptable for sh:constraint)

ex:s1 rdf:type sh:Shape ;
  sh:constraint [ rdf:type sh:PropertyConstraint ;
  		  sh:predicate ex:p ;
  		  sh:nodeKind sh:IRI ] .

VALID (ex:PropertyConstraint is a subclass of sh:Constraint which makes it
acceptable for sh:constraint)

ex:PropertyConstraint rdfs:subClassOf sh:PropertyConstraint .
ex:s1 rdf:type sh:Shape ;
  sh:constraint [ rdf:type ex:PropertyConstraint ;
  		  sh:predicate "p" ;
  		  sh:nodeKind sh:IRI ] .

VALID (no type so constraint gets the default value type)

ex:s1 rdf:type sh:Shape ;
  sh:property [ sh:predicate "p" ;
  	        sh:nodeKind sh:IRI ] .

VALID (explicit type same as default value type)

ex:s1 rdf:type sh:Shape ;
  sh:property [ rdf:type sh:PropertyConstraint ;
  		  sh:predicate "p" ;
  		  sh:nodeKind sh:IRI ] .

INVALID (explicit type blocks default value type determination)

ex:s1 rdf:type sh:Shape ;
  sh:property [ rdf:type rdfs:Resource ;
  		  sh:predicate "p" ;
  		  sh:nodeKind sh:IRI ] .

INVALID (sh:Constraint alone is not acceptable for sh:property even with
sh:predicate)

ex:s1 rdf:type sh:Shape ;
  sh:property [ rdf:type sh:Constraint ;
  		  sh:predicate "p" ;
  		  sh:nodeKind sh:IRI ] .

INVALID (sh:property does not allow subclassing)

ex:PropertyConstraint rdfs:subClassOf sh:PropertyConstraint .
ex:s1 rdf:type sh:Shape ;
  sh:property [ rdf:type ex:PropertyConstraint ;
  		  sh:predicate "p" ;
  		  sh:nodeKind sh:IRI ] .
Received on Monday, 11 April 2016 14:33:55 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:30:31 UTC