valid and invalid shapes (ISSUE-134)

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