robot icon indicating copy to clipboard operation
robot copied to clipboard

Does robot fail to error on missing input ontology from -I ?

Open rpgoldman opened this issue 3 years ago • 9 comments

I tried the following test (on the way to trying to figure out how to extract from this ontology):

 $ robot validate-profile --profile DL -I http://identifiers.org/so
OWL 2 DL Profile Report: [Ontology and imports closure in profile]`

I wasn't confident that this was actually working, since I have had trouble with identifiers.org in the past (issues with content negotiation, I believe). So I reran the above command (will attach full logs) with the -vvv option. It looks very much like robot was not able to read the input ontology:

2022-02-08 09:16:46,475 DEBUG org.semanticweb.owlapi.rdf.rdfxml.parser.TripleLogger - Total number of triples: 0
2022-02-08 09:16:46,477 DEBUG org.semanticweb.owlapi.rdf.rdfxml.parser.TripleLogger - Loaded OntologyID(Anonymous-2)

Am I interpreting this correctly? And, if so, would it be reasonable to modify robot to error and ideally, set the POSIX exit code if it fails to retrieve an ontology? I believe that robot does complain if it is unable to read a local ontology file.

rpgoldman avatar Feb 08 '22 15:02 rpgoldman

Full log:

2022-02-08 09:17:30,915 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager
2022-02-08 09:17:30,916 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager
2022-02-08 09:17:30,916 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager
2022-02-08 09:17:30,916 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager
2022-02-08 09:17:30,932 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory
2022-02-08 09:17:30,933 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory
2022-02-08 09:17:30,933 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory
2022-02-08 09:17:30,933 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory
2022-02-08 09:17:31,053 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting object uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl@3a0d172f
2022-02-08 09:17:31,062 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory
2022-02-08 09:17:31,062 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory
2022-02-08 09:17:31,062 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory
2022-02-08 09:17:31,062 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory
2022-02-08 09:17:31,079 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxOntologyParserFactory@6aecbb8d, org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParserFactory@2262b621, org.semanticweb.owlapi.rdf.turtle.parser.TurtleOntologyParserFactory@40cb698e, org.semanticweb.owlapi.rio.RioNTriplesParserFactory@5d2a4eed, org.semanticweb.owlapi.functional.parser.OWLFunctionalSyntaxOWLParserFactory@4d18aa28, org.semanticweb.owlapi.owlxml.parser.OWLXMLParserFactory@6cfcd46d, org.semanticweb.owlapi.rio.RioBinaryRdfParserFactory@55342f40, org.semanticweb.owlapi.rio.RioTurtleParserFactory@3b7ff809, org.semanticweb.owlapi.oboformat.OBOFormatOWLAPIParserFactory@10c626be, org.semanticweb.owlapi.rio.RioNQuadsParserFactory@6da00fb9, org.semanticweb.owlapi.rio.RioTrigParserFactory@320de594, org.semanticweb.owlapi.krss2.parser.KRSS2OWLParserFactory@4c398c80, org.semanticweb.owlapi.rio.RioJsonParserFactory@4212a0c8, org.semanticweb.owlapi.rio.RioRDFXMLParserFactory@488eb7f2, org.semanticweb.owlapi.rio.RioRDFaParserFactory@45e37a7e, org.semanticweb.owlapi.rio.RioTrixParserFactory@686449f9, org.semanticweb.owlapi.rio.RioJsonLDParserFactory@6b44435b, org.semanticweb.owlapi.rio.RioN3ParserFactory@655f7ea]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setOntologyParsers(java.util.Set).
2022-02-08 09:17:31,080 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory
2022-02-08 09:17:31,080 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory
2022-02-08 09:17:31,081 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory
2022-02-08 09:17:31,081 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory
2022-02-08 09:17:31,083 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl@505a9d7c]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setOntologyFactories(java.util.Set).
2022-02-08 09:17:31,083 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory
2022-02-08 09:17:31,083 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory
2022-02-08 09:17:31,084 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory
2022-02-08 09:17:31,084 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/stow/robot/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory
2022-02-08 09:17:31,090 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[org.semanticweb.owlapi.rio.RioJsonStorerFactory@e077866, org.semanticweb.owlapi.functional.renderer.FunctionalSyntaxStorerFactory@2fea7088, org.semanticweb.owlapi.rio.RioNQuadsStorerFactory@2e11485, org.semanticweb.owlapi.oboformat.OBOFormatStorerFactory@13e3c1c7, org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxStorerFactory@3dddefd8, org.semanticweb.owlapi.rio.RioRDFXMLStorerFactory@6f8f9349, org.semanticweb.owlapi.rio.RioTrigStorerFactory@4fbda97b, org.semanticweb.owlapi.rio.RioBinaryRdfStorerFactory@56bca85b, org.semanticweb.owlapi.rio.RioTurtleStorerFactory@41813449, org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLStorerFactory@58ebfd03, org.semanticweb.owlapi.rio.RioJsonLDStorerFactory@726e5805, org.semanticweb.owlapi.manchestersyntax.renderer.ManchesterSyntaxStorerFactory@4cc6fa2a, org.semanticweb.owlapi.latex.renderer.LatexStorerFactory@4bef0fe3, org.semanticweb.owlapi.owlxml.renderer.OWLXMLStorerFactory@dcfda20, org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxHTMLStorerFactory@666b83a4, org.semanticweb.owlapi.krss2.renderer.KRSS2OWLSyntaxStorerFactory@14c01636, org.semanticweb.owlapi.rio.RioN3StorerFactory@a8e6492, org.semanticweb.owlapi.rio.RioTrixStorerFactory@12bcd0c0, org.semanticweb.owlapi.rdf.turtle.renderer.TurtleStorerFactory@75ed9710, org.semanticweb.owlapi.rio.RioNTriplesStorerFactory@5974109]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setOntologyStorers(java.util.Set).
2022-02-08 09:17:31,090 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLOntologyIRIMapper
2022-02-08 09:17:31,090 DEBUG org.semanticweb.owlapi.utilities.Injector - No files found for META-INF/services/org.semanticweb.owlapi.model.OWLOntologyIRIMapper
2022-02-08 09:17:31,090 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setIRIMappers(java.util.Set).
2022-02-08 09:17:32,353 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.semanticweb.owlapi.rio.RioFunctionalSyntaxParserFactory
2022-02-08 09:17:32,354 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.semanticweb.owlapi.rio.RioManchesterSyntaxParserFactory
2022-02-08 09:17:32,354 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.semanticweb.owlapi.rio.RioOWLXMLParserFactory
2022-02-08 09:17:32,354 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.openrdf.rio.binary.BinaryRDFParserFactory
2022-02-08 09:17:32,355 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.openrdf.rio.n3.N3ParserFactory
2022-02-08 09:17:32,355 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.openrdf.rio.nquads.NQuadsParserFactory
2022-02-08 09:17:32,356 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.openrdf.rio.ntriples.NTriplesParserFactory
2022-02-08 09:17:32,356 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.openrdf.rio.rdfjson.RDFJSONParserFactory
2022-02-08 09:17:32,357 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.openrdf.rio.rdfxml.RDFXMLParserFactory
2022-02-08 09:17:32,357 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.openrdf.rio.trix.TriXParserFactory
2022-02-08 09:17:32,358 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.openrdf.rio.turtle.TurtleParserFactory
2022-02-08 09:17:32,358 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.openrdf.rio.trig.TriGParserFactory
2022-02-08 09:17:32,358 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class com.github.jsonldjava.sesame.SesameJSONLDParserFactory
2022-02-08 09:17:32,359 DEBUG org.openrdf.rio.RDFParserRegistry - Registered service class org.semarglproject.sesame.rdf.rdfa.SesameRDFaParserFactory
2022-02-08 09:17:32,365 DEBUG org.openrdf.rio.DatatypeHandlerRegistry - Registered service class org.openrdf.rio.datatypes.XMLSchemaDatatypeHandler
2022-02-08 09:17:32,365 DEBUG org.openrdf.rio.DatatypeHandlerRegistry - Registered service class org.openrdf.rio.datatypes.RDFDatatypeHandler
2022-02-08 09:17:32,366 DEBUG org.openrdf.rio.DatatypeHandlerRegistry - Registered service class org.openrdf.rio.datatypes.DBPediaDatatypeHandler
2022-02-08 09:17:32,366 DEBUG org.openrdf.rio.DatatypeHandlerRegistry - Registered service class org.openrdf.rio.datatypes.VirtuosoGeometryDatatypeHandler
2022-02-08 09:17:32,367 DEBUG org.openrdf.rio.DatatypeHandlerRegistry - Registered service class org.openrdf.rio.datatypes.GeoSPARQLDatatypeHandler
2022-02-08 09:17:32,368 DEBUG org.openrdf.rio.LanguageHandlerRegistry - Registered service class org.openrdf.rio.languages.RFC3066LanguageHandler
2022-02-08 09:17:32,486 DEBUG org.semanticweb.owlapi.rdf.rdfxml.parser.TripleLogger - Total number of triples: 0
2022-02-08 09:17:32,488 DEBUG org.semanticweb.owlapi.rdf.rdfxml.parser.TripleLogger - Loaded OntologyID(Anonymous-2)
2022-02-08 09:17:32,488 DEBUG org.semanticweb.owlapi.rio.RioParserImpl$RioParserRDFHandler - owlParse: timing=5
2022-02-08 09:17:32,488 DEBUG org.semanticweb.owlapi.rio.RioParserImpl - rioParse: timing=120
OWL 2 DL Profile Report: [Ontology and imports closure in profile]

2022-02-08 09:17:32,502 WARN  org.obolibrary.robot.CommandManager - Subcommand Timing: validate-profile took 1.901 seconds

rpgoldman avatar Feb 08 '22 15:02 rpgoldman

Hi @rpgoldman I'm not sure why the OWL API parser is so forgiving here, but you should get the Sequence Ontology (https://obofoundry.org/ontology/so.html) from http://purl.obolibrary.org/obo/so.owl. It seems like identifiers.org should mention this.

balhoff avatar Feb 08 '22 15:02 balhoff

Yes, that is much better!

2022-02-08 09:39:26,293 DEBUG org.semanticweb.owlapi.rdf.rdfxml.parser.TripleLogger - Total number of triples: 45641

I would have expected OWLAPI to be able to punch through a redirection from identifiers.org and use content negotiation to get some form of the ontology that it would be able to process, but I don't understand OWLAPI's functioning.

rpgoldman avatar Feb 08 '22 15:02 rpgoldman

Unfortunately, OWLAPI does not seem to use content negotiation. If content negotiation worked properly, I should be able to just use an unqualified IRI like http://purl.obolibrary.org/obo/so and OWLAPI and the website should figure out how to get a file that OWLAPI can read.

Unfortunately, this does not work: attempting to use that gives me 0 triples again.

This is probably a bug in OWLAPI?

rpgoldman avatar Feb 08 '22 15:02 rpgoldman

I think this may have more to do with the OBO PURL system, which just redirects based on patterns. Any content negotiation would be handled by the ultimate URL target, but typically for OBO ontologies, there is nothing useful returned for URLs like http://purl.obolibrary.org/obo/so. OBO ontology artifacts are usually fully specified down to the file extension. However for individual term IRIs, OntoBee does support content negotiation I think. But any ontology can set a different preferred term browser redirect target.

We've had some discussions about improving the "follow-your-nose" linked data behavior for OBO (cc @cmungall), although I think we do a pretty good job if you keep in mind that term IRIs need have nothing to do with ontology artifact IRIs, and you stick to the ontology artifact PURLs you want to use rather than storing particular download locations.

balhoff avatar Feb 08 '22 16:02 balhoff

I think this may have more to do with the OBO PURL system, which just redirects based on patterns. Any content negotiation would be handled by the ultimate URL target, but typically for OBO ontologies, there is nothing useful returned for URLs like http://purl.obolibrary.org/obo/so. OBO ontology artifacts are usually fully specified down to the file extension. However for individual term IRIs, OntoBee does support content negotiation I think. But any ontology can set a different preferred term browser redirect target.

So, is there some good way to go from the ontology IRI to a URL for importing? I mean given that I see a IRI like http://purl.obolibrary.org/obo/so do I just use trial and error to try to find a workable URL like http://purl.obolibrary.org/obo/so.owl, http://purl.obolibrary.org/obo/so.rdf, etc.?

rpgoldman avatar Feb 08 '22 17:02 rpgoldman

For any OBO ontology {ont}, http://purl.obolibrary.org/obo/{ont}.owl is the canonical ontology IRI and should always be available. However, ontology projects may also provide other artifacts that have axioms filtered in various ways, or other file formats. You can find these in the list of products on each ontology page, e.g., https://obofoundry.org/ontology/so.html.

There's also a machine-readable version of the ontology list metadata at https://obofoundry.org/registry/ontologies.jsonld, linked from the top of the table at https://obofoundry.org.

balhoff avatar Feb 08 '22 18:02 balhoff

Your feedback for the discoverability of all this stuff is very useful! Feel free to join the mailing list at https://groups.google.com/g/obo-discuss or open issues at https://github.com/OBOFoundry/OBOFoundry.github.io/issues.

balhoff avatar Feb 08 '22 18:02 balhoff

Its not entirely inconveivable to use

http://purl.obolibrary.org/obo/{oid}

to redirect by default to, say, the PURL config which contains all the rules for the redirect..

matentzn avatar Feb 08 '22 20:02 matentzn