Search in sources :

Example 6 with OntClass

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));
}
Also used : OntClass(org.apache.jena.ontology.OntClass)

Aggregations

OntClass (org.apache.jena.ontology.OntClass)6 ThreadInfo (java.lang.management.ThreadInfo)1 ThreadMXBean (java.lang.management.ThreadMXBean)1 ExecutorService (java.util.concurrent.ExecutorService)1 OntModel (org.apache.jena.ontology.OntModel)1 OntResource (org.apache.jena.ontology.OntResource)1 InfModel (org.apache.jena.rdf.model.InfModel)1 Model (org.apache.jena.rdf.model.Model)1 Resource (org.apache.jena.rdf.model.Resource)1 StmtIterator (org.apache.jena.rdf.model.StmtIterator)1 JenaException (org.apache.jena.shared.JenaException)1 ExtendedIterator (org.apache.jena.util.iterator.ExtendedIterator)1