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:
- Re: RDF Data Shapes WG agenda for 27 July 2016 (from holger@topquadrant.com on 2016-07-28)
- Re: List of open SHACL Core Syntax ISSUEs (from holger@topquadrant.com on 2016-07-14)
- Re: List of open SHACL Core Syntax ISSUEs (from kontokostas@informatik.uni-leipzig.de on 2016-07-14)
- List of open SHACL Core Syntax ISSUEs (from holger@topquadrant.com on 2016-07-12)
- Re: RDF Data Shapes WG agenda for 26 May 2016 (from holger@topquadrant.com on 2016-05-26)
- regrets and votes for RDF Data Shapes WG 5 May 2016 meeting (from eric@w3.org on 2016-05-05)
- Re: ISSUE-141: Proposal for sh:type (from holger@topquadrant.com on 2016-05-02)
- Re: ISSUE-141: Proposal for sh:type (from pfpschneider@gmail.com on 2016-04-29)
- Re: ISSUE-141: Proposal for sh:type (from holger@topquadrant.com on 2016-04-29)
- Re: ISSUE-141: Proposal for sh:type (from pfpschneider@gmail.com on 2016-04-29)
- ISSUE-141: Proposal for sh:type (from holger@topquadrant.com on 2016-04-29)
- Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from holger@topquadrant.com on 2016-04-14)
- Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from kcoyle@kcoyle.net on 2016-04-13)
- Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from holger@topquadrant.com on 2016-04-12)
- Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from holger@topquadrant.com on 2016-04-12)
- Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from holger@topquadrant.com on 2016-04-12)
- Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from pfpschneider@gmail.com on 2016-04-11)
- Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from pfpschneider@gmail.com on 2016-04-11)
- Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from pfpschneider@gmail.com on 2016-04-11)
- Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from holger@topquadrant.com on 2016-03-30)
- Re: shapes-ISSUE-141 (Mixed ranges): How to represent mixed datatype-or-class ranges [SHACL - Core] (from pfpschneider@gmail.com on 2016-03-28)
- schema.org and SHACL (from holger@topquadrant.com on 2016-03-25)
- 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
Display change log