|
Hi All, I want to record that some data was published on a specific data e.g.
However, sometimes I only have a period in which it was published not a specific date.
Now in my OWL file I want to constrain :published_in to either one of these datatypes. So I want to give it a Range. The usual approach for one datatype is:
My first naive approach was:
This fails in pellet once data is introduced. (No literal can meet the restrictions of date and duration). Two other approaches I tried were:
This seems to work in Pellet but not in Protege (a random datatype is loaded as constraint in Protege instead of the unionOf). The second approach I tried was
This second approach does not work at all. It expects a <> empty element/literal with a datatype of either which is not at all that I want. So in other words how do I correctly encode in OWL that :published_in is limit to the things that are a date or a duration? |
|
You might find integrity constraints useful. I do find it useful. The question here is not how to test/reason on the restriction but on how to encode it. Have you looked at user defined [datatypes][http://www.w3.org/TR/swbp-xsch-datatypes/]? Also, did you try putting restrictions on the class which will use the property? You could be able to do it that way. The answer that worked well is int the second suggestion. In the end I used the class that uses the property to have the restriction. |
|
You have made the same mistake that I did some time ago. Take a look at this answer for further discussion on domain/range behaviour. To define a value type constraint you need to a Restriction. Hope it will help you! The restriction concept as defined here is correct. I want to say that if a literal is of the type date or duration then it could be a :published_in. And more importantly if the literal is not date or duration then it can not be a :published_in Thing. Meaning that if I write bla :published_in "123"^^int an OWL reasoner will tell me that the declared type of bla :published_in "123"^^int does not conform to the OWL definition of :published_in |

