owlcollab / owltools

OWLTools
BSD 3-Clause "New" or "Revised" License
108 stars 33 forks source link

Fail to extract terms from IAO and ENVO #248

Closed bjonnh closed 6 years ago

bjonnh commented 6 years ago

I'm using the ontology-starter-kit

owltools version https://github.com/owlcollab/owltools/commit/f90176d5849278d8fc01e839e444408c8e9445be)

I'm trying to import the terms: http://purl.obolibrary.org/obo/IAO_0000312 ## publication about an investigation or http://purl.obolibrary.org/obo/ENVO_01000254 ## environmental system http://purl.obolibrary.org/obo/ENVO_01000309 ## cold environment

I added the ontologies in the Makefile, they are downloaded properly, and I got terms extracted properly from chebi and bfo (so it seems to work ok for some ontologies).

Is there a way to avoid the following errors?

Error for IAO

(the owl file can be found here: http://bjonnh.net/share/iao_import.owl)

$ owltools --use-catalog imports/iao_import.owl -o -f obo imports/iao_import.obo

Exception in thread "main" org.semanticweb.owlapi.model.OWLOntologyStorageException: org.obolibrary.oboformat.model.FrameStructureException: multiple def tags not allowed. in frame:Frame(BFO:0000031 id( BFO:0000031)is_a( BFO:0000002)def( b is a generically dependent continuant = Def. b is a continuant that g-depends_on one or more other entities. (axiom label in BFO2 Reference: [074-001]){{http://purl.obolibrary.org/obo/IAO_0010000=http://purl.obolibrary.org/obo/bfo/axiom/074-001} })name( generically dependent continuant)def( A continuant that is dependent on one or other independent continuant bearers. For every instance of A requires some instance of (an independent continuant type) B but which instance of B serves can change from time to time.)) at org.semanticweb.owlapi.oboformat.OBOFormatRenderer.render(OBOFormatRenderer.java:90) at org.semanticweb.owlapi.oboformat.OBOFormatStorer.storeOntology(OBOFormatStorer.java:42) at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:155) at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:119) at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1521) at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1498) at owltools.io.ParserWrapper.saveOWL(ParserWrapper.java:289) at owltools.io.ParserWrapper.saveOWL(ParserWrapper.java:209) at owltools.cli.CommandRunner.runSingleIteration(CommandRunner.java:3549) at owltools.cli.CommandRunnerBase.run(CommandRunnerBase.java:76) at owltools.cli.CommandRunnerBase.run(CommandRunnerBase.java:68) at owltools.cli.CommandLineInterface.main(CommandLineInterface.java:12) Caused by: org.obolibrary.oboformat.model.FrameStructureException: multiple def tags not allowed. in frame:Frame(BFO:0000031 id( BFO:0000031)is_a( BFO:0000002)def( b is a generically dependent continuant = Def. b is a continuant that g-depends_on one or more other entities. (axiom label in BFO2 Reference: [074-001]){{http://purl.obolibrary.org/obo/IAO_0010000=http://purl.obolibrary.org/obo/bfo/axiom/074-001} })name( generically dependent continuant)def( A continuant that is dependent on one or other independent continuant bearers. For every instance of A requires some instance of (an independent continuant type) B but which instance of B serves can change from time to time.)) at org.obolibrary.oboformat.model.Frame.checkMaxOneCardinality(Frame.java:424) at org.obolibrary.oboformat.model.Frame.check(Frame.java:405) at org.obolibrary.oboformat.model.OBODoc.check(OBODoc.java:390) at org.obolibrary.oboformat.writer.OBOFormatWriter.write(OBOFormatWriter.java:189) at org.semanticweb.owlapi.oboformat.OBOFormatRenderer.render(OBOFormatRenderer.java:88) ... 11 more make: *** [Makefile:61: imports/iao_import.obo] Error 1

Error for ENVO

(the owl file can be found here: http://bjonnh.net/share/envo_import.owl)

$ owltools --use-catalog imports/envo_import.owl -o -f obo imports/envo_import.obo Exception in thread "main" org.semanticweb.owlapi.model.OWLOntologyStorageException: org.obolibrary.oboformat.model.FrameStructureException: multiple def tags not allowed. in frame:Frame(BFO:0000020 id( BFO:0000020)def( b is a specifically dependent continuant = Def. b is a continuant & there is some independent continuant c which is not a spatial region and which is such that b s-depends_on c at every time t during the course of b’s existence. (axiom label in BFO2 Reference: [050-003]){{http://purl.obolibrary.org/obo/IAO_0010000=http://purl.obolibrary.org/obo/bfo/axiom/050-003} })def( b is a relational specifically dependent continuant = Def. b is a specifically dependent continuant and there are n > 1 independent continuants c1, … cn which are not spatial regions are such that for all 1 i < j n, ci and cj share no common parts, are such that for each 1 i n, b s-depends_on ci at every time t during the course of b’s existence (axiom label in BFO2 Reference: [131-004]))def( A continuant that inheres in or is borne by other entities. Every instance of A requires some specific instance of B which must always be the same.)name( specifically dependent continuant)is_a( BFO:0000002)) at org.semanticweb.owlapi.oboformat.OBOFormatRenderer.render(OBOFormatRenderer.java:90) at org.semanticweb.owlapi.oboformat.OBOFormatStorer.storeOntology(OBOFormatStorer.java:42) at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:155) at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:119) at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1521) at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1498) at owltools.io.ParserWrapper.saveOWL(ParserWrapper.java:289) at owltools.io.ParserWrapper.saveOWL(ParserWrapper.java:209) at owltools.cli.CommandRunner.runSingleIteration(CommandRunner.java:3549) at owltools.cli.CommandRunnerBase.run(CommandRunnerBase.java:76) at owltools.cli.CommandRunnerBase.run(CommandRunnerBase.java:68) at owltools.cli.CommandLineInterface.main(CommandLineInterface.java:12) Caused by: org.obolibrary.oboformat.model.FrameStructureException: multiple def tags not allowed. in frame:Frame(BFO:0000020 id( BFO:0000020)def( b is a specifically dependent continuant = Def. b is a continuant & there is some independent continuant c which is not a spatial region and which is such that b s-depends_on c at every time t during the course of b’s existence. (axiom label in BFO2 Reference: [050-003]){{http://purl.obolibrary.org/obo/IAO_0010000=http://purl.obolibrary.org/obo/bfo/axiom/050-003} })def( b is a relational specifically dependent continuant = Def. b is a specifically dependent continuant and there are n > 1 independent continuants c1, … cn which are not spatial regions are such that for all 1 i < j n, ci and cj share no common parts, are such that for each 1 i n, b s-depends_on ci at every time t during the course of b’s existence (axiom label in BFO2 Reference: [131-004]))def( A continuant that inheres in or is borne by other entities. Every instance of A requires some specific instance of B which must always be the same.)name( specifically dependent continuant)is_a( BFO:0000002)) at org.obolibrary.oboformat.model.Frame.checkMaxOneCardinality(Frame.java:424) at org.obolibrary.oboformat.model.Frame.check(Frame.java:405) at org.obolibrary.oboformat.model.OBODoc.check(OBODoc.java:390) at org.obolibrary.oboformat.writer.OBOFormatWriter.write(OBOFormatWriter.java:189) at org.semanticweb.owlapi.oboformat.OBOFormatRenderer.render(OBOFormatRenderer.java:88) ... 11 more make: *** [Makefile:61: imports/envo_import.obo] Error 1

bjonnh commented 6 years ago

Maybe OWLAPI is too strict? I sent an issue over there too: https://github.com/owlcs/owlapi/issues/752 From what I understand one definition is a normal definition, the other one is annotated as being an axiom.

cmungall commented 6 years ago

This can be fixed with the --no-check option

owltools --use-catalog imports/iao_import.owl -o -f obo --no-check imports/iao_import.obo

I recommend to switching to robot here. Robot now has the equivalent option: https://github.com/ontodev/robot/issues/64

We'll change the OSK to use the no-strict option by default