test_class.file: phenol-io/src/test/java/org/monarchinitiative/phenol/io/OntologyLoaderTest.java
test_class.identifier: OntologyLoaderTest
test_case.body: @Test
    void testNCITLoad() {
      Path ncitPath = Paths.get("src/test/resources/ncit_module.owl");
      Ontology ontology = OntologyLoader.loadOntology(ncitPath.toFile(), "NCIT");
      DefaultDirectedGraph<TermId, IdLabeledEdge> graph = ontology.getGraph();
  
      // 1. Checking vertices
      // In this dummy ontology, we have 6 classes.
      TermId t1 = TermId.of("NCIT:C2919");
      TermId t2 = TermId.of("NCIT:C2852");
      TermId t3 = TermId.of("NCIT:C48596");
      TermId t4 = TermId.of("NCIT:C60312");
      TermId t5 = TermId.of("NCIT:C116977");
      TermId t6 = TermId.of("NCIT:C126659");
  
      assertTrue(graph.vertexSet().contains(t1));
      assertTrue(graph.vertexSet().contains(t2));
      assertTrue(graph.vertexSet().contains(t3));
      assertTrue(graph.vertexSet().contains(t4));
      assertTrue(graph.vertexSet().contains(t5));
      // This one is not recognized as a node due to the lack of rdfs:label.
      assertFalse(graph.vertexSet().contains(t6));
  
      // 2. Checking edges
      // Two subclasses are translated into two edges. Other axioms are not yet captured.
      // Given there is no root term an artificial one is created and linked
      assertEquals(4, graph.edgeSet().size());
      assertNotNull(graph.getEdge(t1, t2));
      assertNotNull(graph.getEdge(t1, t3));
  
      // 3. Checking TermIds
      // This is essentially the same as checking vertices.
      assertTrue(ontology.getAllTermIds().contains(t1));
      assertTrue(ontology.getAllTermIds().contains(t2));
      assertTrue(ontology.getAllTermIds().contains(t3));
      assertTrue(ontology.getAllTermIds().contains(t4));
      assertTrue(ontology.getAllTermIds().contains(t5));
      assertFalse(ontology.getAllTermIds().contains(t6));
  
      // 4. Checking RelationMap
      // All meta-information on edges are available in RelationMap instance.
      Relationship gr1 = ontology.getRelationMap().get(graph.getEdge(t1, t2).getId());
      Relationship gr2 = ontology.getRelationMap().get(graph.getEdge(t1, t3).getId());
      assertNotNull(gr1);
      assertNotNull(gr2);
      assertEquals(RelationshipType.IS_A, gr1.getRelationshipType());
      assertEquals(RelationshipType.IS_A, gr2.getRelationshipType());
  
      // 5. The example file contains multiple roots; thus we just put owl:Thing as the root.
      assertEquals(TermId.of("owl:Thing"), ontology.getRootTermId());
    }
