DiffOperation { public static boolean compare(OWLOntology ontology1, OWLOntology ontology2, Writer writer) throws IOException { return compare(ontology1, ontology2, new IOHelper(), writer, getDefaultOptions()); }  static Map<String, String> getDefaultOptions(); static boolean equals(OWLOntology ontology1, OWLOntology ontology2); static boolean compare(OWLOntology ontology1, OWLOntology ontology2, Writer writer); static boolean compare(
      OWLOntology ontology1,
      OWLOntology ontology2,
      IOHelper ioHelper,
      Writer writer,
      Map<String, String> options); @Deprecated static String addLabels(Map<IRI, String> labels, String axiom); @Deprecated static String addLabels(IOHelper ioHelper, Map<IRI, String> labels, String axiom); @Deprecated static Set<String> getAxiomStrings(OWLOntology ontology);  }
@Test public void testCompareModified() throws IOException, OWLOntologyCreationException { OWLOntology simple = loadOntology("/simple.owl"); Set<OWLOntology> onts = new HashSet<>(); onts.add(simple); OWLOntologyManager manager = simple.getOWLOntologyManager(); OWLDataFactory df = manager.getOWLDataFactory(); OWLOntology simple1 = manager.createOntology(IRI.create(base + "simple1.owl"), onts); IRI test1 = IRI.create(base + "simple.owl#test1"); manager.addAxiom( simple1, df.getOWLAnnotationAssertionAxiom(df.getRDFSLabel(), test1, df.getOWLLiteral("TEST #1"))); StringWriter writer = new StringWriter(); boolean actual = DiffOperation.compare(simple, simple1, writer); System.out.println(writer.toString()); assertFalse(actual); String expected = IOUtils.toString(this.getClass().getResourceAsStream("/simple1.diff")); assertEquals(expected, writer.toString()); }
@Test public void testCompareModifiedWithLabels() throws IOException, OWLOntologyCreationException { OWLOntology simple = loadOntology("/simple.owl"); OWLOntology elk = loadOntology("/simple_elk.owl"); StringWriter writer = new StringWriter(); Map<String, String> options = new HashMap<>(); options.put("labels", "true"); boolean actual = DiffOperation.compare(simple, elk, new IOHelper(), writer, options); System.out.println(writer.toString()); assertFalse(actual); String expected = IOUtils.toString(this.getClass().getResourceAsStream("/simple.diff")); assertEquals(expected, writer.toString()); }