- From: Holger Knublauch <holger@topquadrant.com>
- Date: Thu, 02 Apr 2015 16:30:48 +1000
- To: public-data-shapes-wg@w3.org
I'd be happy to change this to an rdf:List of shapes. An example of that
would look like:
ex:RectangleWithArea
a rdfs:Class ;
rdfs:subClassOf rdfs:Resource ;
sh:constraint [
a sh:OrConstraint ;
sh:shapes (
[
sh:property [
sh:predicate ex:width ;
sh:minCount 1 ;
] ;
sh:property [
sh:predicate ex:height ;
sh:minCount 1 ;
]
]
[
sh:property [
sh:predicate ex:area ;
sh:minCount 1 ;
]
] )
] .
The body of the sh:OrConstraint in SPARQL would then be
SELECT *
WHERE {
FILTER NOT EXISTS {
?shapes rdf:rest*/rdf:first ?shape .
FILTER sh:hasShape(?this, ?shape) .
}
}
I assume this is better than what's in the current draft, so unless I
hear objections I'll update the proposal tomorrow.
Could you confirm this works for you, Simon?
Thanks,
Holger
On 4/2/2015 16:01, RDF Data Shapes Working Group Issue Tracker wrote:
> shapes-ISSUE-34 (OrConstraint): 2 disjuncts at a time in sh:OrConstraint [SHACL Spec]
>
> http://www.w3.org/2014/data-shapes/track/issues/34
>
> Raised by: Simon Steyskal
> On product: SHACL Spec
>
> I was wondering whether we want to "limit" ourselves to 2 disjuncts (i.e. sh:shape1 & sh:shape2) at a time, rather than having potentially n disjuncts as proposed by Eric's "sh:choice" construct.
>
> Ofc, one could nest another sh:OrConstraint within sh:shape2 and if necessary another one in the nested one and so forth, but I guess this gets pretty ugly/verbose very quickly.
>
> Any thoughts on this? Or am I missing something?
>
> cheers,
> simon
>
>
>
Received on Thursday, 2 April 2015 06:32:07 UTC