- From: Holger Knublauch <holger@topquadrant.com>
- Date: Sun, 20 Sep 2015 09:23:45 +1000
- To: public-data-shapes-wg@w3.org
On 9/11/15 9:40 PM, RDF Data Shapes Working Group Issue Tracker wrote: > 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]" ; > ] . Option 5 would be: Acknowledging that we cannot cover every possible use case in the world via the core vocabulary, leave such cases for the extension mechanism. The regular expression example that you give is (easily) expressed via SPARQL. Holger
Received on Saturday, 19 September 2015 23:24:18 UTC