You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sta...@clarkparsia.com
Dear all,
in the discussion following my earlier post [1] I asked how to understand the exactly 1 cardinality constraint. The document in [2] is helpful, but I still am not able to get the expected results with my test case. In the file "EventRestriction.ttl" I stated, that an Event is supposed to have exactly 1 incoming ControlFlow. When validating the epcInstanceOntology.ttl I get the message: "Data is valid". But when I change the data (by removing the incoming ControlFlow of the individual :e2, the corresponding file is "epcInstanceOntology_ConstraintViolation1.ttl") I still get "Data is valid" as result of the validation. How is this possible? Now we have an individual ":e2" with 0 incoming ControlFlows, which in my understanding contradicts exactly 1 constraint. Considering the Closed World Assumption in Stardog, I would expect a violation now.
My questions: 1. Can you reproduce these validation results? 2. If yes. Is this a correct result? Would be greatful for some explanation.
The second issue is more subtle. Due to the way exact cardinality
constraints are translated to SPARQL, you need to enable reasoning
during validation to get the violations even tough it looks like you
don't need reasoning. So you need to run the following command:
$ bin/stardog icv validate -r sl myDB
If you are interested in details, look at SPARQL translation for your
constraint which you can see with the icv convert command:
Note that, the translation inserts {?x0 rdf:type owl:Thing} pattern at
the end because we cannot have just a FILTER NOT EXISTS element inside
a UNION. If you have reasoning turned on {?x0 rdf:type owl:Thing}
would match any instance. Without reasoning, it would not match
anything and no violation is detected for missing values. If you split
your constraint into two (one minQualifiedCardinality and one
maxQualifiedCardinality) then this issue would go away. This is not
ideal behavior so we'll think about another solution in the future.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sta...@clarkparsia.com
Dear Evren, thanks again for your help! As you said, when using the validate command with reasoning, Stardog produced the expected results.
When testing I noticed that I also had an issue with some prefixes (this problem was introduced by myself and has nothing to do with Stardogs functionality). So I first had to fix this. Then, following your advice and using the "stardog icv validate -r sl myDB" command would work.