LocalOntology implements Ontology { protected static void renderHierarchy(PrintStream out, OntClass cls, List<Object> occurs, int depth) { renderClassDescription(out, cls, depth); out.println(); if (cls.canAs(OntClass.class) && !occurs.contains(cls)) { for (Iterator<?> i = cls.listSubClasses(true); i.hasNext(); ) { OntClass sub = (OntClass) i.next(); occurs.add(cls); renderHierarchy(out, sub, occurs, depth + 1); occurs.remove(cls); } for (Iterator<?> i = cls.listInstances(); i.hasNext(); ) { Individual individual = (Individual) i.next(); renderURI(out, individual.getModel(), individual.getURI()); out.print(" ["); for (Iterator<?> j = individual.listLabels(null); j.hasNext(); ) { out.print(((Literal) j.next()).getString() + ", "); } out.print("] "); out.println(); } } } LocalOntology(); Ontology getInstance(); @Override void load(); @Override void load(String[] urls); OntologyParser getParser(); static OntModel getModel(); List<String> getLoadedOntologyResources(); @Override void merge(Ontology o); @Override Iterator<String> subclasses(String entitySearchTerm); @Override Iterator synonyms(String queryKeyPhrase); void addSearchTerm(String label, OntResource resource); Map<OntResource, String> retrieve(String label); static void renderClassDescription(PrintStream out, OntClass c, int depth); static final Logger LOG; static final String DELIMITER_SEARCHTERM; }
@Ignore @Test public final void testRenderHierarchy() { fail("Not yet implemented"); }