Hi,
I have got this suggestion on StackOverFlow:
"OWL max cardinality is not a restriction on the datatype as you already
recognized. What you're after is known as OWL data range, in particular,
FacetRestriction: w3.org/TR/owl2-syntax/#Data_Ranges . Note, the
Ontology API is not complete for OWL 2 (at least that's what I read some
years ago). I can see an interface DataRange, but it has only support
for OneOf: jena.apache.org/documentation/javadoc/jena/org/apache/jena/… –
I think, you should ask this on the Jena mailing list, maybe there is
also support for min, max, etc."
Do you maybe know whether Apache Jena has functionality to achieve what
I need to do in my case (described in my previous message and copied bellow?
Thanks,
Darko
On 8.10.2016. 1:25, Darko Androcec wrote:
Hi,
I have one urgent problem with Apache Jena, I have posted my question
on StackOverflow
(http://stackoverflow.com/questions/39926809/how-to-set-data-type-for-owl-restriction-using-apache-jena?sem=2).
If someone knows answer, please answer it here or on StackOverflow.
The copied question is bellow:
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 or |||DataProperty_Name max 1 decimal
etc.| |
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