HI,
in my ontology i have the class called "festival" and it has property value called "CRISTMAS". it's a string type value.. son how can i get this value using JENA owl api..
CAN ANY ONE SHOW ME THE WAY ::::::
THANKS
HI,
in my ontology i have the class called "festival" and it has property value called "CRISTMAS". it's a string type value.. son how can i get this value using JENA owl api..
CAN ANY ONE SHOW ME THE WAY ::::::
THANKS
Load your ontology into an OntModel
. I assume you did that already.
Use the getProperty(String uri)
method of the OntModel
to retrieve the property.
Use the getOntClass(String uri)
method of the OntModel
to retrieve the class. It returns an OntClass
.
Use the getPropertyValue(Property property)
method of the OntClass
to get the value. It returns an RDFNode
.
To turn the RDFNode
into a string, either use simply toString()
, or do myRDFNode.asLiteral().getString()
.
hi. i a new. its my first java and ontology program. how can i load the ontology that define in my local machine and access the classes ? thanks:::