qualifiedCardinality in ICV not working

0 views
Skip to first unread message

Håvard Ottestad

unread,
Nov 3, 2016, 11:25:25 AM11/3/16
to Stardog
Hi,

I'm trying to say that a User should have exactly 1 email.

:User rdf:type owl:Class ;
        rdfs
:subClassOf [ rdf:type owl:Restriction ;
                          owl
:onProperty :email ;
                          owl
:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
                          owl
:onDataRange xsd:string
                       
] ;
       
.


But it doesn't seem to work. If I change it to minQualifiedCardinality, then the ICV guard stops the transaction, but with only qualifiedCardinality it will happily allow users without emails.

This is what I'm doing:

./stardog-admin db create -o icv.enabled=true -n users
./stardog-admin icv drop users
./stardog-admin icv add users user_constraints.ttl
./stardog data add users test.ttl

With the attached files. I'm expecting it to fail!


test.ttl
user_constraints.ttl

Evren Sirin

unread,
Nov 3, 2016, 11:31:16 AM11/3/16
to Stardog
We have an open ticket for this issue (internal ticket number 2724).
The SPARQL translation of exact cardinality constraint use `?x a
owl:Thing` which only works when reasoning is enabled. So at this
point you either need to enable reasoning for validating such
constraints or split them into min and max cardinality constraints.

best,
Evren
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
Reply all
Reply to author
Forward
0 new messages