<https://lh3.googleusercontent.com/-vfy0eEvolpI/V1slY3tH7nI/AAAAAAAAAaY/CqrDBd8_LMg5EiAU6i6tiZZMWXjxtjF-ACLcB/s1600/TBCME-5.3.1-ConstraintViolation-OnInstanceNotProperty.PNG>
Irene,

Thank you for this clarification but in the cases I am referring to I have 
sent the property type into the ASK template as a SPIN constraint, and when 
the violation fails it is showing the violation on the instance and not on 
the property but the failure is most assuredly on the property value. I am 
attaching the ASK statement below:

# a class property cardinality is inconsistent with an instance property 
cardinality
ASK WHERE {
    ?this ?testPredicate ?predValues .
    ?this a ?iclassType .
    BIND (smf:minCardinality(?iclassType, ?testPredicate) AS ?cmin) .
    BIND (smf:minCardinality(?iclassType, ?testPredicate) AS ?cmax) .
    FILTER ((spl:objectCount(?inst, ?testPredicate) < ?cmin) || 
(spl:objectCount(?inst, ?testPredicate) > ?cmax)) .
}

This one is clearly a cardinality constraint check, where the SPIN 
constraint is ?testPredicate and, in the test instance I have provided, is 
the property 'eddl:constantUnit'. The ASK template is attached to the 
parent class using this property, where the cardinality constraint is 'max 
1' and I have created 3 in the test instance. I have attached a screen grab 
of this.

Based on your explanation and my understanding (or at least wish), I'd have 
expected the violation to be attached to the eddl:constantUnit property. 
That is in fact the way it worked in the myPurchases example, except that 
in that example the property wasn't an argument but declared in the SPARQL 
directly. Such a template would not be very generally applicable and that 
is why I made the property an argument in the first place.

Jack

On Wednesday, June 8, 2016 at 2:56:00 PM UTC-7, Irene Polikoff wrote:
>
> Violations from ASK templates always show against a resource that failed 
> the check. 
>
> You can use CONSTRUCT templates. With these, you can create whatever 
> violation messages you want and define where it applies using 
> spin:violationPath property. This means that the violation can be shown for 
> some other resource, but I am not sure this is what you are asking for.
>
>
> Irene Polikoff
> From: Jack Hodges <jhodg...@gmail.com <javascript:>>
> Reply-To: <topbrai...@googlegroups.com <javascript:>>
> Date: Wednesday, June 8, 2016 at 5:28 PM
> To: TopBraid Suite Users <topbrai...@googlegroups.com <javascript:>>
> Subject: [topbraid-users] How to associate a constraint with a property?
>
> I am building some constraints using ASK templates. In the myPurchases 
> example when the checkInvoiceAge ASK template (an invoice with no paidDate 
> is > 90 days old) is applied to the purchases:MaterialsPurchase class 
> errors show up next to the invoiceDate and paidDate properties. I am 
> guessing that this is because they are the only properties directly 
> referenced in the checkInvoiceAge ASK template. Is this true?
>
> And what if I want to associated a constraint test with a provided 
> property name? How would I show the violation against that property? Right 
> now it ends up showing against the instance, which isn't nearly as helpful.
>
> Jack
>
> -- 
> You received this message because you are subscribed to the Google Group 
> "TopBraid Suite Users", the topics of which include the TopBraid Suite 
> family of products and its base technologies such as SPARQLMotion, SPARQL 
> Web Pages and SPIN.
> To post to this group, send email to topbrai...@googlegroups.com 
> <javascript:>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to topbraid-user...@googlegroups.com <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Group 
"TopBraid Suite Users", the topics of which include the TopBraid Suite family 
of products and its base technologies such as SPARQLMotion, SPARQL Web Pages 
and SPIN.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to