From 4af6a6db334dd4e929e1c342b8d403a68c9cd765 Mon Sep 17 00:00:00 2001 From: Chris Mungall Date: Mon, 6 Mar 2017 18:00:07 -0800 Subject: [PATCH 1/7] Removing dependency on knife --- OWLTools-Parent/pom.xml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/OWLTools-Parent/pom.xml b/OWLTools-Parent/pom.xml index 810c0e4c0..0dd8bd41f 100644 --- a/OWLTools-Parent/pom.xml +++ b/OWLTools-Parent/pom.xml @@ -105,21 +105,6 @@ - - BerkeleyBOP - Berkeley BOP maven repository - http://code.berkeleybop.org/maven/repository/ - - true - - - - BerkeleyBOPSnapshot - http://code.berkeleybop.org/maven/snapshot-repository/ - - true - - oss-sonatype-snapshot OSS Sonatype Maven Repository - Releases From af6cb79e1a4a931b9b93f5375dcdddb6048215b8 Mon Sep 17 00:00:00 2001 From: Chris Mungall Date: Mon, 6 Mar 2017 18:55:56 -0800 Subject: [PATCH 2/7] replacing Obo2Owl with OWLAPIObo2Owl this is to get rid of dependencies on the deprecated org.bbop.oboformat-tools obo code, and use the owlapi version --- .../gaf/eco/TraversingEcoMapperImpl.java | 4 +- OWLTools-Core/pom.xml | 4 -- .../graph/OWLGraphWrapperExtended.java | 14 ++--- .../main/java/owltools/io/ParserWrapper.java | 4 +- .../owltools/mooncat/PropertyExtractor.java | 4 +- .../mooncat/PropertyViewOntologyBuilder.java | 6 +-- .../graph/AxiomAnnotationToolsTest.java | 4 +- .../graph/CardinalityContraintsToolsTest.java | 4 +- .../CardinalityCheckAndRepairMooncatTest.java | 4 +- .../mooncat/ImportPropertyMooncatTest.java | 6 +-- .../mooncat/QuerySubsetGeneratorTest.java | 4 +- .../mooncat/RemoveDirectivesTest.java | 4 +- .../mooncat/SubsetDefMooncatTest.java | 4 +- .../owltools/reasoner/AxiomJengaTest.java | 53 +++++++++++++++++++ .../owltools/cli/AssertInferenceTool.java | 6 +-- .../ontologyrelease/GetOntologyId.java | 4 +- .../OboOntologyReleaseRunner.java | 6 +-- .../ontologyrelease/OortReasonerTest.java | 4 +- .../main/java/owltools/cli/CommandRunner.java | 18 +++---- .../preprocessor/AbstractSimPreProcessor.java | 6 +-- 20 files changed, 106 insertions(+), 57 deletions(-) create mode 100644 OWLTools-Core/src/test/java/owltools/reasoner/AxiomJengaTest.java diff --git a/OWLTools-Annotation/src/main/java/owltools/gaf/eco/TraversingEcoMapperImpl.java b/OWLTools-Annotation/src/main/java/owltools/gaf/eco/TraversingEcoMapperImpl.java index aad55a39f..0ee6213a0 100644 --- a/OWLTools-Annotation/src/main/java/owltools/gaf/eco/TraversingEcoMapperImpl.java +++ b/OWLTools-Annotation/src/main/java/owltools/gaf/eco/TraversingEcoMapperImpl.java @@ -6,7 +6,7 @@ import java.util.Map; import java.util.Set; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.semanticweb.owlapi.model.OWLClass; import org.semanticweb.owlapi.reasoner.OWLReasoner; @@ -109,7 +109,7 @@ public Set getAllValidEvidenceIds(Set codes, boolean includeChil } private String getId(OWLClass cls) { - return Owl2Obo.getIdentifier(cls.getIRI()); + return OWLAPIOwl2Obo.getIdentifier(cls.getIRI()); } @Override diff --git a/OWLTools-Core/pom.xml b/OWLTools-Core/pom.xml index a238f03c0..155c3c5a9 100644 --- a/OWLTools-Core/pom.xml +++ b/OWLTools-Core/pom.xml @@ -63,10 +63,6 @@ net.sourceforge.owlapi org.semanticweb.hermit - - org.bbop - oboformat-tools - uk.ac.ebi.interpro graphdraw diff --git a/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperExtended.java b/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperExtended.java index fa3b5609f..0398de8ae 100644 --- a/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperExtended.java +++ b/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperExtended.java @@ -13,7 +13,7 @@ import org.obolibrary.obo2owl.Obo2OWLConstants.Obo2OWLVocabulary; import org.obolibrary.obo2owl.Obo2OWLConstants; import org.obolibrary.obo2owl.Obo2Owl; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatConstants.OboFormatTag; import org.semanticweb.owlapi.model.AxiomType; @@ -834,7 +834,7 @@ public List getDefXref(OWLObject c, List sargs){ * @return OBO-style identifier, using obo2owl mapping */ public String getIdentifier(OWLObject owlObject) { - return Owl2Obo.getIdentifierFromObject(owlObject, this.sourceOntology, null); + return OWLAPIOwl2Obo.getIdentifierFromObject(owlObject, this.sourceOntology, null); } /** @@ -850,7 +850,7 @@ public String getIdentifier(OWLObject owlObject, boolean useShorthand) { return getIdentifier(owlObject); } if (owlObject instanceof OWLNamedObject) { - return Owl2Obo.getIdentifier(((OWLNamedObject) owlObject).getIRI()); + return OWLAPIOwl2Obo.getIdentifier(((OWLNamedObject) owlObject).getIRI()); } return null; } @@ -878,7 +878,7 @@ public String getIdentifier(OWLObject owlObject, List sargs) { * @return OBO-style identifier, using obo2owl mapping */ public String getIdentifier(IRI iriId) { - return Owl2Obo.getIdentifier(iriId); + return OWLAPIOwl2Obo.getIdentifier(iriId); } public IRI getIRIByIdentifier(String id) { return getIRIByIdentifier(id, false); @@ -1377,7 +1377,7 @@ public OWLObject getOWLObject(IRI s) { * @return id of source ontology */ public String getOntologyId(){ - return Owl2Obo.getOntologyId(this.getSourceOntology()); + return OWLAPIOwl2Obo.getOntologyId(this.getSourceOntology()); } /** @@ -1391,9 +1391,9 @@ public String getOntologyId(){ public Map getVersions() { Map versions = new HashMap(); for (OWLOntology o : getAllOntologies()) { - String oid = Owl2Obo.getOntologyId(o); + String oid = OWLAPIOwl2Obo.getOntologyId(o); if (oid != null) { - String dataVersion = Owl2Obo.getDataVersion(o); + String dataVersion = OWLAPIOwl2Obo.getDataVersion(o); if (dataVersion != null) { versions.put(oid, dataVersion); } diff --git a/OWLTools-Core/src/main/java/owltools/io/ParserWrapper.java b/OWLTools-Core/src/main/java/owltools/io/ParserWrapper.java index 4da7b0421..d5fc0fd83 100644 --- a/OWLTools-Core/src/main/java/owltools/io/ParserWrapper.java +++ b/OWLTools-Core/src/main/java/owltools/io/ParserWrapper.java @@ -19,7 +19,7 @@ import org.geneontology.obographs.io.OgYamlGenerator; import org.geneontology.obographs.model.GraphDocument; import org.geneontology.obographs.owlapi.FromOwl; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.Frame; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatConstants.OboFormatTag; @@ -228,7 +228,7 @@ public void saveOWL(OWLOntology ont, OWLDocumentFormat owlFormat, // special work-around for skipping the OBO validation before write // see also OWL-API issue: https://github.com/owlcs/owlapi/issues/290 // see also saveOWL(OWLOntology, OWLOntologyFormat, String) for redundant code - Owl2Obo bridge = new Owl2Obo(); + OWLAPIOwl2Obo bridge = new OWLAPIOwl2Obo(); OBODoc doc; BufferedWriter bw = null; try { diff --git a/OWLTools-Core/src/main/java/owltools/mooncat/PropertyExtractor.java b/OWLTools-Core/src/main/java/owltools/mooncat/PropertyExtractor.java index 3a1a563c0..841c2b7d3 100644 --- a/OWLTools-Core/src/main/java/owltools/mooncat/PropertyExtractor.java +++ b/OWLTools-Core/src/main/java/owltools/mooncat/PropertyExtractor.java @@ -5,7 +5,7 @@ import java.util.UUID; import org.apache.log4j.Logger; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLAnnotationProperty; import org.semanticweb.owlapi.model.OWLAxiom; @@ -158,7 +158,7 @@ public OWLOntology extractPropertyOntology(IRI newIRI, Set props) t df.getOWLLiteral(id)); axioms.add(ax); LOG.info(ax); - String pid = Owl2Obo.getIdentifier(prop.getIRI()); + String pid = OWLAPIOwl2Obo.getIdentifier(prop.getIRI()); axioms.add( df.getOWLAnnotationAssertionAxiom( df.getOWLAnnotationProperty(IRI.create("http://www.geneontology.org/formats/oboInOwl#hasDbXref")), diff --git a/OWLTools-Core/src/main/java/owltools/mooncat/PropertyViewOntologyBuilder.java b/OWLTools-Core/src/main/java/owltools/mooncat/PropertyViewOntologyBuilder.java index 8a16e96c0..08bd7f463 100644 --- a/OWLTools-Core/src/main/java/owltools/mooncat/PropertyViewOntologyBuilder.java +++ b/OWLTools-Core/src/main/java/owltools/mooncat/PropertyViewOntologyBuilder.java @@ -9,7 +9,7 @@ import org.apache.log4j.Logger; import org.obolibrary.obo2owl.Obo2OWLConstants; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.semanticweb.owlapi.model.AxiomType; import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLAnnotation; @@ -728,8 +728,8 @@ public IRI makeViewClassIRI(IRI vcIRI, IRI vpIRI, String sep) { if (!isUseOriginalClassIRIs) { String vcIRIstr = vcIRI.toString(); if (isAssumeOBOStyleIRIs) { - String baseId = Owl2Obo.getIdentifier(vcIRI); - String relId = Owl2Obo.getIdentifier(vpIRI); + String baseId = OWLAPIOwl2Obo.getIdentifier(vcIRI); + String relId = OWLAPIOwl2Obo.getIdentifier(vpIRI); vcIRIstr = Obo2OWLConstants.DEFAULT_IRI_PREFIX + baseId.replace(":", "_") + sep + relId.replace("_", "-").replace(":", "-"); diff --git a/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java b/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java index 3ccb3aa0d..f08cc5d0f 100644 --- a/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java +++ b/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java @@ -8,7 +8,7 @@ import org.apache.commons.io.FileUtils; import org.junit.Test; import org.obolibrary.obo2owl.Obo2Owl; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; import org.semanticweb.owlapi.model.OWLOntology; @@ -34,7 +34,7 @@ public void testReduceAxiomAnnotationsToOboBasicOWLOntology() throws Exception { OBODoc inputOboDoc = p.parse(inputFile); Obo2Owl obo2Owl = new Obo2Owl(); OWLOntology owlOntology = obo2Owl.convert(inputOboDoc); - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); // check round-trip first before removing equals(inputFile, owl2Obo.convert(owlOntology)); diff --git a/OWLTools-Core/src/test/java/owltools/graph/CardinalityContraintsToolsTest.java b/OWLTools-Core/src/test/java/owltools/graph/CardinalityContraintsToolsTest.java index 8332cf76b..2e434dddc 100644 --- a/OWLTools-Core/src/test/java/owltools/graph/CardinalityContraintsToolsTest.java +++ b/OWLTools-Core/src/test/java/owltools/graph/CardinalityContraintsToolsTest.java @@ -5,7 +5,7 @@ import java.util.Collection; import org.junit.Test; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.Clause; import org.obolibrary.oboformat.model.Frame; import org.obolibrary.oboformat.model.OBODoc; @@ -27,7 +27,7 @@ public void testRemoveCardinalityConstraints() throws Exception { OWLOntology owlOntology = graph.getSourceOntology(); CardinalityContraintsTools.removeCardinalityConstraints(owlOntology); - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc obo = owl2Obo.convert(owlOntology); assertNoQualifiers("TEST:1000", obo); diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/CardinalityCheckAndRepairMooncatTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/CardinalityCheckAndRepairMooncatTest.java index aafc7b3a5..b41b9484f 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/CardinalityCheckAndRepairMooncatTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/CardinalityCheckAndRepairMooncatTest.java @@ -6,7 +6,7 @@ import org.junit.Test; import org.obolibrary.obo2owl.OboInOwlCardinalityTools; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.Clause; import org.obolibrary.oboformat.model.Frame; import org.obolibrary.oboformat.model.OBODoc; @@ -46,7 +46,7 @@ public void testMireot() throws Exception { OWLOntology sourceOntology = g.getSourceOntology(); OboInOwlCardinalityTools.checkAnnotationCardinality(sourceOntology); - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc oboDoc = owl2Obo.convert(sourceOntology); if (RENDER_ONTOLOGY_FLAG) { renderOBO(oboDoc); diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java index 51dd0463a..848a6a275 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java @@ -6,7 +6,7 @@ import org.junit.Test; import org.obolibrary.obo2owl.OboInOwlCardinalityTools; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.Clause; import org.obolibrary.oboformat.model.Frame; import org.obolibrary.oboformat.model.OBODoc; @@ -46,7 +46,7 @@ public void testImportProperties() throws Exception { OWLOntology sourceOntology = g.getSourceOntology(); OboInOwlCardinalityTools.checkAnnotationCardinality(sourceOntology); - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc oboDoc = owl2Obo.convert(sourceOntology); if (RENDER_ONTOLOGY_FLAG) { renderOBO(oboDoc); @@ -92,7 +92,7 @@ public void testImportProperties2() throws Exception { OWLOntology sourceOntology = g.getSourceOntology(); OboInOwlCardinalityTools.checkAnnotationCardinality(sourceOntology); - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc oboDoc = owl2Obo.convert(sourceOntology); if (RENDER_ONTOLOGY_FLAG) { renderOBO(oboDoc); diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/QuerySubsetGeneratorTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/QuerySubsetGeneratorTest.java index aaab7ba30..de9835a82 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/QuerySubsetGeneratorTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/QuerySubsetGeneratorTest.java @@ -7,7 +7,7 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.junit.Test; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; import org.semanticweb.elk.owlapi.ElkReasonerFactory; @@ -60,7 +60,7 @@ public void testCreateSubOntologyFromDLQuery() throws Exception { Set toMerge = sourceGraph.getAllOntologies(); generator.createSubOntologyFromDLQuery(dlQueryString, sourceGraph, targetGraph, reasonerFactory, toMerge); - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc oboDoc = owl2Obo.convert(targetGraph.getSourceOntology()); if (renderObo) { renderOBO(oboDoc); diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/RemoveDirectivesTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/RemoveDirectivesTest.java index bea266bf2..ea077c8f9 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/RemoveDirectivesTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/RemoveDirectivesTest.java @@ -5,7 +5,7 @@ import java.util.Collection; import org.junit.Test; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.Clause; import org.obolibrary.oboformat.model.Frame; import org.obolibrary.oboformat.model.OBODoc; @@ -45,7 +45,7 @@ public void testRemove() throws Exception { System.out.println(merged.getAxioms(AxiomType.EQUIVALENT_CLASSES)); - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc mergedObo = owl2Obo.convert(merged); if (USE_SYSTEM_OUT) { diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/SubsetDefMooncatTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/SubsetDefMooncatTest.java index e828b7dec..1fd9f09aa 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/SubsetDefMooncatTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/SubsetDefMooncatTest.java @@ -7,7 +7,7 @@ import org.junit.Test; import org.obolibrary.obo2owl.OboInOwlCardinalityTools; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.Clause; import org.obolibrary.oboformat.model.Frame; import org.obolibrary.oboformat.model.OBODoc; @@ -47,7 +47,7 @@ public void testImportProperties2() throws Exception { OWLOntology sourceOntology = g.getSourceOntology(); OboInOwlCardinalityTools.checkAnnotationCardinality(sourceOntology); - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc oboDoc = owl2Obo.convert(sourceOntology); if (RENDER_ONTOLOGY_FLAG) { renderOBO(oboDoc); diff --git a/OWLTools-Core/src/test/java/owltools/reasoner/AxiomJengaTest.java b/OWLTools-Core/src/test/java/owltools/reasoner/AxiomJengaTest.java new file mode 100644 index 000000000..62f62c01c --- /dev/null +++ b/OWLTools-Core/src/test/java/owltools/reasoner/AxiomJengaTest.java @@ -0,0 +1,53 @@ +package owltools.reasoner; + +import static org.junit.Assert.*; + +import java.io.IOException; + +import org.junit.Test; +import org.obolibrary.oboformat.parser.OBOFormatParserException; +import org.semanticweb.elk.owlapi.ElkReasonerFactory; +import org.semanticweb.owlapi.model.OWLOntology; +import org.semanticweb.owlapi.model.OWLOntologyCreationException; +import org.semanticweb.owlapi.reasoner.OWLReasoner; + +import owltools.graph.OWLGraphWrapper; + +public class AxiomJengaTest extends AbstractReasonerTest { + + @Test + public void testNoReplace() throws OBOFormatParserException, OWLOntologyCreationException, IOException { + OWLGraphWrapper g = getOntologyWrapper("jenga.obo"); + OWLOntology ontology = g.getSourceOntology(); + ElkReasonerFactory rf = new ElkReasonerFactory(); + OWLReasoner reasoner = rf.createReasoner(ontology); + JengaTower jt = AxiomJenga.makeJengaTower(ontology, reasoner, false); + System.out.println(jt); + assertTrue(jt.maxJenga == 8); + } + + @Test + public void testWithReplace() throws OBOFormatParserException, OWLOntologyCreationException, IOException { + OWLGraphWrapper g = getOntologyWrapper("jenga.obo"); + OWLOntology ontology = g.getSourceOntology(); + ElkReasonerFactory rf = new ElkReasonerFactory(); + OWLReasoner reasoner = rf.createReasoner(ontology); + JengaTower jt = AxiomJenga.makeJengaTower(ontology, reasoner, true); + System.out.println(jt); + assertTrue(jt.maxJenga == 0); + + } + + @Test + public void testNoReplaceLogDef() throws OBOFormatParserException, OWLOntologyCreationException, IOException { + OWLGraphWrapper g = getOntologyWrapper("jenga_ld.obo"); + OWLOntology ontology = g.getSourceOntology(); + ElkReasonerFactory rf = new ElkReasonerFactory(); + OWLReasoner reasoner = rf.createReasoner(ontology); + JengaTower jt = AxiomJenga.makeJengaTower(ontology, reasoner, false); + System.out.println(jt); + //assertTrue(jt.maxJenga == 0); + + } + +} diff --git a/OWLTools-Oort/src/main/java/owltools/cli/AssertInferenceTool.java b/OWLTools-Oort/src/main/java/owltools/cli/AssertInferenceTool.java index a8b178472..5e515a8ae 100644 --- a/OWLTools-Oort/src/main/java/owltools/cli/AssertInferenceTool.java +++ b/OWLTools-Oort/src/main/java/owltools/cli/AssertInferenceTool.java @@ -23,7 +23,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Level; import org.apache.log4j.Logger; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.writer.OBOFormatWriter; import org.obolibrary.oboformat.writer.OBOFormatWriter.NameProvider; @@ -251,7 +251,7 @@ else if (primaryInput.endsWith(".ofn")) { @Override public boolean useOWLClass(OWLClass cls, OWLOntology ont) { - String id = Owl2Obo.getIdentifierFromObject(cls, ont, null); + String id = OWLAPIOwl2Obo.getIdentifierFromObject(cls, ont, null); boolean use = id != null && id.startsWith(prefix); return use; } @@ -329,7 +329,7 @@ static void writeOntologyFile(OWLOntology ontology, OWLGraphWrapper graph, Strin if ("obo".equals(outputFileFormat)) { BufferedWriter bufferedWriter = null; try { - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc oboDoc = owl2Obo.convert(ontology); OBOFormatWriter oboWriter = new OBOFormatWriter(); bufferedWriter = new BufferedWriter(new FileWriter(outputFile)); diff --git a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java index eb7fa8bb7..f7a258ee0 100644 --- a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java +++ b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java @@ -6,7 +6,7 @@ import org.apache.tools.ant.PropertyHelper; import org.apache.tools.ant.Task; import org.obolibrary.obo2owl.Obo2Owl; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.OWLOntologyManager; @@ -58,7 +58,7 @@ public void execute(){ try{ OWLOntology ontology = getOntology(); - String ontologyId = Owl2Obo.getOntologyId(ontology); + String ontologyId = OWLAPIOwl2Obo.getOntologyId(ontology); /*PropertyHelper propertyHelper = (PropertyHelper) PropertyHelper.getPropertyHelper(getProject()); diff --git a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java index 5b62b75fa..59eb0c0a1 100644 --- a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java +++ b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java @@ -25,7 +25,7 @@ import org.obolibrary.obo2owl.Obo2Owl; import org.obolibrary.obo2owl.OboInOwlCardinalityTools; import org.obolibrary.obo2owl.OboInOwlCardinalityTools.AnnotationCardinalityException; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.InvalidXrefMapException; import org.obolibrary.oboformat.parser.OBOFormatConstants.OboFormatTag; @@ -1313,7 +1313,7 @@ private String getIdSpace(OWLClass c) { } private String handleOntologyId() { - String ontologyId = Owl2Obo.getOntologyId(mooncat.getOntology()); + String ontologyId = OWLAPIOwl2Obo.getOntologyId(mooncat.getOntology()); ontologyId = ontologyId.replaceAll(".obo$", ""); // TODO temp workaround return ontologyId; } @@ -1712,7 +1712,7 @@ private void saveOntologyInAllFormats(String idspace, String fileNameBase, Strin if (!oortConfig.isSkipFormat("obo")) { - Owl2Obo owl2obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2obo = new OWLAPIOwl2Obo(); OBODoc doc = owl2obo.convert(ontologyToSave); OBOFormatWriter writer = new OBOFormatWriter(); diff --git a/OWLTools-Oort/src/test/java/owltools/ontologyrelease/OortReasonerTest.java b/OWLTools-Oort/src/test/java/owltools/ontologyrelease/OortReasonerTest.java index 55478a765..595a8931f 100644 --- a/OWLTools-Oort/src/test/java/owltools/ontologyrelease/OortReasonerTest.java +++ b/OWLTools-Oort/src/test/java/owltools/ontologyrelease/OortReasonerTest.java @@ -8,7 +8,7 @@ import java.util.List; import org.junit.Test; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.Clause; import org.obolibrary.oboformat.model.Frame; import org.obolibrary.oboformat.model.OBODoc; @@ -53,7 +53,7 @@ public void testIssueTwo() throws Exception { for(OWLAxiom ax : b.getRedundantAxioms()) { graph.getManager().applyChange(new RemoveAxiom(owlOntology, ax)); } - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc oboDoc = owl2Obo.convert(owlOntology); if (renderObo) { diff --git a/OWLTools-Runner/src/main/java/owltools/cli/CommandRunner.java b/OWLTools-Runner/src/main/java/owltools/cli/CommandRunner.java index c55f1f240..5b1b8c672 100644 --- a/OWLTools-Runner/src/main/java/owltools/cli/CommandRunner.java +++ b/OWLTools-Runner/src/main/java/owltools/cli/CommandRunner.java @@ -51,7 +51,7 @@ import org.obolibrary.obo2owl.Obo2OWLConstants; import org.obolibrary.obo2owl.Obo2OWLConstants.Obo2OWLVocabulary; import org.obolibrary.obo2owl.OboInOwlCardinalityTools; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.Frame; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatConstants.OboFormatTag; @@ -1652,7 +1652,7 @@ else if (MODE_ADD.equals(mode)) { } if (addXref) { // xref to OBO style ID - String pid = Owl2Obo.getIdentifier(prop.getIRI()); + String pid = OWLAPIOwl2Obo.getIdentifier(prop.getIRI()); OWLAxiom ax = df.getOWLAnnotationAssertionAxiom( xrefProperty, prop.getIRI(), @@ -4471,8 +4471,8 @@ else if (opts.nextEq("--comment-prefix")) { // setup date string and ontology version strings StringBuilder header = new StringBuilder(); OWLOntology ont = g.getSourceOntology(); - String ontologyId = Owl2Obo.getOntologyId(ont); - String dataVersion = Owl2Obo.getDataVersion(ont); + String ontologyId = OWLAPIOwl2Obo.getOntologyId(ont); + String dataVersion = OWLAPIOwl2Obo.getDataVersion(ont); header.append(commentPrefix); header.append(" Generated on "); TimeZone tz = TimeZone.getTimeZone("UTC"); @@ -5086,7 +5086,7 @@ else if (opts.nextEq("-e|--exception")) { @Override public void visit(OWLClass cls) { - String id = Owl2Obo.getIdentifier(cls.getIRI()); + String id = OWLAPIOwl2Obo.getIdentifier(cls.getIRI()); if (id.startsWith(matchPrefix) && !matchExceptions.contains(id)) { upperLevelIRIs.add(cls.getIRI()); } @@ -5094,7 +5094,7 @@ public void visit(OWLClass cls) { @Override public void visit(OWLObjectProperty property) { - String id = Owl2Obo.getIdentifier(property.getIRI()); + String id = OWLAPIOwl2Obo.getIdentifier(property.getIRI()); if (id.startsWith(matchPrefix) && !matchExceptions.contains(id)) { upperLevelIRIs.add(property.getIRI()); } @@ -5663,7 +5663,7 @@ else if (opts.nextEq("-t|--term")) { } // obo if (outputFileObo != null) { - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc doc = owl2Obo.convert(work); OBOFormatWriter writer = new OBOFormatWriter(); @@ -5805,7 +5805,7 @@ else if (oldVersionIRI != null) { } // obo if (outputFileObo != null) { - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc doc = owl2Obo.convert(filtered); OBOFormatWriter writer = new OBOFormatWriter(); @@ -5984,7 +5984,7 @@ else if (opts.nextEq("--iri")) { slim.getOWLOntologyManager().saveOntology(slim, IRI.create(outFile)); } if (outputObo != null) { - Owl2Obo owl2Obo = new Owl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); OBODoc oboDoc = owl2Obo.convert(slim); OBOFormatWriter w = new OBOFormatWriter(); w.write(oboDoc, outputObo); diff --git a/OWLTools-Sim/src/main/java/owltools/sim2/preprocessor/AbstractSimPreProcessor.java b/OWLTools-Sim/src/main/java/owltools/sim2/preprocessor/AbstractSimPreProcessor.java index 87a89d249..aae194bef 100644 --- a/OWLTools-Sim/src/main/java/owltools/sim2/preprocessor/AbstractSimPreProcessor.java +++ b/OWLTools-Sim/src/main/java/owltools/sim2/preprocessor/AbstractSimPreProcessor.java @@ -13,7 +13,7 @@ import org.apache.log4j.Logger; import org.obolibrary.obo2owl.Obo2OWLConstants; -import org.obolibrary.obo2owl.Owl2Obo; +import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.semanticweb.elk.owlapi.ElkReasonerFactory; import org.semanticweb.owlapi.formats.RDFXMLDocumentFormat; import org.semanticweb.owlapi.model.AxiomType; @@ -343,8 +343,8 @@ public IRI makeViewClassIRI(IRI vcIRI, IRI vpIRI, String sep, boolean isUseOrigi if (!isUseOriginalClassIRIs) { String vcIRIstr = vcIRI.toString(); if (isAssumeOBOStyleIRIs) { - String baseId = Owl2Obo.getIdentifier(vcIRI); - String relId = Owl2Obo.getIdentifier(vpIRI); + String baseId = OWLAPIOwl2Obo.getIdentifier(vcIRI); + String relId = OWLAPIOwl2Obo.getIdentifier(vpIRI); vcIRIstr = Obo2OWLConstants.DEFAULT_IRI_PREFIX + baseId.replace(":", "_") + sep + relId.replace("_", "-").replace(":", "-"); From 1669910f577d190967b31a46c555ac28ca5f8b33 Mon Sep 17 00:00:00 2001 From: Chris Mungall Date: Mon, 6 Mar 2017 18:57:39 -0800 Subject: [PATCH 3/7] replacing Obo2Owl with OWLAPIObo2Owl --- .../main/java/owltools/graph/AxiomAnnotationTools.java | 6 +++--- .../main/java/owltools/graph/OWLGraphWrapperEdges.java | 4 ++-- .../java/owltools/graph/OWLGraphWrapperExtended.java | 10 +++++----- .../src/test/java/owltools/TaxonGraphTest.java | 4 ++-- .../java/owltools/graph/AxiomAnnotationToolsTest.java | 4 ++-- .../test/java/owltools/graph/OWLGraphWrapperTest.java | 4 ++-- .../owltools/graph/RetrieveRelationByLabelTest.java | 4 ++-- .../src/test/java/owltools/io/OWLGsonRendererTest.java | 4 ++-- .../java/owltools/io/StanzaToOWLConverterTest.java | 4 ++-- OWLTools-NCBI/src/main/java/owltools/ncbi/NCBIOWL.java | 4 ++-- .../src/main/java/owltools/ncbi/OWLConverter.java | 2 +- .../java/owltools/ontologyrelease/GetOntologyId.java | 6 +++--- .../ontologyrelease/OboOntologyReleaseRunner.java | 4 ++-- .../src/main/java/owltools/sim2/OwlSimUtil.java | 4 ++-- .../src/test/java/owltools/flex/FlexTest.java | 4 ++-- .../src/test/java/owltools/flex/OWLGraphFlexTest.java | 6 +++--- 16 files changed, 37 insertions(+), 37 deletions(-) diff --git a/OWLTools-Core/src/main/java/owltools/graph/AxiomAnnotationTools.java b/OWLTools-Core/src/main/java/owltools/graph/AxiomAnnotationTools.java index b5563483b..5a8129b0c 100644 --- a/OWLTools-Core/src/main/java/owltools/graph/AxiomAnnotationTools.java +++ b/OWLTools-Core/src/main/java/owltools/graph/AxiomAnnotationTools.java @@ -7,7 +7,7 @@ import java.util.Set; import org.obolibrary.obo2owl.Obo2OWLConstants; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLAnnotation; import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom; @@ -307,9 +307,9 @@ public static OWLAxiom reduceAxiomAnnotationsToOboBasic(OWLAxiom axiom, OWLOntol IRI iri = p.getIRI(); /* * if the property IRI is not in a predefined annotation property in - * Obo2Owl assume that it's not OBO-Basic + * OWLAPIObo2Owl assume that it's not OBO-Basic */ - if (Obo2Owl.ANNOTATIONPROPERTYMAP.containsValue(iri) == false) { + if (OWLAPIObo2Owl.ANNOTATIONPROPERTYMAP.containsValue(iri) == false) { // remove axiom annotation changed = true; } diff --git a/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperEdges.java b/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperEdges.java index 6d726beb5..8eb785523 100644 --- a/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperEdges.java +++ b/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperEdges.java @@ -12,7 +12,7 @@ import java.util.Vector; import org.apache.log4j.Logger; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.semanticweb.owlapi.model.AxiomType; import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLAnnotation; @@ -1917,7 +1917,7 @@ public List getRelationOrChain(String id) { public List expandRelationChain(OWLObjectProperty property) { // create the annotation property which marks sub property chain as a valid expansion for a property - IRI iri = IRI.create(Obo2Owl.IRI_PROP_ISREVERSIBLEPROPERTYCHAIN); + IRI iri = IRI.create(OWLAPIObo2Owl.IRI_PROP_ISREVERSIBLEPROPERTYCHAIN); final OWLAnnotationProperty prop = getDataFactory().getOWLAnnotationProperty(iri); // get all OWLSubPropertyChainOfAxiom from all ontologies in this graph for a given property diff --git a/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperExtended.java b/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperExtended.java index 0398de8ae..57f4d9be5 100644 --- a/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperExtended.java +++ b/OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperExtended.java @@ -12,7 +12,7 @@ import org.obolibrary.obo2owl.Obo2OWLConstants.Obo2OWLVocabulary; import org.obolibrary.obo2owl.Obo2OWLConstants; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatConstants.OboFormatTag; @@ -595,7 +595,7 @@ public boolean getIsAnonymous(OWLObject c) { * @return {@link OWLAnnotationProperty} */ public OWLAnnotationProperty getAnnotationProperty(String tag){ - return getDataFactory().getOWLAnnotationProperty(Obo2Owl.trTagToIRI(tag)); + return getDataFactory().getOWLAnnotationProperty(OWLAPIObo2Owl.trTagToIRI(tag)); } @@ -896,7 +896,7 @@ public IRI getIRIByIdentifier(String id, boolean isAutoResolve) { // or for relations with a non identifiers with-out a colon, e.g. negative_regulation if (!id.contains(":")) { final OWLAnnotationProperty shortHand = getDataFactory().getOWLAnnotationProperty(Obo2OWLVocabulary.IRI_OIO_shorthand.getIRI()); - final OWLAnnotationProperty oboIdInOwl = getDataFactory().getOWLAnnotationProperty(Obo2Owl.trTagToIRI(OboFormatTag.TAG_ID.getTag())); + final OWLAnnotationProperty oboIdInOwl = getDataFactory().getOWLAnnotationProperty(OWLAPIObo2Owl.trTagToIRI(OboFormatTag.TAG_ID.getTag())); for (OWLOntology o : getAllOntologies()) { for(OWLObjectProperty p : o.getObjectPropertiesInSignature()) { // check for short hand or obo ID in owl @@ -924,7 +924,7 @@ public IRI getIRIByIdentifier(String id, boolean isAutoResolve) { // otherwise use the obo2owl method - Obo2Owl b = new Obo2Owl(getManager()); // re-use manager, creating a new one can be expensive as this is a highly used code path + OWLAPIObo2Owl b = new OWLAPIObo2Owl(getManager()); // re-use manager, creating a new one can be expensive as this is a highly used code path b.setObodoc(new OBODoc()); return b.oboIdToIRI(id); } @@ -1419,7 +1419,7 @@ public Map getVersions() { } private String getOntologyAnnotationValue(OWLOntology o, OboFormatTag tag) { - IRI dateTagIRI = Obo2Owl.trTagToIRI(tag.getTag()); + IRI dateTagIRI = OWLAPIObo2Owl.trTagToIRI(tag.getTag()); Set annotations = o.getAnnotations(); for (OWLAnnotation annotation : annotations) { OWLAnnotationProperty property = annotation.getProperty(); diff --git a/OWLTools-Core/src/test/java/owltools/TaxonGraphTest.java b/OWLTools-Core/src/test/java/owltools/TaxonGraphTest.java index 3b32d96f4..c2b2bfd97 100644 --- a/OWLTools-Core/src/test/java/owltools/TaxonGraphTest.java +++ b/OWLTools-Core/src/test/java/owltools/TaxonGraphTest.java @@ -9,7 +9,7 @@ import org.junit.Before; import org.junit.Test; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.oboformat.model.FrameMergeException; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; @@ -33,7 +33,7 @@ public void before() throws Exception { files.add(getResource("taxon_union_terms.obo").getAbsolutePath()); OBOFormatParser p = new OBOFormatParser(); - Obo2Owl obo2Owl = new Obo2Owl(); + OWLAPIObo2Owl obo2Owl = new OWLAPIObo2Owl(); OBODoc merged = null; for(String file : files) { OBODoc oboDoc = p.parse(file); diff --git a/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java b/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java index f08cc5d0f..bb4e5748e 100644 --- a/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java +++ b/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java @@ -7,7 +7,7 @@ import org.apache.commons.io.FileUtils; import org.junit.Test; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; @@ -32,7 +32,7 @@ public void testReduceAxiomAnnotationsToOboBasicOWLOntology() throws Exception { OBOFormatParser p = new OBOFormatParser(); OBODoc inputOboDoc = p.parse(inputFile); - Obo2Owl obo2Owl = new Obo2Owl(); + OWLAPIObo2Owl obo2Owl = new OWLAPIObo2Owl(); OWLOntology owlOntology = obo2Owl.convert(inputOboDoc); OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); diff --git a/OWLTools-Core/src/test/java/owltools/graph/OWLGraphWrapperTest.java b/OWLTools-Core/src/test/java/owltools/graph/OWLGraphWrapperTest.java index ca91a985a..bf9d4b621 100644 --- a/OWLTools-Core/src/test/java/owltools/graph/OWLGraphWrapperTest.java +++ b/OWLTools-Core/src/test/java/owltools/graph/OWLGraphWrapperTest.java @@ -12,7 +12,7 @@ import java.util.Set; import org.junit.Test; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatConstants.OboFormatTag; import org.obolibrary.oboformat.parser.OBOFormatParser; @@ -161,7 +161,7 @@ public void testSubset() throws Exception { private OWLGraphWrapper getOBO2OWLOntologyWrapper(String file) throws Exception{ OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(new BufferedReader(new FileReader(getResource(file)))); - Obo2Owl bridge = new Obo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); OWLOntology ontology = bridge.convert(obodoc); OWLGraphWrapper wrapper = new OWLGraphWrapper(ontology); return wrapper; diff --git a/OWLTools-Core/src/test/java/owltools/graph/RetrieveRelationByLabelTest.java b/OWLTools-Core/src/test/java/owltools/graph/RetrieveRelationByLabelTest.java index 5679a21d0..fc2e6b825 100644 --- a/OWLTools-Core/src/test/java/owltools/graph/RetrieveRelationByLabelTest.java +++ b/OWLTools-Core/src/test/java/owltools/graph/RetrieveRelationByLabelTest.java @@ -6,7 +6,7 @@ import java.io.FileReader; import org.junit.Test; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; import org.semanticweb.owlapi.model.OWLObject; @@ -55,7 +55,7 @@ public void getRelationById() throws Exception { private OWLGraphWrapper getOBO2OWLOntologyWrapper(String file) throws Exception{ OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(new BufferedReader(new FileReader(getResource(file)))); - Obo2Owl bridge = new Obo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); OWLOntology ontology = bridge.convert(obodoc); OWLGraphWrapper wrapper = new OWLGraphWrapper(ontology); return wrapper; diff --git a/OWLTools-Core/src/test/java/owltools/io/OWLGsonRendererTest.java b/OWLTools-Core/src/test/java/owltools/io/OWLGsonRendererTest.java index e8a451e32..4e041904d 100644 --- a/OWLTools-Core/src/test/java/owltools/io/OWLGsonRendererTest.java +++ b/OWLTools-Core/src/test/java/owltools/io/OWLGsonRendererTest.java @@ -9,7 +9,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; import org.semanticweb.owlapi.model.OWLAxiom; @@ -77,7 +77,7 @@ public void testOnt() throws Exception{ private OWLGraphWrapper getOBO2OWLOntologyWrapper(String file) throws Exception{ OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(new BufferedReader(new FileReader(getResource(file)))); - Obo2Owl bridge = new Obo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); OWLOntology ontology = bridge.convert(obodoc); OWLGraphWrapper wrapper = new OWLGraphWrapper(ontology); return wrapper; diff --git a/OWLTools-Core/src/test/java/owltools/io/StanzaToOWLConverterTest.java b/OWLTools-Core/src/test/java/owltools/io/StanzaToOWLConverterTest.java index 635854e80..e2af85ea0 100644 --- a/OWLTools-Core/src/test/java/owltools/io/StanzaToOWLConverterTest.java +++ b/OWLTools-Core/src/test/java/owltools/io/StanzaToOWLConverterTest.java @@ -7,7 +7,7 @@ import java.io.FileReader; import org.junit.Test; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; import org.semanticweb.owlapi.model.OWLAxiom; @@ -39,7 +39,7 @@ public void testConvert() throws Exception{ private OWLGraphWrapper getOBO2OWLOntologyWrapper(String file) throws Exception{ OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(new BufferedReader(new FileReader(getResource(file)))); - Obo2Owl bridge = new Obo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); OWLOntology ontology = bridge.convert(obodoc); OWLGraphWrapper wrapper = new OWLGraphWrapper(ontology); return wrapper; diff --git a/OWLTools-NCBI/src/main/java/owltools/ncbi/NCBIOWL.java b/OWLTools-NCBI/src/main/java/owltools/ncbi/NCBIOWL.java index beb2b66ad..27fb0a1a7 100644 --- a/OWLTools-NCBI/src/main/java/owltools/ncbi/NCBIOWL.java +++ b/OWLTools-NCBI/src/main/java/owltools/ncbi/NCBIOWL.java @@ -7,7 +7,7 @@ import org.apache.log4j.Logger; import org.obolibrary.obo2owl.Obo2OWLConstants.Obo2OWLVocabulary; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.oboformat.parser.OBOFormatConstants.OboFormatTag; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.model.IRI; @@ -212,7 +212,7 @@ public static OWLOntology createOWLOntology() * @see NCBIOWL#addAltId(OWLOntology, String, String, OWLAnnotationProperty) */ public static OWLAnnotationProperty setupAltIdProperty(OWLOntology ontology) { - IRI iri = Obo2Owl.trTagToIRI(OboFormatTag.TAG_ALT_ID.getTag()); + IRI iri = OWLAPIObo2Owl.trTagToIRI(OboFormatTag.TAG_ALT_ID.getTag()); OWLAnnotationProperty ap = createAnnotationProperty(ontology, iri); OWLAnnotationProperty prop = dataFactory.getRDFSLabel(); OWLLiteral value = dataFactory.getOWLLiteral(Obo2OWLVocabulary.hasAlternativeId.getLabel()); diff --git a/OWLTools-NCBI/src/main/java/owltools/ncbi/OWLConverter.java b/OWLTools-NCBI/src/main/java/owltools/ncbi/OWLConverter.java index 8d887ca2d..27d2a91c3 100644 --- a/OWLTools-NCBI/src/main/java/owltools/ncbi/OWLConverter.java +++ b/OWLTools-NCBI/src/main/java/owltools/ncbi/OWLConverter.java @@ -139,7 +139,7 @@ protected static OWLAnnotationProperty createAnnotationProperty( * * @see org.obolibrary.obo2owl.Obo2OWLConstants.Obo2OWLVocabulary * @param ontology the current ontology - * @param term the Obo2Owl term to use + * @param term the OWLAPIObo2Owl term to use * @return the annotation property */ protected static OWLAnnotationProperty createAnnotationProperty( diff --git a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java index f7a258ee0..b20f91e3a 100644 --- a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java +++ b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java @@ -5,7 +5,7 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.PropertyHelper; import org.apache.tools.ant.Task; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.model.OWLOntology; @@ -30,7 +30,7 @@ public String getFile(){ private OWLOntology getOntology() throws Exception{ if(ontologyLocation.endsWith(".owl")){ - //oborelease.isObo2Owl + //oborelease.isOWLAPIObo2Owl addProperty("oborelease.isowl", "true"); OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); return manager.loadOntologyFromOntologyDocument(new File(ontologyLocation)); @@ -38,7 +38,7 @@ private OWLOntology getOntology() throws Exception{ addProperty("oborelease.isobo", "true"); - Obo2Owl obo2owl = new Obo2Owl(); + OWLAPIObo2Owl obo2owl = new OWLAPIObo2Owl(); return obo2owl.convert(ontologyLocation); } diff --git a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java index 59eb0c0a1..03be7bb43 100644 --- a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java +++ b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java @@ -22,7 +22,7 @@ import org.obolibrary.macro.MacroExpansionVisitor; import org.obolibrary.obo2owl.OWLAPIOwl2Obo; import org.obolibrary.obo2owl.Obo2OWLConstants; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.obo2owl.OboInOwlCardinalityTools; import org.obolibrary.obo2owl.OboInOwlCardinalityTools.AnnotationCardinalityException; import org.obolibrary.obo2owl.OWLAPIOwl2Obo; @@ -730,7 +730,7 @@ private boolean createRelease(Vector allPaths) throws IOException, for (OBODoc tdoc : parser.getOBOdoc().getImportedOBODocs()) { String tOntId = tdoc.getHeaderFrame().getClause(OboFormatTag.TAG_ONTOLOGY).getValue().toString(); logInfo("Generating bridge ontology:"+tOntId); - Obo2Owl obo2owl = new Obo2Owl(); + OWLAPIObo2Owl obo2owl = new OWLAPIObo2Owl(); OWLOntology tOnt = obo2owl.convert(tdoc); saveOntologyInAllFormats(ontologyId, tOntId, version, tOnt, null, true); } diff --git a/OWLTools-Sim/src/main/java/owltools/sim2/OwlSimUtil.java b/OWLTools-Sim/src/main/java/owltools/sim2/OwlSimUtil.java index 396f8f07e..a7a1dae4e 100644 --- a/OWLTools-Sim/src/main/java/owltools/sim2/OwlSimUtil.java +++ b/OWLTools-Sim/src/main/java/owltools/sim2/OwlSimUtil.java @@ -8,7 +8,7 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.math.MathException; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; import org.obolibrary.oboformat.parser.OBOFormatParserException; @@ -94,7 +94,7 @@ public static OwlSim createOwlSimFromOntologyFile(File file) throws OWLOntologyC if (file.getPath().endsWith(".obo")) { OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(file); - Obo2Owl bridge = new Obo2Owl(m); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(m); ont = bridge.convert(obodoc); } else { diff --git a/OWLTools-Solr/src/test/java/owltools/flex/FlexTest.java b/OWLTools-Solr/src/test/java/owltools/flex/FlexTest.java index 762ba7068..ab5c298be 100644 --- a/OWLTools-Solr/src/test/java/owltools/flex/FlexTest.java +++ b/OWLTools-Solr/src/test/java/owltools/flex/FlexTest.java @@ -13,7 +13,7 @@ import java.util.Set; import org.junit.Test; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; import org.obolibrary.oboformat.parser.OBOFormatParserException; @@ -39,7 +39,7 @@ public void testFlexReflectionLoading() throws IOException, OWLOntologyCreationE OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(fstr); - Obo2Owl bridge = new Obo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); OWLOntology ont = bridge.convert(obodoc); OWLGraphWrapper g = new OWLGraphWrapper(ont); diff --git a/OWLTools-Solr/src/test/java/owltools/flex/OWLGraphFlexTest.java b/OWLTools-Solr/src/test/java/owltools/flex/OWLGraphFlexTest.java index c65b04aa4..99769a465 100644 --- a/OWLTools-Solr/src/test/java/owltools/flex/OWLGraphFlexTest.java +++ b/OWLTools-Solr/src/test/java/owltools/flex/OWLGraphFlexTest.java @@ -7,7 +7,7 @@ import org.apache.log4j.Logger; import org.junit.Test; -import org.obolibrary.obo2owl.Obo2Owl; +import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; import org.semanticweb.owlapi.model.OWLObject; @@ -29,7 +29,7 @@ public class OWLGraphFlexTest { // String fstr = getResourceString("trivial.obo"); // OBOFormatParser p = new OBOFormatParser(); // OBODoc obodoc = p.parse(fstr); -// Obo2Owl bridge = new Obo2Owl(); +// OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); // OWLOntology ont = bridge.convert(obodoc); // OWLGraphWrapper g = new OWLGraphWrapper(ont); // @@ -88,7 +88,7 @@ public void testFlexClosures() throws Exception{ String fstr = getResourceString("trivial.obo"); OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(fstr); - Obo2Owl bridge = new Obo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); OWLOntology ont = bridge.convert(obodoc); OWLGraphWrapper g = new OWLGraphWrapper(ont); From d0a07019cc2661f2df6454d5803f18e3771da829 Mon Sep 17 00:00:00 2001 From: Chris Mungall Date: Mon, 6 Mar 2017 19:00:30 -0800 Subject: [PATCH 4/7] fixing signature --- OWLTools-Core/src/main/java/owltools/io/ParserWrapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OWLTools-Core/src/main/java/owltools/io/ParserWrapper.java b/OWLTools-Core/src/main/java/owltools/io/ParserWrapper.java index d5fc0fd83..afb68bb86 100644 --- a/OWLTools-Core/src/main/java/owltools/io/ParserWrapper.java +++ b/OWLTools-Core/src/main/java/owltools/io/ParserWrapper.java @@ -228,7 +228,7 @@ public void saveOWL(OWLOntology ont, OWLDocumentFormat owlFormat, // special work-around for skipping the OBO validation before write // see also OWL-API issue: https://github.com/owlcs/owlapi/issues/290 // see also saveOWL(OWLOntology, OWLOntologyFormat, String) for redundant code - OWLAPIOwl2Obo bridge = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo bridge = new OWLAPIOwl2Obo(manager); OBODoc doc; BufferedWriter bw = null; try { From 011d777ebb6caae7c097991503f06ebe77070464 Mon Sep 17 00:00:00 2001 From: Chris Mungall Date: Mon, 6 Mar 2017 19:00:43 -0800 Subject: [PATCH 5/7] removing file accidentally added to this branch --- .../owltools/reasoner/AxiomJengaTest.java | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 OWLTools-Core/src/test/java/owltools/reasoner/AxiomJengaTest.java diff --git a/OWLTools-Core/src/test/java/owltools/reasoner/AxiomJengaTest.java b/OWLTools-Core/src/test/java/owltools/reasoner/AxiomJengaTest.java deleted file mode 100644 index 62f62c01c..000000000 --- a/OWLTools-Core/src/test/java/owltools/reasoner/AxiomJengaTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package owltools.reasoner; - -import static org.junit.Assert.*; - -import java.io.IOException; - -import org.junit.Test; -import org.obolibrary.oboformat.parser.OBOFormatParserException; -import org.semanticweb.elk.owlapi.ElkReasonerFactory; -import org.semanticweb.owlapi.model.OWLOntology; -import org.semanticweb.owlapi.model.OWLOntologyCreationException; -import org.semanticweb.owlapi.reasoner.OWLReasoner; - -import owltools.graph.OWLGraphWrapper; - -public class AxiomJengaTest extends AbstractReasonerTest { - - @Test - public void testNoReplace() throws OBOFormatParserException, OWLOntologyCreationException, IOException { - OWLGraphWrapper g = getOntologyWrapper("jenga.obo"); - OWLOntology ontology = g.getSourceOntology(); - ElkReasonerFactory rf = new ElkReasonerFactory(); - OWLReasoner reasoner = rf.createReasoner(ontology); - JengaTower jt = AxiomJenga.makeJengaTower(ontology, reasoner, false); - System.out.println(jt); - assertTrue(jt.maxJenga == 8); - } - - @Test - public void testWithReplace() throws OBOFormatParserException, OWLOntologyCreationException, IOException { - OWLGraphWrapper g = getOntologyWrapper("jenga.obo"); - OWLOntology ontology = g.getSourceOntology(); - ElkReasonerFactory rf = new ElkReasonerFactory(); - OWLReasoner reasoner = rf.createReasoner(ontology); - JengaTower jt = AxiomJenga.makeJengaTower(ontology, reasoner, true); - System.out.println(jt); - assertTrue(jt.maxJenga == 0); - - } - - @Test - public void testNoReplaceLogDef() throws OBOFormatParserException, OWLOntologyCreationException, IOException { - OWLGraphWrapper g = getOntologyWrapper("jenga_ld.obo"); - OWLOntology ontology = g.getSourceOntology(); - ElkReasonerFactory rf = new ElkReasonerFactory(); - OWLReasoner reasoner = rf.createReasoner(ontology); - JengaTower jt = AxiomJenga.makeJengaTower(ontology, reasoner, false); - System.out.println(jt); - //assertTrue(jt.maxJenga == 0); - - } - -} From 7a739947b2e9b8f2c821464fecbabb824883a8bc Mon Sep 17 00:00:00 2001 From: Chris Mungall Date: Mon, 6 Mar 2017 19:06:26 -0800 Subject: [PATCH 6/7] signatures --- .../src/test/java/owltools/io/OWLGsonRendererTest.java | 5 ++++- .../java/owltools/mooncat/ImportPropertyMooncatTest.java | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OWLTools-Core/src/test/java/owltools/io/OWLGsonRendererTest.java b/OWLTools-Core/src/test/java/owltools/io/OWLGsonRendererTest.java index 4e041904d..0de3f36a3 100644 --- a/OWLTools-Core/src/test/java/owltools/io/OWLGsonRendererTest.java +++ b/OWLTools-Core/src/test/java/owltools/io/OWLGsonRendererTest.java @@ -12,10 +12,13 @@ import org.obolibrary.obo2owl.OWLAPIObo2Owl; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatParser; +import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.model.OWLAxiom; import org.semanticweb.owlapi.model.OWLClass; import org.semanticweb.owlapi.model.OWLDocumentFormat; import org.semanticweb.owlapi.model.OWLOntology; +import org.semanticweb.owlapi.model.OWLOntologyManager; +import org.semanticweb.owlapi.model.OWLOntologyManagerFactory; import owltools.OWLToolsTestBasics; import owltools.graph.OWLGraphEdge; @@ -77,7 +80,7 @@ public void testOnt() throws Exception{ private OWLGraphWrapper getOBO2OWLOntologyWrapper(String file) throws Exception{ OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(new BufferedReader(new FileReader(getResource(file)))); - OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager()); OWLOntology ontology = bridge.convert(obodoc); OWLGraphWrapper wrapper = new OWLGraphWrapper(ontology); return wrapper; diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java index 848a6a275..236ecf0ef 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java @@ -11,6 +11,7 @@ import org.obolibrary.oboformat.model.Frame; import org.obolibrary.oboformat.model.OBODoc; import org.obolibrary.oboformat.parser.OBOFormatConstants.OboFormatTag; +import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.model.OWLOntology; import owltools.OWLToolsTestBasics; @@ -92,7 +93,7 @@ public void testImportProperties2() throws Exception { OWLOntology sourceOntology = g.getSourceOntology(); OboInOwlCardinalityTools.checkAnnotationCardinality(sourceOntology); - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager()); OBODoc oboDoc = owl2Obo.convert(sourceOntology); if (RENDER_ONTOLOGY_FLAG) { renderOBO(oboDoc); From 1242826866cc9ec559a7aa3008fdeb717896d2ec Mon Sep 17 00:00:00 2001 From: Chris Mungall Date: Mon, 6 Mar 2017 19:33:38 -0800 Subject: [PATCH 7/7] signatures --- OWLTools-Core/src/test/java/owltools/TaxonGraphTest.java | 2 +- .../test/java/owltools/graph/AxiomAnnotationToolsTest.java | 4 ++-- .../java/owltools/graph/CardinalityContraintsToolsTest.java | 2 +- .../src/test/java/owltools/graph/OWLGraphWrapperTest.java | 2 +- .../java/owltools/graph/RetrieveRelationByLabelTest.java | 2 +- .../src/test/java/owltools/io/StanzaToOWLConverterTest.java | 2 +- .../mooncat/CardinalityCheckAndRepairMooncatTest.java | 2 +- .../java/owltools/mooncat/ImportPropertyMooncatTest.java | 2 +- .../java/owltools/mooncat/QuerySubsetGeneratorTest.java | 2 +- .../test/java/owltools/mooncat/RemoveDirectivesTest.java | 2 +- .../test/java/owltools/mooncat/SubsetDefMooncatTest.java | 2 +- .../src/main/java/owltools/cli/AssertInferenceTool.java | 2 +- .../main/java/owltools/ontologyrelease/GetOntologyId.java | 2 +- .../owltools/ontologyrelease/OboOntologyReleaseRunner.java | 4 ++-- .../java/owltools/ontologyrelease/OortReasonerTest.java | 2 +- .../src/main/java/owltools/cli/CommandRunner.java | 6 +++--- OWLTools-Solr/src/test/java/owltools/flex/FlexTest.java | 2 +- .../src/test/java/owltools/flex/OWLGraphFlexTest.java | 4 ++-- 18 files changed, 23 insertions(+), 23 deletions(-) diff --git a/OWLTools-Core/src/test/java/owltools/TaxonGraphTest.java b/OWLTools-Core/src/test/java/owltools/TaxonGraphTest.java index c2b2bfd97..731567915 100644 --- a/OWLTools-Core/src/test/java/owltools/TaxonGraphTest.java +++ b/OWLTools-Core/src/test/java/owltools/TaxonGraphTest.java @@ -33,7 +33,7 @@ public void before() throws Exception { files.add(getResource("taxon_union_terms.obo").getAbsolutePath()); OBOFormatParser p = new OBOFormatParser(); - OWLAPIObo2Owl obo2Owl = new OWLAPIObo2Owl(); + OWLAPIObo2Owl obo2Owl = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager() ); OBODoc merged = null; for(String file : files) { OBODoc oboDoc = p.parse(file); diff --git a/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java b/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java index bb4e5748e..2c8c38cda 100644 --- a/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java +++ b/OWLTools-Core/src/test/java/owltools/graph/AxiomAnnotationToolsTest.java @@ -32,9 +32,9 @@ public void testReduceAxiomAnnotationsToOboBasicOWLOntology() throws Exception { OBOFormatParser p = new OBOFormatParser(); OBODoc inputOboDoc = p.parse(inputFile); - OWLAPIObo2Owl obo2Owl = new OWLAPIObo2Owl(); + OWLAPIObo2Owl obo2Owl = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager() ); OWLOntology owlOntology = obo2Owl.convert(inputOboDoc); - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); // check round-trip first before removing equals(inputFile, owl2Obo.convert(owlOntology)); diff --git a/OWLTools-Core/src/test/java/owltools/graph/CardinalityContraintsToolsTest.java b/OWLTools-Core/src/test/java/owltools/graph/CardinalityContraintsToolsTest.java index 2e434dddc..3e6b52ace 100644 --- a/OWLTools-Core/src/test/java/owltools/graph/CardinalityContraintsToolsTest.java +++ b/OWLTools-Core/src/test/java/owltools/graph/CardinalityContraintsToolsTest.java @@ -27,7 +27,7 @@ public void testRemoveCardinalityConstraints() throws Exception { OWLOntology owlOntology = graph.getSourceOntology(); CardinalityContraintsTools.removeCardinalityConstraints(owlOntology); - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc obo = owl2Obo.convert(owlOntology); assertNoQualifiers("TEST:1000", obo); diff --git a/OWLTools-Core/src/test/java/owltools/graph/OWLGraphWrapperTest.java b/OWLTools-Core/src/test/java/owltools/graph/OWLGraphWrapperTest.java index bf9d4b621..c85e04456 100644 --- a/OWLTools-Core/src/test/java/owltools/graph/OWLGraphWrapperTest.java +++ b/OWLTools-Core/src/test/java/owltools/graph/OWLGraphWrapperTest.java @@ -161,7 +161,7 @@ public void testSubset() throws Exception { private OWLGraphWrapper getOBO2OWLOntologyWrapper(String file) throws Exception{ OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(new BufferedReader(new FileReader(getResource(file)))); - OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager() ); OWLOntology ontology = bridge.convert(obodoc); OWLGraphWrapper wrapper = new OWLGraphWrapper(ontology); return wrapper; diff --git a/OWLTools-Core/src/test/java/owltools/graph/RetrieveRelationByLabelTest.java b/OWLTools-Core/src/test/java/owltools/graph/RetrieveRelationByLabelTest.java index fc2e6b825..9b64cb02c 100644 --- a/OWLTools-Core/src/test/java/owltools/graph/RetrieveRelationByLabelTest.java +++ b/OWLTools-Core/src/test/java/owltools/graph/RetrieveRelationByLabelTest.java @@ -55,7 +55,7 @@ public void getRelationById() throws Exception { private OWLGraphWrapper getOBO2OWLOntologyWrapper(String file) throws Exception{ OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(new BufferedReader(new FileReader(getResource(file)))); - OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager() ); OWLOntology ontology = bridge.convert(obodoc); OWLGraphWrapper wrapper = new OWLGraphWrapper(ontology); return wrapper; diff --git a/OWLTools-Core/src/test/java/owltools/io/StanzaToOWLConverterTest.java b/OWLTools-Core/src/test/java/owltools/io/StanzaToOWLConverterTest.java index e2af85ea0..4af483874 100644 --- a/OWLTools-Core/src/test/java/owltools/io/StanzaToOWLConverterTest.java +++ b/OWLTools-Core/src/test/java/owltools/io/StanzaToOWLConverterTest.java @@ -39,7 +39,7 @@ public void testConvert() throws Exception{ private OWLGraphWrapper getOBO2OWLOntologyWrapper(String file) throws Exception{ OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(new BufferedReader(new FileReader(getResource(file)))); - OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager() ); OWLOntology ontology = bridge.convert(obodoc); OWLGraphWrapper wrapper = new OWLGraphWrapper(ontology); return wrapper; diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/CardinalityCheckAndRepairMooncatTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/CardinalityCheckAndRepairMooncatTest.java index b41b9484f..41df7bf79 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/CardinalityCheckAndRepairMooncatTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/CardinalityCheckAndRepairMooncatTest.java @@ -46,7 +46,7 @@ public void testMireot() throws Exception { OWLOntology sourceOntology = g.getSourceOntology(); OboInOwlCardinalityTools.checkAnnotationCardinality(sourceOntology); - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc oboDoc = owl2Obo.convert(sourceOntology); if (RENDER_ONTOLOGY_FLAG) { renderOBO(oboDoc); diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java index 236ecf0ef..c40dfff63 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/ImportPropertyMooncatTest.java @@ -47,7 +47,7 @@ public void testImportProperties() throws Exception { OWLOntology sourceOntology = g.getSourceOntology(); OboInOwlCardinalityTools.checkAnnotationCardinality(sourceOntology); - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc oboDoc = owl2Obo.convert(sourceOntology); if (RENDER_ONTOLOGY_FLAG) { renderOBO(oboDoc); diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/QuerySubsetGeneratorTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/QuerySubsetGeneratorTest.java index de9835a82..06ef61fdf 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/QuerySubsetGeneratorTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/QuerySubsetGeneratorTest.java @@ -60,7 +60,7 @@ public void testCreateSubOntologyFromDLQuery() throws Exception { Set toMerge = sourceGraph.getAllOntologies(); generator.createSubOntologyFromDLQuery(dlQueryString, sourceGraph, targetGraph, reasonerFactory, toMerge); - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc oboDoc = owl2Obo.convert(targetGraph.getSourceOntology()); if (renderObo) { renderOBO(oboDoc); diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/RemoveDirectivesTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/RemoveDirectivesTest.java index ea077c8f9..6c6de5bab 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/RemoveDirectivesTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/RemoveDirectivesTest.java @@ -45,7 +45,7 @@ public void testRemove() throws Exception { System.out.println(merged.getAxioms(AxiomType.EQUIVALENT_CLASSES)); - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc mergedObo = owl2Obo.convert(merged); if (USE_SYSTEM_OUT) { diff --git a/OWLTools-Core/src/test/java/owltools/mooncat/SubsetDefMooncatTest.java b/OWLTools-Core/src/test/java/owltools/mooncat/SubsetDefMooncatTest.java index 1fd9f09aa..2db0439da 100644 --- a/OWLTools-Core/src/test/java/owltools/mooncat/SubsetDefMooncatTest.java +++ b/OWLTools-Core/src/test/java/owltools/mooncat/SubsetDefMooncatTest.java @@ -47,7 +47,7 @@ public void testImportProperties2() throws Exception { OWLOntology sourceOntology = g.getSourceOntology(); OboInOwlCardinalityTools.checkAnnotationCardinality(sourceOntology); - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc oboDoc = owl2Obo.convert(sourceOntology); if (RENDER_ONTOLOGY_FLAG) { renderOBO(oboDoc); diff --git a/OWLTools-Oort/src/main/java/owltools/cli/AssertInferenceTool.java b/OWLTools-Oort/src/main/java/owltools/cli/AssertInferenceTool.java index 5e515a8ae..482599a5e 100644 --- a/OWLTools-Oort/src/main/java/owltools/cli/AssertInferenceTool.java +++ b/OWLTools-Oort/src/main/java/owltools/cli/AssertInferenceTool.java @@ -329,7 +329,7 @@ static void writeOntologyFile(OWLOntology ontology, OWLGraphWrapper graph, Strin if ("obo".equals(outputFileFormat)) { BufferedWriter bufferedWriter = null; try { - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc oboDoc = owl2Obo.convert(ontology); OBOFormatWriter oboWriter = new OBOFormatWriter(); bufferedWriter = new BufferedWriter(new FileWriter(outputFile)); diff --git a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java index b20f91e3a..39bf40553 100644 --- a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java +++ b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/GetOntologyId.java @@ -38,7 +38,7 @@ private OWLOntology getOntology() throws Exception{ addProperty("oborelease.isobo", "true"); - OWLAPIObo2Owl obo2owl = new OWLAPIObo2Owl(); + OWLAPIObo2Owl obo2owl = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager() ); return obo2owl.convert(ontologyLocation); } diff --git a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java index 03be7bb43..f22d6b5af 100644 --- a/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java +++ b/OWLTools-Oort/src/main/java/owltools/ontologyrelease/OboOntologyReleaseRunner.java @@ -730,7 +730,7 @@ private boolean createRelease(Vector allPaths) throws IOException, for (OBODoc tdoc : parser.getOBOdoc().getImportedOBODocs()) { String tOntId = tdoc.getHeaderFrame().getClause(OboFormatTag.TAG_ONTOLOGY).getValue().toString(); logInfo("Generating bridge ontology:"+tOntId); - OWLAPIObo2Owl obo2owl = new OWLAPIObo2Owl(); + OWLAPIObo2Owl obo2owl = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager() ); OWLOntology tOnt = obo2owl.convert(tdoc); saveOntologyInAllFormats(ontologyId, tOntId, version, tOnt, null, true); } @@ -1712,7 +1712,7 @@ private void saveOntologyInAllFormats(String idspace, String fileNameBase, Strin if (!oortConfig.isSkipFormat("obo")) { - OWLAPIOwl2Obo owl2obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc doc = owl2obo.convert(ontologyToSave); OBOFormatWriter writer = new OBOFormatWriter(); diff --git a/OWLTools-Oort/src/test/java/owltools/ontologyrelease/OortReasonerTest.java b/OWLTools-Oort/src/test/java/owltools/ontologyrelease/OortReasonerTest.java index 595a8931f..c07cdfc7e 100644 --- a/OWLTools-Oort/src/test/java/owltools/ontologyrelease/OortReasonerTest.java +++ b/OWLTools-Oort/src/test/java/owltools/ontologyrelease/OortReasonerTest.java @@ -53,7 +53,7 @@ public void testIssueTwo() throws Exception { for(OWLAxiom ax : b.getRedundantAxioms()) { graph.getManager().applyChange(new RemoveAxiom(owlOntology, ax)); } - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc oboDoc = owl2Obo.convert(owlOntology); if (renderObo) { diff --git a/OWLTools-Runner/src/main/java/owltools/cli/CommandRunner.java b/OWLTools-Runner/src/main/java/owltools/cli/CommandRunner.java index 5b1b8c672..714babfd5 100644 --- a/OWLTools-Runner/src/main/java/owltools/cli/CommandRunner.java +++ b/OWLTools-Runner/src/main/java/owltools/cli/CommandRunner.java @@ -5663,7 +5663,7 @@ else if (opts.nextEq("-t|--term")) { } // obo if (outputFileObo != null) { - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc doc = owl2Obo.convert(work); OBOFormatWriter writer = new OBOFormatWriter(); @@ -5805,7 +5805,7 @@ else if (oldVersionIRI != null) { } // obo if (outputFileObo != null) { - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc doc = owl2Obo.convert(filtered); OBOFormatWriter writer = new OBOFormatWriter(); @@ -5984,7 +5984,7 @@ else if (opts.nextEq("--iri")) { slim.getOWLOntologyManager().saveOntology(slim, IRI.create(outFile)); } if (outputObo != null) { - OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(); + OWLAPIOwl2Obo owl2Obo = new OWLAPIOwl2Obo(OWLManager.createOWLOntologyManager() ); OBODoc oboDoc = owl2Obo.convert(slim); OBOFormatWriter w = new OBOFormatWriter(); w.write(oboDoc, outputObo); diff --git a/OWLTools-Solr/src/test/java/owltools/flex/FlexTest.java b/OWLTools-Solr/src/test/java/owltools/flex/FlexTest.java index ab5c298be..33e75e40c 100644 --- a/OWLTools-Solr/src/test/java/owltools/flex/FlexTest.java +++ b/OWLTools-Solr/src/test/java/owltools/flex/FlexTest.java @@ -39,7 +39,7 @@ public void testFlexReflectionLoading() throws IOException, OWLOntologyCreationE OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(fstr); - OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager() ); OWLOntology ont = bridge.convert(obodoc); OWLGraphWrapper g = new OWLGraphWrapper(ont); diff --git a/OWLTools-Solr/src/test/java/owltools/flex/OWLGraphFlexTest.java b/OWLTools-Solr/src/test/java/owltools/flex/OWLGraphFlexTest.java index 99769a465..51d728c43 100644 --- a/OWLTools-Solr/src/test/java/owltools/flex/OWLGraphFlexTest.java +++ b/OWLTools-Solr/src/test/java/owltools/flex/OWLGraphFlexTest.java @@ -29,7 +29,7 @@ public class OWLGraphFlexTest { // String fstr = getResourceString("trivial.obo"); // OBOFormatParser p = new OBOFormatParser(); // OBODoc obodoc = p.parse(fstr); -// OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); +// OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager() ); // OWLOntology ont = bridge.convert(obodoc); // OWLGraphWrapper g = new OWLGraphWrapper(ont); // @@ -88,7 +88,7 @@ public void testFlexClosures() throws Exception{ String fstr = getResourceString("trivial.obo"); OBOFormatParser p = new OBOFormatParser(); OBODoc obodoc = p.parse(fstr); - OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(); + OWLAPIObo2Owl bridge = new OWLAPIObo2Owl(OWLManager.createOWLOntologyManager() ); OWLOntology ont = bridge.convert(obodoc); OWLGraphWrapper g = new OWLGraphWrapper(ont);