test_class.declarator: ontology = TestOntology.ontology()
test_class.modifier: private final
test_class.original_string: private final Ontology ontology = TestOntology.ontology();
test_class.type: Ontology
test_class.var_name: ontology
test_class.file: phenol-core/src/test/java/org/monarchinitiative/phenol/ontology/data/ImmutableOntologyTest.java
test_class.identifier: ImmutableOntologyTest
test_case.body: @Test
    void testBuilder() {
      TermId rootId = TermId.of("owl:Thing");
      Term root = Term.of(rootId, "root");
  
      TermId childId = TermId.of("HP:0000001");
      Term child = Term.of(childId, "child");
  
      TermId child2Id = TermId.of("HP:0000002");
      Term child2 = Term.of(child2Id, "child2");
  
      TermId child3Id = TermId.of("HP:0000003");
      TermId child3SecondaryId = TermId.of("HP:3333333");
      Term child3 = Term.builder()
        .id(child3Id)
        .name("child3")
        .altTermIds(ImmutableList.of(child3SecondaryId))
        .build();
  
      TermId obsoleteId = TermId.of("HP:0000004");
      Term obsolete = Term.builder().id(obsoleteId).name("obsolete").obsolete(true).build();
  
      ImmutableList<Term> terms = ImmutableList.of(root, child, child2, child3, obsolete);
  
  
      Relationship relationship1 = new Relationship(childId, rootId, 1, RelationshipType.IS_A);
      Relationship relationship2 = new Relationship(child2Id, rootId, 2, RelationshipType.IS_A);
      Relationship relationship3 = new Relationship(child3Id, child2Id, 3, RelationshipType.IS_A);
      Relationship relationship4 = new Relationship(childId, obsoleteId, 4, RelationshipType.IS_A);
  
      ImmutableList<Relationship> relationships = ImmutableList.of(relationship1, relationship2, relationship3, relationship4);
  
  
      Ontology instance = ImmutableOntology.builder()
        .terms(terms)
        .relationships(relationships)
        .build();
  
      assertEquals(rootId, instance.getRootTermId());
      assertTrue(instance.isRootTerm(rootId));
  
      Set<TermId> allTermIds = terms.stream().map(Term::getId).collect(Collectors.toSet());
      assertEquals(allTermIds, instance.getAllTermIds());
  
      Set<TermId> nonObsoleteTermIds = terms.stream()
        .filter(term -> !term.isObsolete())
        .map(Term::getId)
        .collect(Collectors.toSet());
      assertEquals(nonObsoleteTermIds, instance.getNonObsoleteTermIds());
  
  
      assertEquals(child3Id, instance.getPrimaryTermId(child3Id));
      assertEquals(child3Id, instance.getPrimaryTermId(child3SecondaryId));
  
      assertEquals(ImmutableSet.of(rootId), instance.getParentTermIds(child2Id));
      assertEquals(ImmutableSet.of(child2Id), instance.getParentTermIds(child3Id));
      assertEquals(ImmutableSet.of(child3Id, child2Id, rootId), instance.getAncestorTermIds(child3Id));
      assertEquals(ImmutableSet.of(child3Id, child2Id), instance.getAncestorTermIds(child3Id, false));
    }
