W3C home > Mailing lists > Public > public-rdf-shapes@w3.org > March 2017

minor syntax fixes

From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
Date: Tue, 21 Mar 2017 15:57:12 -0700
To: "public-rdf-shapes@w3.org" <public-rdf-shapes@w3.org>
Message-ID: <b6944300-dd9d-370c-3a7a-0ebb54f615cb@gmail.com>
There are several minor problems with the SHACL Core syntax that need to be
fixed.  Most of the problems make shapes graphs illegal that should be
legal.


The syntax of paths is too restrictive as it disallows extra triples on many
(but not all) path nodes.  This forbids comments in useful places, like in
the SHACL property path below

ex:PathShape rdf:type sh:PropertyShape ;
 rdfs:comment "Inverse of p has to be C" ;
 sh:path [ rdfs:comment "Inverse Path" ; sh:inversePath ex:p ] ;
 sh:class ex:C .

The wording in the ASHACL Property Paths section of
https://arxiv.org/abs/1702.01795 permits extra triples on path nodes and
thus provides a better definition for SHACL property paths.


Some syntax checks go beyond checking syntax of information associated with
shapes.  They should only be performed on shapes.

This makes odd but harmless triples illegal, such as

ex:n3 sh:severity 7 .

ex:n5 sh:message 0 .

ex:n4 sh:deactivated 0 .

ex:n1 sh:path ex:p1 , ex:p2 .

ex:n2 sh:path [ rdfs:comment "Not a path" ] .

The following changes to the syntax rules will fix these problems.

severity-nodeKind 	Each value for sh:severity in a shape is an IRI.

message-datatype 	Each value for sh:message in a shape is either
			a xsd:string literal or a literal with a language tag.
			
deactivated-datatype 	Each value for sh:deactivated in a shape is
			either true or false.

path-maxCount 	A shape has at most one value for sh:path.

path-shape 	Each value for sh:path in a shape is a well-formed
		SHACL property path.


One syntax rule is missing, allowing some misleading syntax that should be
disallowed, as in

ex:s1 sh:uniqueLang true, false .

The following addition to the syntax rules will fix this problem.

uniqueLang-maxCount 	A shape has at most one value for sh:uniqueLang.


Many syntax rules state that they are for any node but it turns out that
they can be stated for shapes only without making any change in SHACL
syntax.  Changing these rules to be for shapes results in a more natural set
of rules.  The rules in quesstion look like
  Each value of XXX is ...
or
  The values of XXX are ...
where XXX is a parameter or a property related to targetting.  They can be
changed to
  Each value for XXX in a shape is ...


Peter F. Patel-Schneider
Nuance Communications
Received on Tuesday, 21 March 2017 22:57:50 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 21 March 2017 22:57:51 UTC