1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
private static boolean getChildrenClass(String LocRequest,String LocServic)
{
Iterator iterClass = null;
NodeIterator iter = null;
OntClass ontClass = null;
String inOntology="http://127.0.0.1/ontology/Countries.owl#";//geographydataset.owl#;
OntModel model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
model.read(inOntology);
resource = model.getResource(ontology+ LocServic);//LocRequest);
iter = model.listObjectsOfProperty(resource, OWL.equivalentClass);
System.out.println("read onto = "+iter.next().toString());
while (iter.hasNext())
{
if (LocRequest.equals(iter.next().toString()))
{
return true;
}
}
return false;
} |