Reputation: 13
I know that similar questions have been asked in different ways here but still I see no solution for it...
I would like to add a restriction which states that individuals of class A have exactly 1 data type property value. I have been trying i.e. inserting hasXValue exactly 1
on equivalent classes Protege tab. Also, I have tried also combining min
and max
restrictions. However, as stated by other people´s posts, it is consistent to have 0 or 1 declaration of value but not 2. I have understood some explanations about the world assumption in OWL but then I would like to know which kind of axiom it could be used for doing this restriction.
In fact, the easiest solution that worked for me is by querying within a SPARQL ASK query, looking the no existence of an instance that pertains to certain class and does not have a data type property value (I have use FILTER NON EXISTS). In this way, I can have a true/false value stating that there is or not any individual with no data type property value declaration. However, I would like the reasoner to say that the model is inconsistent in this case.
My objective is that if I have to declare a lot of instances of a class that must have i.e. an ID, not miss any declaration. Moreover, I would like not having to execute a query for checking it. Thus, I though that cardinality restrictions were the correct choice.
Any help on this? Thanks in advance!
Upvotes: 1
Views: 511
Reputation: 4886
If I'm not mistaken, you are trying to use OWL for validation, which requires a closed world interpretation of the semantics to get the kind of inconsistency errors you'd like to see. As you've noticed, out of the box, you're not going to get that behavior because that's not what OWL was designed for.
There was a workshop on this exact topic, and now there is a W3C working group to explore how to do validation in a standardized way.
Stardog's implementation of integrity constraints uses OWL (Manchester) syntax, amongst others, for authoring constraints, which you could create in Protege, but Stardog itself doesn't have a Protege plugin. As an aside, it translates constraints into SPARQL queries which use FILTER NOT EXISTS much in the same manner as you did by hand, except that it does so automatically.
Other inputs to the working group are SPIN and SHEX. SHEX is not worth looking at, but SPIN could be another decent option for you. It won't, as far as I know, work with Protege, but it is integrated with an IDE (TopBraid) and has a SPARQL based syntax.
Upvotes: 1