I'm looking for a way to express the following statement using jena java library:
final ObjectProperty label = m.createObjectProperty(RDFS + "label");
label.addDomain(sensorClass);
label.addRange(??????);
Usually in addRange
I would insert a class, but how can I do if the range is rdfs:Literal
or xsd:dateTime
or also xsd:double
which are no classes?
I tried to create a generic resource using createResource()
but then, exporting the resulting owl file in Protege it raises come errors due to the fact that the resource is unknown.
For now I fixed manually creating classes Literal etc in this way:
final OntClass literalClass = m.createClass(RDFS +"Literal");
final OntClass doubleClass = m.createClass(XSD +"double");
final OntClass dateTimeClass = m.createClass(XSD +"dateTime");
setting the created class as range. Anyway I suppose this is not the right way to do it, since in this case exporting the owl in Protege I will have subclasses of owl:thing called rdfs:Literal xsd:DateTime etc...