Hey,
I couldn't find a complete example of a SPIN cardinality constraint, but I
put together pieces that I found (mainly in the SPL). However, I can't get
it to work -- the constraint does not seem to execute.
:ProductOrServiceModel a rdfs:Class, owl:Class ;
rdfs:subClassOf gr:ProductOrServiceModel ;
spin:constraint [ a :CardinalityViolationTemplate ;
spl:predicate rdf:type ;
spl:minCount "3"^^xsd:integer
] .
:CardinalityViolationTemplate a spin:Template ;
spin:body [ a sp:Construct ;
sp:text """CONSTRUCT {
_:b0 a spin:ConstraintViolation .
_:b0 spin:violationRoot ?this .
_:b0 spin:violationPath ?predicate .
_:b0 rdfs:label "Property {?predicate} does not have the required
cardinality of min {?minCount} and max {?maxCount}" .
}
WHERE {
{
FILTER (bound(?minCount) && (spl:objectCount(?this, ?predicate) <
?minCount)) .
}
UNION
{
FILTER (bound(?maxCount) && (spl:objectCount(?this, ?predicate) >
?maxCount)) .
}
}"""^^xsd:string ] ;
spin:constraint [ a spl:Argument ;
spl:predicate spl:predicate ;
spl:valueType rdf:Property
] ,
[ a spl:Argument ;
spl:predicate spl:minCount ;
spl:valueType xsd:integer ;
spl:optional "true"^^xsd:boolean
] ,
[ a spl:Argument ;
spl:predicate spl:maxCount ;
spl:valueType xsd:integer ;
spl:optional "true"^^xsd:boolean
] .
Can you see what's wrong here?
Thanks,
Martynas
graphityhq.com
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary
Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight,
SPARQLMotion, SPARQL Web Pages and SPIN.
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-users?hl=en
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.