On 19/07/12 22:59, Olivier Rossel wrote:
I use the workaround Ian mentionned.
It works fine for OntTools.namedHierarchyRoots().

But another question arises now:
I want to list properties whose domain includes Album106591815.

Here is roughly how I want to do that:

OntClass album106591815 =
theTopMostModelWithTheOwlMemSpec.getOntClass("http://dbpedia.org/class/yago/Album106591815";);
List result = album106591815.listDeclaredProperties(false).toList();

This code returns an empty result.
Is it the expected behaviour?

On what data?

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
]]]

Dave

Reply via email to