Global property constraints (was: Re: Stand-alone Shapes and oslc:valueRange implemented in SPIN)

>  As a concrete example, HL7 RIM reuses a generic collection to capture
>>> e.g. a patient's given and family name name:
>>>
>>> ShExC:
>>>    start= <NameShape>
>>>    <NameShape> {
>>>      dt:COLL.item { err:person-name-family LITERAL },
>>>      dt:COLL.item { err:person-name-given LITERAL }+
>>>    }
>>>
>>
>> The above basically states that family name must only be a LITERAL in the
>> context of a NameShape. However, I would argue that all family names must
>> be LITERALs, so this constraint should be globally enforced on the class
>> "Item" (whatever that class is called). I guess if we take this out, then
>> it becomes
>>
>> ShExC:
>>   start= <NameShape>
>>   <NameShape> {
>>     dt:COLL.item { err:person-name-family },
>>     dt:COLL.item { err:person-name-given }+
>>   }
>>
>
> +1
> I also think that something like rdfs:range is needed. Of course we could
> rename it to e.g. shapes:propertyRange but the idea is the same.
> For this we could optionally re-use the existing ontology definitions or
> part of them [1].
>

Taking this a little further, we should be able to define global (on a
graph level) property constraints without the need to assign them to a
Class / Shape.
Here's an example on how Wikidata does something similar.
https://www.wikidata.org/wiki/Property_talk:P1047
https://www.wikidata.org/wiki/Property_talk:P640
https://www.wikidata.org/wiki/Property_talk:P1212

Dimitris


-- 
Dimitris Kontokostas
Department of Computer Science, University of Leipzig
Research Group: http://aksw.org
Homepage:http://aksw.org/DimitrisKontokostas

Received on Thursday, 4 December 2014 09:41:00 UTC