I am new with jena libraries, and want to list all resources, properties, datatypes of qualifiedCardinality restriction.
My restriction:
...
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#sensingMethodUsed"/>
<owl:onClass rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#Sensing"/>
<owl:qualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:qualifiedCardinality>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#featureOfInterest"/>
<owl:onClass rdf:resource="http://purl.oclc.org/NET/ssnx/ssn#FeatureOfInterest"/>
<owl:qualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:qualifiedCardinality>
</owl:Restriction>
</rdfs:subClassOf>
...
Desired String output:
qualcard sensingMethodUsed nonNegativeIteger 1 Sensing
qualcard featureOfInterest nonNegativeIteger 1 FeatureOfInterest
Please can some one help me please.
The snippet shows it is OWL2 ontology. Jena supports only OWL1 (see package org.apache.jena.ontology). But as an option you can use com.github.owlcs.ontapi.jena.model.OntModel from ONT-API, which is full analogue of org.apache.jena.ontology.OntModel but for OWL2-specification. ONT-API is a jena based library.
See example:
The output for this example is: