I am using Apache Jena. I have created the data property, its range as xsd:string and restriction that is added as a superclass to specific (already created) class:
DatatypeProperty dataProperty = model.createDatatypeProperty(baseURI + possibleProperty);
dataProperty.setRange(XSD.xstring);
MaxCardinalityRestriction restriction = model.createMaxCardinalityRestriction(null, dataProperty, 1);
itemClass.addSuperClass(restriction);
When I open the generated ontology in Protege the mentioned restriction looks like:
DataProperty_Name max 1 Literal
My aim is to get it with included data type (that is specified in the range of the data property), e.g. I am expecting:
DataProperty_Name max 1 string
Application that uses the ontology needs to know restriction's data type. Do you maybe know what I need to change in my code to get data type (e.g. string) in the restriction instead of Literal?
Thanks, Darko