robot-core/src/test/java/org/obolibrary/robot/MireotOperationTest.java
public void testMireot(String expectedPath) throws Exception {
    OWLOntology inputOntology = loadOntology("/filtered.owl");

    IRI outputIRI = IRI.create("http://purl.obolibrary.org/obo/uberon.owl");

    Set<IRI> upperIRIs =
        Collections.singleton(IRI.create("http://purl.obolibrary.org/obo/UBERON_0001235"));
    // Set<IRI> branchIRIs = upperIRIs;

    List<OWLOntology> outputOntologies = new ArrayList<>();

    outputOntologies.add(MireotOperation.getAncestors(inputOntology, upperIRIs, upperIRIs, null));

    /*
    outputOntologies.add(
            MireotOperation.getDescendants(inputOntology,
                    branchIRIs, null));
    */

    OWLOntology outputOntology = MergeOperation.merge(outputOntologies);

    OntologyHelper.setOntologyIRI(outputOntology, outputIRI, null);

    OWLOntology expected = loadOntology(expectedPath);
    removeDeclarations(expected);
    removeDeclarations(outputOntology);
    assertIdentical(expected, outputOntology);
  }
/**
   * Test MIREOT.
   *
   * @param expectedPath the path to a known-good file for comparison
   * @throws Exception on any problem
   */
Test MIREOT.
@param expectedPath the path to a known-good file for comparison
@throws Exception on any problem
Test MIREOT . @param expectedPath the path to a known - good file for comparison @throws Exception on any problem
public void testMireot(String expectedPath) throws Exception {
    OWLOntology inputOntology = loadOntology("/filtered.owl");
    IRI outputIRI = IRI.create("http://purl.obolibrary.org/obo/uberon.owl");
    Set<IRI> upperIRIs =
        Collections.singleton(IRI.create("http://purl.obolibrary.org/obo/UBERON_0001235"));
    List<OWLOntology> outputOntologies = new ArrayList<>();
    outputOntologies.add(MireotOperation.getAncestors(inputOntology, upperIRIs, upperIRIs, null));
    /*
    outputOntologies.add(
            MireotOperation.getDescendants(inputOntology,
                    branchIRIs, null));
    */
    OWLOntology outputOntology = MergeOperation.merge(outputOntologies);
    OntologyHelper.setOntologyIRI(outputOntology, outputIRI, null);
    OWLOntology expected = loadOntology(expectedPath);
    removeDeclarations(expected);
    removeDeclarations(outputOntology);
    assertIdentical(expected, outputOntology);
  }
public void testMireot ( String expectedPath ) throws Exception { OWLOntology inputOntology = loadOntology ( "/filtered.owl" ) ; IRI outputIRI = IRI . create ( "http://purl.obolibrary.org/obo/uberon.owl" ) ; Set < IRI > upperIRIs = Collections . singleton ( IRI . create ( "http://purl.obolibrary.org/obo/UBERON_0001235" ) ) ; List < OWLOntology > outputOntologies = new ArrayList < > ( ) ; outputOntologies . add ( MireotOperation . getAncestors ( inputOntology , upperIRIs , upperIRIs , null ) ) ; /*
    outputOntologies.add(
            MireotOperation.getDescendants(inputOntology,
                    branchIRIs, null));
    */ OWLOntology outputOntology = MergeOperation . merge ( outputOntologies ) ; OntologyHelper . setOntologyIRI ( outputOntology , outputIRI , null ) ; OWLOntology expected = loadOntology ( expectedPath ) ; removeDeclarations ( expected ) ; removeDeclarations ( outputOntology ) ; assertIdentical ( expected , outputOntology ) ; }
Test MIREOT.
Test MIREOT .
// Set<IRI> branchIRIs = upperIRIs;