test_case.class_method_signature: ImmutableOntologyTest.testBuilder()
test_case.full_signature: @Test void testBuilder()
test_case.identifier: testBuilder
test_case.invocations: of of of of of of of of build altTermIds name id builder of of build obsolete name id builder of of build relationships terms builder assertEquals getRootTermId assertTrue isRootTerm collect map stream toSet assertEquals getAllTermIds collect map filter stream isObsolete toSet assertEquals getNonObsoleteTermIds assertEquals getPrimaryTermId assertEquals getPrimaryTermId assertEquals of getParentTermIds assertEquals of getParentTermIds assertEquals of getAncestorTermIds assertEquals of getAncestorTermIds
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBuilder()
focal_class.declarator: serialVersionUID = 2L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 2L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: logger = LoggerFactory.getLogger(ImmutableOntology.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ImmutableOntology.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: metaInfo
focal_class.modifier: private final
focal_class.original_string: private final ImmutableSortedMap<String, String> metaInfo;
focal_class.type: ImmutableSortedMap<String, String>
focal_class.var_name: metaInfo
focal_class.declarator: graph
focal_class.modifier: private final
focal_class.original_string: private final DefaultDirectedGraph<TermId, IdLabeledEdge> graph;
focal_class.type: DefaultDirectedGraph<TermId, IdLabeledEdge>
focal_class.var_name: graph
focal_class.declarator: rootTermId
focal_class.modifier: private final
focal_class.original_string: private final TermId rootTermId;
focal_class.type: TermId
focal_class.var_name: rootTermId
focal_class.declarator: termMap
focal_class.modifier: private final
focal_class.original_string: private final ImmutableMap<TermId, Term> termMap;
focal_class.type: ImmutableMap<TermId, Term>
focal_class.var_name: termMap
focal_class.declarator: nonObsoleteTermIds
focal_class.modifier: private final
focal_class.original_string: private final ImmutableSet<TermId> nonObsoleteTermIds;
focal_class.type: ImmutableSet<TermId>
focal_class.var_name: nonObsoleteTermIds
focal_class.declarator: obsoleteTermIds
focal_class.modifier: private final
focal_class.original_string: private final ImmutableSet<TermId> obsoleteTermIds;
focal_class.type: ImmutableSet<TermId>
focal_class.var_name: obsoleteTermIds
focal_class.declarator: allTermIds
focal_class.modifier: private final
focal_class.original_string: private final ImmutableSet<TermId> allTermIds;
focal_class.type: ImmutableSet<TermId>
focal_class.var_name: allTermIds
focal_class.declarator: relationMap
focal_class.modifier: private final
focal_class.original_string: private final ImmutableMap<Integer, Relationship> relationMap;
focal_class.type: ImmutableMap<Integer, Relationship>
focal_class.var_name: relationMap
focal_class.declarator: precomputedAncestors
focal_class.modifier: private final
focal_class.original_string: private final ImmutableMap<TermId, ImmutableSet<TermId>> precomputedAncestors;
focal_class.type: ImmutableMap<TermId, ImmutableSet<TermId>>
focal_class.var_name: precomputedAncestors
focal_class.file: phenol-core/src/main/java/org/monarchinitiative/phenol/ontology/data/ImmutableOntology.java
focal_class.identifier: ImmutableOntology
focal_class.interfaces: implements Ontology
focal_class.class_method_signature: ImmutableOntology.ImmutableOntology(
        ImmutableSortedMap<String, String> metaInfo,
        DefaultDirectedGraph<TermId, IdLabeledEdge> graph,
        TermId rootTermId,
        Collection<TermId> nonObsoleteTermIds,
        Collection<TermId> obsoleteTermIds,
        ImmutableMap<TermId, Term> termMap,
        ImmutableMap<Integer, Relationship> relationMap)
focal_class.full_signature: public  ImmutableOntology(
        ImmutableSortedMap<String, String> metaInfo,
        DefaultDirectedGraph<TermId, IdLabeledEdge> graph,
        TermId rootTermId,
        Collection<TermId> nonObsoleteTermIds,
        Collection<TermId> obsoleteTermIds,
        ImmutableMap<TermId, Term> termMap,
        ImmutableMap<Integer, Relationship> relationMap)
focal_class.identifier: ImmutableOntology
focal_class.modifiers: public
focal_class.parameters: (
        ImmutableSortedMap<String, String> metaInfo,
        DefaultDirectedGraph<TermId, IdLabeledEdge> graph,
        TermId rootTermId,
        Collection<TermId> nonObsoleteTermIds,
        Collection<TermId> obsoleteTermIds,
        ImmutableMap<TermId, Term> termMap,
        ImmutableMap<Integer, Relationship> relationMap)
focal_class.signature:  ImmutableOntology(
        ImmutableSortedMap<String, String> metaInfo,
        DefaultDirectedGraph<TermId, IdLabeledEdge> graph,
        TermId rootTermId,
        Collection<TermId> nonObsoleteTermIds,
        Collection<TermId> obsoleteTermIds,
        ImmutableMap<TermId, Term> termMap,
        ImmutableMap<Integer, Relationship> relationMap)
focal_class.class_method_signature: ImmutableOntology.precomputeAncestors()
focal_class.full_signature: private ImmutableMap<TermId, ImmutableSet<TermId>> precomputeAncestors()
focal_class.identifier: precomputeAncestors
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: ImmutableMap<TermId, ImmutableSet<TermId>>
focal_class.signature: ImmutableMap<TermId, ImmutableSet<TermId>> precomputeAncestors()
focal_class.class_method_signature: ImmutableOntology.getMetaInfo()
focal_class.full_signature: @Override public Map<String, String> getMetaInfo()
focal_class.identifier: getMetaInfo
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> getMetaInfo()
focal_class.class_method_signature: ImmutableOntology.getGraph()
focal_class.full_signature: @Override public DefaultDirectedGraph<TermId, IdLabeledEdge> getGraph()
focal_class.identifier: getGraph
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: DefaultDirectedGraph<TermId, IdLabeledEdge>
focal_class.signature: DefaultDirectedGraph<TermId, IdLabeledEdge> getGraph()
focal_class.class_method_signature: ImmutableOntology.getTermMap()
focal_class.full_signature: @Override public Map<TermId, Term> getTermMap()
focal_class.identifier: getTermMap
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<TermId, Term>
focal_class.signature: Map<TermId, Term> getTermMap()
focal_class.class_method_signature: ImmutableOntology.getRelationMap()
focal_class.full_signature: @Override public Map<Integer, Relationship> getRelationMap()
focal_class.identifier: getRelationMap
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<Integer, Relationship>
focal_class.signature: Map<Integer, Relationship> getRelationMap()
focal_class.class_method_signature: ImmutableOntology.isRootTerm(TermId termId)
focal_class.full_signature: @Override public boolean isRootTerm(TermId termId)
focal_class.identifier: isRootTerm
focal_class.modifiers: @Override public
focal_class.parameters: (TermId termId)
focal_class.return: boolean
focal_class.signature: boolean isRootTerm(TermId termId)
focal_class.class_method_signature: ImmutableOntology.getAncestorTermIds(TermId termId, boolean includeRoot)
focal_class.full_signature: @Override public Set<TermId> getAncestorTermIds(TermId termId, boolean includeRoot)
focal_class.identifier: getAncestorTermIds
focal_class.modifiers: @Override public
focal_class.parameters: (TermId termId, boolean includeRoot)
focal_class.return: Set<TermId>
focal_class.signature: Set<TermId> getAncestorTermIds(TermId termId, boolean includeRoot)
focal_class.class_method_signature: ImmutableOntology.getAllAncestorTermIds(Collection<TermId> termIds, boolean includeRoot)
focal_class.full_signature: @Override public Set<TermId> getAllAncestorTermIds(Collection<TermId> termIds, boolean includeRoot)
focal_class.identifier: getAllAncestorTermIds
focal_class.modifiers: @Override public
focal_class.parameters: (Collection<TermId> termIds, boolean includeRoot)
focal_class.return: Set<TermId>
focal_class.signature: Set<TermId> getAllAncestorTermIds(Collection<TermId> termIds, boolean includeRoot)
focal_class.class_method_signature: ImmutableOntology.getRootTermId()
focal_class.full_signature: @Override public TermId getRootTermId()
focal_class.identifier: getRootTermId
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: TermId
focal_class.signature: TermId getRootTermId()
focal_class.class_method_signature: ImmutableOntology.getAllTermIds()
focal_class.full_signature: @Override public Set<TermId> getAllTermIds()
focal_class.identifier: getAllTermIds
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Set<TermId>
focal_class.signature: Set<TermId> getAllTermIds()
focal_class.class_method_signature: ImmutableOntology.getTerms()
focal_class.full_signature: @Override public Collection<Term> getTerms()
focal_class.identifier: getTerms
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<Term>
focal_class.signature: Collection<Term> getTerms()
focal_class.class_method_signature: ImmutableOntology.getNonObsoleteTermIds()
focal_class.full_signature: @Override public Set<TermId> getNonObsoleteTermIds()
focal_class.identifier: getNonObsoleteTermIds
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Set<TermId>
focal_class.signature: Set<TermId> getNonObsoleteTermIds()
focal_class.class_method_signature: ImmutableOntology.getObsoleteTermIds()
focal_class.full_signature: @Override public Set<TermId> getObsoleteTermIds()
focal_class.identifier: getObsoleteTermIds
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Set<TermId>
focal_class.signature: Set<TermId> getObsoleteTermIds()
focal_class.class_method_signature: ImmutableOntology.subOntology(TermId subOntologyRoot)
focal_class.full_signature: @Override public Ontology subOntology(TermId subOntologyRoot)
focal_class.identifier: subOntology
focal_class.modifiers: @Override public
focal_class.parameters: (TermId subOntologyRoot)
focal_class.return: Ontology
focal_class.signature: Ontology subOntology(TermId subOntologyRoot)
focal_class.class_method_signature: ImmutableOntology.builder()
focal_class.full_signature: public static Builder builder()
focal_class.identifier: builder
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Builder
focal_class.signature: Builder builder()
focal_method.body: public static Builder builder() {
      return new Builder();
    }
focal_method.class_method_signature: ImmutableOntology.builder()
focal_method.full_signature: public static Builder builder()
focal_method.identifier: builder
focal_method.modifiers: public static
focal_method.parameters: ()
focal_method.return: Builder
focal_method.signature: Builder builder()