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

Re: SHACL syntax and metamodel complexity

From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
Date: Tue, 1 Mar 2016 10:11:37 -0800
To: kcoyle@kcoyle.net, RDF Data Shapes Working Group <public-data-shapes-wg@w3.org>
Message-ID: <56D5DB59.6080508@gmail.com>
[This is a repeat of a previous message.  It now includes SHACL RDF syntax
for the examples.]


SHACL states property constraints in the following way

     for the values of property ex:p
     the special values must all belong to shape ex:s,
     there must be at least one,
     there must be at least five special values,
     they must all be either ex:a, ex:b, ex:c, ex:d, ex:e, ex:f, ex:d, ex:h,
       ex:i, or ex:j,
     there must be at most ten,
     the identifiers used for them must match regular expression r,
     they must all belong to class ex:c, and
     there must be at most seven special values.

in the current SHACL RDF syntax this is

     [ a sh:propertyConstraint ;
       sh:predicate ex:p ;
       sh:qualifiedValueShape ex:s ;
       sh:minCount 1 ;
       sh:qualifiedMinCount 5;
       sh:in ( ex:a ex:b ex:c ex:d ex:f ex:d ex:h ) ;
       sh:maxCount 10;
       sh:pattern r ;
       sh:class ex:c ;
       sh:qualifiedMaxCount 5 ]

but not in the following way

     for the values of property ex:p
     there must be at least one,
     they must all belong to class ex:c,
     there must be at most five,
     they must all belong to class ex:d, and
     there must be at least three.

in a simple extension of the current SHACL RDF syntax this would be

     [ a sh:propertyConstraint ;
       sh:predicate ex:p ;
       sh:minCount 1 ;
       sh:class ex:c ;
       sh:maxCount 5 ;
       sh:class ex:d ;
       sh:minCount 3 ]


In my opinion, these features of the SHACL RDF syntax are contributing to
the complexity of the SHACL metamodel and to the number of decisions that
have to be made to construct the SHACL metamodel.


If SHACL stated constraints in the following way

     there must be at least one value of property ex:p,
     all the values of property ex:p must belong to class ex:c,
     there must be at most five values of property ex:p,
     all the values of property ex:p must belong to class ex:d, and
     there must be at least three values of property ex:p.

in an extension of the SHACL RDF syntax this could be something like

   [ sh:and
     ( [ a sh:minCountConstraint ;
         sh:predicate ex:p ;
         sh:minCount 1 ] )
     ( [ a sh:classConstraint ;
         sh:predicate ex:p ;
         sh:class ex:c ] )
     ( [ a sh:maxCountConstraint ;
         sh:predicate ex:p ;
         sh:maxCount 5 ] )
     ( [ a sh:classConstraint ;
         sh:predicate ex:p ;
         sh:class ex:d ] )
     ( [ a sh:minCountConstraint ;
         sh:predicate ex:p ;
         sh:minCount 3 ] ) ]

then the the metamodel for SHACL constraints could have just particular
constraints (from the clauses above and other constraint constructs).  This
would be a significant simplification of the metamodel.


Even if SHACL permitted the second construction above and uniformly stated
multi-part particular constraints as at the end of the following there might
be significant simplifications of the metamodel

     for the values of property ex:p
     there must be at least one,
     they must all be either ex:a, ex:b, ex:c, ex:d, ex:e, ex:f, ex:d, ex:h,
       ex:i, or ex:j,
     there must be at most ten,
     the identifiers used for them must match regular expression r,
     they must all belong to class ex:c, and
     there must be at between five and seven values that belong to shape ex:s.

in an extension of the SHACL RDF syntax this might be

     [ a sh:propertyConstraint ;
       sh:predicate ex:p ;
       sh:minCount 1 ;
       sh:in ( ex:a ex:b ex:c ex:d ex:f ex:d ex:h ) ;
       sh:maxCount 10;
       sh:pattern r ;
       sh:class ex:c ;
       sh:qualifiedConstraint [
          sh:qualifiedValueShape ex:s ;
 	  sh:minCount 5;
 	  sh:maxCount 5 ] ]


These simplifications would require changes to the RDF syntax of SHACL.

peter
Received on Tuesday, 1 March 2016 18:12:08 UTC

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