test_case.class_method_signature: OntologyLoaderTest.testNCITLoad()
test_case.full_signature: @Test void testNCITLoad()
test_case.identifier: testNCITLoad
test_case.invocations: get loadOntology toFile getGraph of of of of of of assertTrue contains vertexSet assertTrue contains vertexSet assertTrue contains vertexSet assertTrue contains vertexSet assertTrue contains vertexSet assertFalse contains vertexSet assertEquals size edgeSet assertNotNull getEdge assertNotNull getEdge assertTrue contains getAllTermIds assertTrue contains getAllTermIds assertTrue contains getAllTermIds assertTrue contains getAllTermIds assertTrue contains getAllTermIds assertFalse contains getAllTermIds get getRelationMap getId getEdge get getRelationMap getId getEdge assertNotNull assertNotNull assertEquals getRelationshipType assertEquals getRelationshipType assertEquals of getRootTermId
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNCITLoad()
focal_class.declarator: logger = LoggerFactory.getLogger(OntologyLoader.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(OntologyLoader.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.file: phenol-io/src/main/java/org/monarchinitiative/phenol/io/OntologyLoader.java
focal_class.identifier: OntologyLoader
focal_class.class_method_signature: OntologyLoader.OntologyLoader()
focal_class.full_signature: private  OntologyLoader()
focal_class.identifier: OntologyLoader
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  OntologyLoader()
focal_class.class_method_signature: OntologyLoader.loadOntology(File file)
focal_class.full_signature: public static Ontology loadOntology(File file)
focal_class.identifier: loadOntology
focal_class.modifiers: public static
focal_class.parameters: (File file)
focal_class.return: Ontology
focal_class.signature: Ontology loadOntology(File file)
focal_class.class_method_signature: OntologyLoader.loadOntology(File file, String... termIdPrefixes)
focal_class.full_signature: public static Ontology loadOntology(File file, String... termIdPrefixes)
focal_class.identifier: loadOntology
focal_class.modifiers: public static
focal_class.parameters: (File file, String... termIdPrefixes)
focal_class.return: Ontology
focal_class.signature: Ontology loadOntology(File file, String... termIdPrefixes)
focal_class.class_method_signature: OntologyLoader.loadOntology(File file, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.full_signature: public static Ontology loadOntology(File file, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.identifier: loadOntology
focal_class.modifiers: public static
focal_class.parameters: (File file, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.return: Ontology
focal_class.signature: Ontology loadOntology(File file, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.class_method_signature: OntologyLoader.loadOntology(InputStream inputStream)
focal_class.full_signature: public static Ontology loadOntology(InputStream inputStream)
focal_class.identifier: loadOntology
focal_class.modifiers: public static
focal_class.parameters: (InputStream inputStream)
focal_class.return: Ontology
focal_class.signature: Ontology loadOntology(InputStream inputStream)
focal_class.class_method_signature: OntologyLoader.loadOntology(InputStream inputStream, String... termIdPrefixes)
focal_class.full_signature: public static Ontology loadOntology(InputStream inputStream, String... termIdPrefixes)
focal_class.identifier: loadOntology
focal_class.modifiers: public static
focal_class.parameters: (InputStream inputStream, String... termIdPrefixes)
focal_class.return: Ontology
focal_class.signature: Ontology loadOntology(InputStream inputStream, String... termIdPrefixes)
focal_class.class_method_signature: OntologyLoader.loadOntology(InputStream inputStream, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.full_signature: public static Ontology loadOntology(InputStream inputStream, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.identifier: loadOntology
focal_class.modifiers: public static
focal_class.parameters: (InputStream inputStream, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.return: Ontology
focal_class.signature: Ontology loadOntology(InputStream inputStream, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.class_method_signature: OntologyLoader.loadOntology(GraphDocument graphDocument, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.full_signature: public static Ontology loadOntology(GraphDocument graphDocument, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.identifier: loadOntology
focal_class.modifiers: public static
focal_class.parameters: (GraphDocument graphDocument, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.return: Ontology
focal_class.signature: Ontology loadOntology(GraphDocument graphDocument, CurieUtil curieUtil, String... termIdPrefixes)
focal_class.class_method_signature: OntologyLoader.loadGraphDocument(File file)
focal_class.full_signature: private static GraphDocument loadGraphDocument(File file)
focal_class.identifier: loadGraphDocument
focal_class.modifiers: private static
focal_class.parameters: (File file)
focal_class.return: GraphDocument
focal_class.signature: GraphDocument loadGraphDocument(File file)
focal_class.class_method_signature: OntologyLoader.loadGraphDocument(InputStream inputStream)
focal_class.full_signature: private static GraphDocument loadGraphDocument(InputStream inputStream)
focal_class.identifier: loadGraphDocument
focal_class.modifiers: private static
focal_class.parameters: (InputStream inputStream)
focal_class.return: GraphDocument
focal_class.signature: GraphDocument loadGraphDocument(InputStream inputStream)
focal_class.class_method_signature: OntologyLoader.readBytes(InputStream bufferedStream, int readlimit)
focal_class.full_signature: private static String readBytes(InputStream bufferedStream, int readlimit)
focal_class.identifier: readBytes
focal_class.modifiers: private static
focal_class.parameters: (InputStream bufferedStream, int readlimit)
focal_class.return: String
focal_class.signature: String readBytes(InputStream bufferedStream, int readlimit)
focal_class.class_method_signature: OntologyLoader.isJsonGraphDoc(String firstBytes)
focal_class.full_signature: private static boolean isJsonGraphDoc(String firstBytes)
focal_class.identifier: isJsonGraphDoc
focal_class.modifiers: private static
focal_class.parameters: (String firstBytes)
focal_class.return: boolean
focal_class.signature: boolean isJsonGraphDoc(String firstBytes)
focal_method.body: public static Ontology loadOntology(File file) {
      return loadOntology(file, CurieUtilBuilder.defaultCurieUtil());
    }
focal_method.class_method_signature: OntologyLoader.loadOntology(File file)
focal_method.full_signature: public static Ontology loadOntology(File file)
focal_method.identifier: loadOntology
focal_method.invocations: loadOntology defaultCurieUtil
focal_method.modifiers: public static
focal_method.parameters: (File file)
focal_method.return: Ontology
focal_method.signature: Ontology loadOntology(File file)