Hi All,
I want to record that some data was published on a specific data e.g.
a :published_in "2009-01-01"^^date ;
However, sometimes I only have a period in which it was published not a specific date.
:published_in "P2009Y01M"^^duration .
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:
<owl:DatatypeProperty rdf:about="published_in">
<rdfs:range rdf:resource="&xsd;date"/>
</owl:DatatypeProperty>
My first naive approach was:
<owl:DatatypeProperty rdf:about="published_in">
<rdfs:range rdf:resource="&xsd;date"/>
<rdfs:range rdf:resource="&xsd;duration"/>
</owl:DatatypeProperty>
This fails in pellet once data is introduced. (No literal can meet the restrictions of date and duration).
Two other approaches I tried were:
<owl:DatatypeProperty rdf:about="published_in">
<rdfs:range>
<owl:Class>
<rdf:Description>
<owl:unionOf rdf:parseType="Collection">
<rdf:type rdf:resource="&xsd;date"/>
<rdf:type rdf:resource="&xsd;duration"/>
</owl:unionOf>
</rdf:Description>
</owl:Class>
</rdfs:range>
</owl:DatatypeProperty>
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
<owl:DatatypeProperty rdf:about="published_in">
<rdfs:range>
<rdf:Description>
<rdf:type rdf:resource="&owl;DataRange"/>
<owl:oneOf>
<rdf:Description>
<rdf:type rdf:resource="&owl;List"/>
<rdf:first rdf:datatype="&xsd;date"/>
<rdf:rest>
<rdf:Description>
<rdf:type rdf:resource="&owl;List"/>
<rdf:first rdf:datatype="&xsd;date"/>
<rdf:rest rdf:resource="&rdf;nil">
</rdf:Description>
</rdf:rest>
</rdf:Description>
</owl:oneOf>
</rdf:Description>
</rdfs:range>
</owl:DatatypeProperty>
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?