> 
> Which SPIN template did you use for cardinality checking? If 
> this is under your control, why don't you CONSTRUCT the 
> spin:violationPath to remember the property at creation time?
> 
> 
I'm using the spl:Attribute spin:Template that gets created when using the 
"Create from SPIN Template" tool to add attributes to a Class.  I'm still 
trying to wrap my mind around exactly how this template works in regards to 
raising constraint violations.  I see it has a spin:body that looks like the 
ASK query that should get invoked to check for cardinality and type constraint 
checking:

ASK WHERE {
    {
        FILTER (bound(?minCount) && (spl:objectCount(?this, ?predicate) < 
?minCount)) .
    }
    UNION
    {
        FILTER (bound(?maxCount) && (spl:objectCount(?this, ?predicate) > 
?maxCount)) .
    }
    UNION
    {
        FILTER bound(?valueType) .
        ?this ?predicate ?value .
        FILTER (!spl:instanceOf(?value, ?valueType)) .
    } .
}

But why is it specified with a spin:body property, and not spin:constraint?  
And I think you're saying to replace this ASK constraint check with a CONSTRUCT 
constraint check, but the ASK constraint check is part of the spl model, so I 
don't have control over that, right?  Perhaps I won't be able to use the 
spl:Attribute template to do what I want and will have to create my own 
Attribute template?  If that's the case, then I'd like to understand why the 
constraint check SPARQL is referenced with a spin:body property.

Or perhaps the Create form SPIN Template tool could add a "spin:constraint" 
property where the constraint checking code could optionally be provided by the 
user? OR (and this may be asking a lot) could the Create from SPIN Template 
tool add an option to auto-generate a CONSTRUCT constraint check instead of the 
ASK constraint check, injecting the added information from the other parameters 
used to instantiate the spl:Attribute template (e.g. minCount, maxCount, 
predicate, valueType)?  Something like:

CONSTRUCT {
   _:b0 a spin:Constraint ;
        spin:violationRoot ?this ;
        spin:violationPath ?predicate ;
        rdfs:label ?labelTemplate ;
} 
WHERE {
    {
        FILTER (bound(?minCount) && (spl:objectCount(?this, ?predicate) < 
?minCount)) .
    }
    UNION
    {
        FILTER (bound(?maxCount) && (spl:objectCount(?this, ?predicate) > 
?maxCount)) .
    }
    UNION
    {
        FILTER bound(?valueType) .
        ?this ?predicate ?value .
        FILTER (!spl:instanceOf(?value, ?valueType)) .
    } 
    ?this spin:labelTempalte ?labelTemplate .
}

Would it work if I just substituted the current ASK query in the spl model with 
something like the above? 


> Regards,
> Holger
> 
> --
> 
> You received this message because you are subscribed to the 
> Google Groups "TopBraid Composer Users" group.
> To post to this group, send email to 
> [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/topbraid-composer-users?hl=en.
> 
> 
> 

--

You received this message because you are subscribed to the Google Groups 
"TopBraid Composer Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/topbraid-composer-users?hl=en.


Reply via email to