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:
  1. Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from holger@topquadrant.com on 2016-02-24)
  2. Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from holger@topquadrant.com on 2016-02-20)
  3. Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from kontokostas@informatik.uni-leipzig.de on 2016-02-19)
  4. Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from holger@topquadrant.com on 2016-02-19)
  5. Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from holger@topquadrant.com on 2016-02-19)
  6. Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from pfpschneider@gmail.com on 2016-02-18)
  7. Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from pfpschneider@gmail.com on 2016-02-18)
  8. Re: shapes-ACTION-35: Proposal for lists (ISSUE-99 and ISSUE-119) (from pfpschneider@gmail.com on 2016-02-18)
  9. Re: shapes-ISSUE-119 (rdf:Lists): Defining constraints on (values of) rdf:Lists [SHACL - Core] (from holger@topquadrant.com on 2016-01-30)
  10. 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)
  11. Re: shapes-ISSUE-119 (rdf:Lists): Defining constraints on (values of) rdf:Lists [SHACL - Core] (from holger@topquadrant.com on 2016-01-27)
  12. 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

Arnaud Le Hors, 11 Feb 2016, 21:28:54

Display change log ATOM feed


Chair, Staff Contact
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <w3t-sys@w3.org>.
$Id: 119.html,v 1.1 2018/11/26 09:03:27 carine Exp $