Re: Can Shapes always be Classes?

On 11/19/2014 9:47, Eric Prud'hommeaux wrote:
> * Holger Knublauch <> [2014-11-06 09:38+1000]
>> I think it's encouraging to read suggestions on how we could merge
>> ideas from the various proposals, e.g. extend SPIN to make the
>> scenario below easier to represent. This is always a possibility.

Another attempt to resolve the class-vs-shapes discussion, thinking out 
loud. What if SPIN had a built-in function

     spin:violatesConstraints(?instance, ?shape) : xsd:boolean

that takes an instance and a class definition, and checks whether the 
given instance fulfills all spin:constraints defined at that class. Then 
one could have

     a rdfs:Class ;       # or: shape:Shape
     rdfs:subClassOf foaf:Person ;       # or: shape:subClassOf
     spin:constraint [
         a shape:RequiredProperty ;
         shape:property foaf:givanName

which is very similar to the stand-alone concept of a Shape, only that 
Shapes are also classes. (They could also be just declared to be 
shape:Shape which is not really a class but a pattern if that helps).

If such a function would exist, it would be easy to define other 
constraint templates that verify conditions:

     spin:constraint [
         a shape:RequiredProperty ;
         shape:property :submittedBy ;
         shape:requiredShape :Submitter ;

which validates that the values of :submittedBy fulfill the constraints 
of :Submitter even if they do not have a matching rdf:type triple.

In a sense, this also turns SPIN into a classification engine, in that 
it can take any instance and check whether it could be a valid instance 
of a given class. So this sounds like a useful extension anyway.

(And thinking further, the function should not just be a property with a 
boolean but could also return the actual spin:ConstraintViolation 
triples so that they can be passed on into the surrounding constraint.)

Would this bring us closer to common ground?


Received on Wednesday, 19 November 2014 06:38:38 UTC