- From: Karen Coyle <kcoyle@kcoyle.net>
- Date: Wed, 04 Feb 2015 15:49:22 -0800
- To: Holger Knublauch <holger@topquadrant.com>, "public-data-shapes-wg@w3.org" <public-data-shapes-wg@w3.org>
Thanks, Holger. It may indeed be a global constraint. I'll make sure we
test this when the time comes.
kc
On 2/4/15 3:06 PM, Holger Knublauch wrote:
> On 2/5/2015 6:58, Karen Coyle wrote:
>> Is there a related requirement that would assert min/max cardinality
>> on subjects of a type, or within a targeted graph? - e.g. only one
>> subject of type foaf:person per graph. This is a common requirement
>> that we have in the DCMI work.
>
> This sounds like a global constraint to me, e.g.
>
> ex:AllowOnlyOnePerson
> a ldom:GlobalConstraint ;
> ldom:message "Only one instance of foaf:Person expected." ;
> ldom:sparql """
> ASK {
> {
> SELECT (COUNT(?person) AS ?count)
> WHERE {
> ?person a foaf:Person .
> }
> }
> FILTER (?count > 1) # flag an error if more than 1
> instance exists
> } """ .
>
> If this is a recurring pattern, a template could be defined that would
> be used as
>
> ex:AllowOnlyOnePerson
> a ldomx:AllowOnlyOneInstance ;
> ldomx:type foaf:Person .
>
> So the requirement is implicitly already written down by a combination
> of other requirements:
>
> https://www.w3.org/2014/data-shapes/wiki/Requirements#Global_Constraints
> https://www.w3.org/2014/data-shapes/wiki/Requirements#Expressivity:_Aggregations
>
> https://www.w3.org/2014/data-shapes/wiki/Requirements#Expressivity:_Literal_Value_Comparison
>
> https://www.w3.org/2014/data-shapes/wiki/Requirements#Expressivity:_Basic_Graph_Patterns
>
>
> I cannot tell whether this combination is sufficiently clear, but all
> the lego pieces are there - assuming they all get implemented by the
> standard.
>
> Regards,
> Holger
>
>
>
--
Karen Coyle
kcoyle@kcoyle.net http://kcoyle.net
m: 1-510-435-8234
skype: kcoylenet/+1-510-984-3600
Received on Wednesday, 4 February 2015 23:49:52 UTC