ISSUE-141: How to represent mixed datatype-or-class ranges

Mixed ranges

How to represent mixed datatype-or-class ranges

State:
CLOSED
Product:
SHACL - Core
Raised by:
Holger Knublauch
Opened on:
2016-03-22
Description:
Some ontologies contain properties that can either take literals or resources. Example: http://schema.org/address takes either xsd:string or schema:PostalAddress. I believe many DC properties are frequently used with mixed values. RDF has rdf:Property, only OWL separates datatype and object properties.

The current syntax to represent those in SHACL Core is terrible:

schema:AddressShape
a sh:Shape ;
sh:constraint [
sh:or (
[ sh:property [ sh:predicate schema:address ; sh:datatype xsd:string ] ]
[ sh:property [ sh:predicate schema:address ; sh:class schema:PostalAddress ] ]
)
] .

Some options:

0) Do nothing, consider this a rare (anti) pattern.

1) Change sh:class and sh:datatype so that they only apply to resources or literals, respectively. Using a literal with sh:class would no longer be a violation. sh:nodeKind would have to be used for most other properties:

schema:AddressShape
a sh:Shape ;
sh:property [
sh:predicate schema:address ;
sh:datatype xsd:string ;
sh:class schema:PostalAddress ;
] .

2) Improve syntax of sh:or (and sh:and) to allow for property constraints:

schema:AddressShape
a sh:Shape ;
sh:property [
sh:predicate schema:address ;
sh:or (
[ sh:datatype xsd:string ]
[ sh:class schema:PostalAddress ]
)
] .

(The values of the list would be sh:PropertyConstraints that use the same sh:predicate from the surrounding property constraint.)

A follow-up of 2) would be that we could drop sh:classIn and sh:datatypeIn to avoid too many syntaxes for the same thing.
Related Actions Items:
No related actions
Related emails:
  1. Re: RDF Data Shapes WG agenda for 27 July 2016 (from holger@topquadrant.com on 2016-07-28)
  2. Re: List of open SHACL Core Syntax ISSUEs (from holger@topquadrant.com on 2016-07-14)
  3. Re: List of open SHACL Core Syntax ISSUEs (from kontokostas@informatik.uni-leipzig.de on 2016-07-14)
  4. List of open SHACL Core Syntax ISSUEs (from holger@topquadrant.com on 2016-07-12)
  5. Re: RDF Data Shapes WG agenda for 26 May 2016 (from holger@topquadrant.com on 2016-05-26)
  6. regrets and votes for RDF Data Shapes WG 5 May 2016 meeting (from eric@w3.org on 2016-05-05)
  7. Re: ISSUE-141: Proposal for sh:type (from holger@topquadrant.com on 2016-05-02)
  8. Re: ISSUE-141: Proposal for sh:type (from pfpschneider@gmail.com on 2016-04-29)
  9. Re: ISSUE-141: Proposal for sh:type (from holger@topquadrant.com on 2016-04-29)
  10. Re: ISSUE-141: Proposal for sh:type (from pfpschneider@gmail.com on 2016-04-29)
  11. ISSUE-141: Proposal for sh:type (from holger@topquadrant.com on 2016-04-29)
  12. Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from holger@topquadrant.com on 2016-04-14)
  13. Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from kcoyle@kcoyle.net on 2016-04-13)
  14. Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from holger@topquadrant.com on 2016-04-12)
  15. Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from holger@topquadrant.com on 2016-04-12)
  16. Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from holger@topquadrant.com on 2016-04-12)
  17. Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from pfpschneider@gmail.com on 2016-04-11)
  18. Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from pfpschneider@gmail.com on 2016-04-11)
  19. Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from pfpschneider@gmail.com on 2016-04-11)
  20. Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from holger@topquadrant.com on 2016-03-30)
  21. Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from pfpschneider@gmail.com on 2016-03-28)
  22. schema.org and SHACL (from holger@topquadrant.com on 2016-03-25)
  23. shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from sysbot+tracker@w3.org on 2016-03-22)

Related notes:

RESOLUTION: Close issue 141, mixed ranges can be expressed with sh:or
See https://www.w3.org/2016/07/28-shapes-minutes.html#resolution08

Arnaud Le Hors, 29 Jul 2016, 16:26:45

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: 141.html,v 1.1 2018/11/26 09:03:29 carine Exp $