On 20/07/12 09:41, Olivier Rossel wrote:
If this is the same ontology you showed yesterday then that would be
expected behaviour if you have no reasoner (since the domain check requires
interpretation of owl:unionOf) but not if you have a reasoner. If I try:
[[[
OntModel ontm =
ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF);
ontm.read("file:data/temp.owl","RDF/XML");
OntClass album106591815 =
ontm.getOntClass("http://dbpedia.org/class/yago/Album106591815");
List<OntProperty> result =
album106591815.listDeclaredProperties(false).toList();
for (OntProperty p: result) {
System.out.println(" property " + p);
}
]]]
on your sample from yesterday then I get:
[[[
property http://dbpedia.org/property/after
]]]
The trick proposed by Ian yesterday is to wrap the "ontm" into a
surrounding OntModel whose OntSpec is set to OWL_MEM.
OntTools.namedHierarchyRoots works fine when called on that surrounding model.
But it seems that listDeclaredProperties() called on that surrounding
model does not list property "http://dbpedia.org/property/after" .
Could you please confirm that behaviour on your side?
Works for me:
[[[
OntModel ontm =
ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF);
ontm.read("file:data/temp.owl","RDF/XML");
ontm = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM,
ontm);
OntClass album106591815 =
ontm.getOntClass("http://dbpedia.org/class/yago/Album106591815");
List<OntProperty> result =
album106591815.listDeclaredProperties(false).toList();
for (OntProperty p: result) {
System.out.println(" property " + p);
}
]]]
still gives
[[[
property http://dbpedia.org/property/after
]]]
Dave