use of org.apache.jena.ontology.OntClass in project jena by apache.
the class TestOntTools method testNamedHierarchyRoots2.
public void testNamedHierarchyRoots2() {
OntClass anon0 = m_model.createClass();
OntClass anon1 = m_model.createClass();
anon0.addSubClass(m_a);
anon0.addSubClass(m_e);
anon0.addSubClass(anon1);
anon1.addSubClass(m_g);
m_a.addSubClass(m_b);
m_b.addSubClass(m_c);
m_c.addSubClass(m_d);
m_e.addSubClass(m_e);
m_e.addSubClass(m_f);
List<OntClass> nhr = OntTools.namedHierarchyRoots(m_model);
assertEquals(3, nhr.size());
assertTrue(nhr.contains(m_a));
assertTrue(nhr.contains(m_e));
assertTrue(nhr.contains(m_g));
}
Aggregations