Hi I am trying to load schema.org ontology and get all top classes
using ontModel.listHierarchyRootClasses() but can't get the expected
results with different OntModelSpec.

If I use OWL_MEM, it lists 2500+ records with all the records have "null"
URI.
If I use OWL_DL_MEM, it lists 0 records

The code is very simple as follows

Model model = ModelFactory.createDefaultModel();
model.read("https://schema.org/docs/schemaorg.owl";);
OntModel ontModel =
ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, model);
ExtendedIterator<OntClass> topClazzez = ontModel.listHierarchyRootClasses();
while (topClazzez.hasNext()) {
    OntClass clazz = topClazzez.next();
    System.out.println(clazz.getURI());
}

A minimal Maven project ready to run to demonstrate my problem is here
https://github.com/AlexTo/jena-lab (have a look at the Main.java)

Thanks a lot
-- 

Alex To

PhD Candidate

School of Computer Science

Knowledge Discovery and Management Research Group

Faculty of Engineering & IT

THE UNIVERSITY OF SYDNEY | NSW | 2006

Desk 4e69 | Building J12| 1 Cleveland Street

M. +61423330656 <%2B61450061602>

Reply via email to