shapes-ISSUE-88 (labra): qualified values [SHACL Spec]

shapes-ISSUE-88 (labra): qualified values [SHACL Spec]

http://www.w3.org/2014/data-shapes/track/issues/88

Raised by: Jose Emilio Labra Gayo
On product: SHACL Spec


The current spec contains qualifiedValueShape to represent that "a certain number values of the given property must have a given shape".

That property can be used to emulate multi-occurrence of the same property with different value shapes. However, some use cases may require to express multi-occurrence of the same property with different values (not just value shapes). 

As a simple example, we may want to declare items that must have two codes, one with two digits and the other that starts with an uppercase letter. 

In ShEx, it can be represented as:

<item> { :code PATTERN "\d{2}"
       , :code PATTERN "^[A-Z]" 
       }

However, AFAIK, is is not possible to represent this example in the current SHACL Spec.

Possible solutions:

1.- Define a new property for that case, something like: sh:qualifiedValue maintaining the current qualifiedValueShape as it is. In that case, the previous definition would look like: 

:Item a sh:Shape;
 sh:property [
   sh:predicate :code;
   sh:qualifiedValue [
     sh:pattern "^[A-Z]"
   ]
   sh:qualifiedMinCount 1 ;
 ] ;
sh:property [
   sh:predicate :code;
   sh:qualifiedValue [
     sh:pattern "\d{2}" ;
   ]
   sh:qualifiedMinCount 1 ;
 ] ;
 sh:property [
   sh:predicate :code;
   sh:minCount 2 ;
   sh:maxCount 2 ;
 ] .

One problem having both "qualifiedValue" and "qualifiedValueShape" is that it would not handle the case where someone wants to have multi-occurrences that combine both.

2.- Replace qualifiedValueShape by qualifiedValue and support both value shapes and values. The example would be described as above.

3.- Ignore the use case.

4.- Adapt SHACL to have better support for multi-occurrence replacing the conjunctive semantics by additive semantics. In that case, the example could be defined as:

:item a :Shape;
 sh:property [
   sh:predicate :code;
   sh:pattern "\d{2}"
 ] ;
 sh:property [
   sh:predicate :code;
   sh:pattern "^[A-Z]" ;
 ] . 


This issue is related with issue: http://www.w3.org/2014/data-shapes/track/issues/53 that was closed by given a partial solution that only takes into account value shapes.

Received on Friday, 11 September 2015 11:40:16 UTC