ISSUE-119: Defining constraints on (values of) rdf:Lists
rdf:Lists
Defining constraints on (values of) rdf:Lists
- State:
- CLOSED
- Product:
- SHACL - Core
- Raised by:
- Simon Steyskal
- Opened on:
- 2016-01-27
- Description:
- While working through the list of possible open use cases/requirements Karen sent us, I noticed that we haven't tackled the (special?) treatment of rdf:Lists yet (as we agreed on to do so in resolution of ISSUE-46 [1] which says: "RESOLUTION: Close ISSUE-46 by adding requirements 2.6.12 and 2.6.13 [2] as proposed by Richard in [3]").
One approach for accomodating [2] could be to specify that whenever certain types of property constraints are defined for a property which has an rdf:List as its value, those constraints are actually applied to all members of that list rather than on the list itself:
-----------------------------------
Example:
-----------------------------------
ex:ExampleShape a sh:Shape ;
sh:scopeClass ex:ExampleClass ;
sh:property [
sh:datatype xsd:integer ;
sh:predicate ex:list ;
] .
ex:ValidExample a ex:ExampleClass ;
ex:list (1 2 3) .
ex:InvalidExample a ex:ExampleClass ;
ex:list (1 "aa" 3) .
-----------------------------------
However, certain types of property constraints should still only be applied to the actual rdf:List itself:
-----------------------------------
Example:
-----------------------------------
ex:ExampleShape a sh:Shape ;
sh:scopeClass ex:ExampleClass ;
sh:property [
sh:minCount 2 ;
sh:maxCount 2 ;
sh:predicate ex:list ;
] .
ex:ValidExample a ex:ExampleClass ;
ex:list (1 2 3) ;
ex:list (1 3 5) .
ex:InvalidExample a ex:ExampleClass ;
ex:list (1 2 3) .
-----------------------------------
To avoid potential conflicts if someone wants to specify that, e.g., the value of a certain property must be an rdf:List AND that all values of that list must be of type ex:Example, we could introduce a concept similar to sh:valueShape called sh:listShape:
-----------------------------------
Example:
-----------------------------------
ex:ExampleShape a sh:Shape ;
sh:scopeClass ex:ExampleClass ;
sh:property [
sh:class rdf:List ;
sh:listShape [
a sh:Shape ;
sh:constraint [
sh:class ex:Dog
]
]
sh:predicate ex:list ;
] .
ex:ValidExample a ex:ExampleClass ;
ex:list (ex:Lassie ex:Beethoven) .
ex:InvalidExample a ex:ExampleClass ;
ex:list (ex:Lassie ex:Flipper) .
ex:Lassie a ex:Dog .
ex:Beethoven a ex:Dog .
ex:Flipper a ex:Dolphin .
-----------------------------------
However, if we want to allow treating each member of an rdf:List differently, we have to come up with some other ideas such as introducing another constraint type alongside sh:PropertyConstraint, sh:NodeConstraint, ... called, e.g., sh:ListConstraint. A sh:ListConstraint would then allow to specify specific properties for constraining members of rdf:Lists.
best regards,
simon
[1] https://www.w3.org/2014/data-shapes/track/issues/46
[2] http://w3c.github.io/data-shapes/data-shapes-ucr/#r6.12-expressivity-checking-for-well-formed-rdf-lists
[3] https://lists.w3.org/Archives/Public/public-data-shapes-wg/2015May/0017.html
[UC26] http://w3c.github.io/data-shapes/data-shapes-ucr/#uc26-rdf-lists-and-ordered-data
[UC42] http://w3c.github.io/data-shapes/data-shapes-ucr/#uc42-constraining-rdf-graphs-to-provide-better-mapping-to-json
- Related Actions Items:
- No related actions
- Related emails:
- Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from holger@topquadrant.com on 2016-02-24)
- Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from holger@topquadrant.com on 2016-02-20)
- Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from kontokostas@informatik.uni-leipzig.de on 2016-02-19)
- Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from holger@topquadrant.com on 2016-02-19)
- Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from holger@topquadrant.com on 2016-02-19)
- Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from pfpschneider@gmail.com on 2016-02-18)
- Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from pfpschneider@gmail.com on 2016-02-18)
- Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from pfpschneider@gmail.com on 2016-02-18)
- Re: shapes-ISSUE-119 (rdf:Lists): Defining constraints on (values of) rdf:Lists [SHACL - Core] (from holger@topquadrant.com on 2016-01-30)
- Re: shapes-ISSUE-119 (rdf:Lists): Defining constraints on (values of) rdf:Lists [SHACL - Core] (from simon.steyskal@wu.ac.at on 2016-01-29)
- Re: shapes-ISSUE-119 (rdf:Lists): Defining constraints on (values of) rdf:Lists [SHACL - Core] (from holger@topquadrant.com on 2016-01-27)
- shapes-ISSUE-119 (rdf:Lists): Defining constraints on (values of) rdf:Lists [SHACL - Core] (from sysbot+tracker@w3.org on 2016-01-27)
Related notes:
RESOLUTION: Close ISSUE-119, not expanding core to handle lists but adding a section on how to do so using the extension mechanism
See https://www.w3.org/2016/02/11-shapes-minutes.html#resolution04
Display change log