How can I get values for the OWL individual by using Jena API? I created
the OWL ontology using Java and Jena, and I now want to retrieve values
for each individual, e.g. I have one individual Customer_1
<rdf:Description
rdf:about="http://hr.org.foi.ontology/AzureDataModel#Customer_1">
<j.0:phoneNumber
rdf:datatype="http://www.w3.org/2001/XMLSchema#string">123-456</j.0:phoneNumber>
<j.0:address
rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Adresa
12</j.0:address>
<j.0:name
rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Darko</j.0:name>
<j.0:CustomerID
rdf:datatype="http://www.w3.org/2001/XMLSchema#int">1</j.0:CustomerID>
<rdf:type
rdf:resource="http://hr.org.foi.ontology/AzureDataModel#Customer"/>
</rdf:Description>
and I want to print that his phoneNumber is 123-456, address is Adresa
12 etc. I tried with the following code, but I got only the types of
properties:
ExtendedIterator<? extends OntResource> it =
MyClass.listInstances(true);
if (it.hasNext()) {
Individual ins = (Individual) it.next();
RDFNode iValue = ins.getPropertyValue(property);
String value = iValue.toString();
}
Best regards,
Darko