ontodev / robot

ROBOT is an OBO Tool
http://robot.obolibrary.org
BSD 3-Clause "New" or "Revised" License
261 stars 74 forks source link

Template: IRIs, used as IDs, can't end with digits? #782

Closed turbomam closed 3 years ago

turbomam commented 3 years ago

I just reran a workflow that I have been using for many months. ROBOT templating is one part of it.

Here's a made-up example of my template:

class.col source_med_id source_full_name
TYPE ID A http://www.w3.org/2000/01/rdf-schema#label
http://purl.obolibrary.org/obo/PDRO_0000024 http://example.com/resource/1 aspirin
http://purl.obolibrary.org/obo/PDRO_0000024 http://example.com/resource/2 tylenol
http://purl.obolibrary.org/obo/PDRO_0000024 http://example.com/resource/3 lithotabs

Which I would execute with

robot -vvv template  --template numerical_rhs.tsv --output numerical_rhs.ttl

That used to work (v?), but now (ROBOT 1.7.2) I get

2020-12-01 18:02:36,117 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setIRIMappers(java.util.Set). UNKNOWN ENTITY ERROR could not interpret 'http://example.com/resource/1' in row 3, column 2 ("ID") in table "numerical_rhs.tsv". For details see: http://robot.obolibrary.org/template#unknown-entity-error org.obolibrary.robot.exceptions.RowParseException: template#UNKNOWN ENTITY ERROR could not interpret 'http://example.com/resource/1' in row 3, column 2 ("ID") in table "numerical_rhs.tsv". at org.obolibrary.robot.Template.processRow(Template.java:731) at org.obolibrary.robot.Template.generateOutputOntology(Template.java:377) at org.obolibrary.robot.TemplateOperation.template(TemplateOperation.java:184) at org.obolibrary.robot.TemplateCommand.execute(TemplateCommand.java:148) at org.obolibrary.robot.CommandManager.executeCommand(CommandManager.java:248) at org.obolibrary.robot.CommandManager.execute(CommandManager.java:192) at org.obolibrary.robot.CommandManager.main(CommandManager.java:139) at org.obolibrary.robot.CommandLineInterface.main(CommandLineInterface.java:59)

Replacing the terminal digits in the IDs with alphabetical characters solves the problem

class.col source_med_id source_full_name
TYPE ID A http://www.w3.org/2000/01/rdf-schema#label
http://purl.obolibrary.org/obo/PDRO_0000024 http://example.com/resource/one aspirin
http://purl.obolibrary.org/obo/PDRO_0000024 http://example.com/resource/two tylenol
http://purl.obolibrary.org/obo/PDRO_0000024 http://example.com/resource/three lithotabs

Does this seem plausible?

I get the same error when using CURIEs like "mydata:1" and --prefix "mydata: http://example.com/resource/"

But IRIs like http://example.com/resource/1___ are tolerated.

Also, it doesn't appear that the help URL http://robot.obolibrary.org/template#unknown-entity-error resolves to anything beside the top of the template page.

jamesaoverton commented 3 years ago

Thanks for the detailed report @turbomam. I've asked @beckyjackson to look into it.

jamesaoverton commented 3 years ago

@turbomam Can you please test the robot.jar from Becky's PR against your use case:

https://build.obolibrary.io/job/ontodev/job/robot/job/782-fix/

turbomam commented 3 years ago

Yes, thanks. I'll do it before the end of the day.

turbomam commented 3 years ago

Thanks. It doesn't look like that made any difference.

I can email you the first few rows of the template file if that would help. It wouldn't include and PHI, but I err on the side of caution when it comes to pasting that kind of thing into web forms.

(base) ibi-admin-017:pipeline markampa$ robot -version
ROBOT version 1.8.0-SNAPSHOT
(base) ibi-admin-017:pipeline markampa$ robot -vvv template --prefix "xsd: http://www.w3.org/2001/XMLSchema#" --prefix "obo: http://purl.obolibrary.org/obo/"  --prefix  "mydata: http://example.com/resource/" --template build/reference_medications_for_robot.tsv --output build/reference_medications_from_robot.ttl
2020-12-02 17:24:56,694 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager
2020-12-02 17:24:56,694 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager
2020-12-02 17:24:56,694 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager
2020-12-02 17:24:56,694 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager
2020-12-02 17:24:56,708 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory
2020-12-02 17:24:56,708 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory
2020-12-02 17:24:56,708 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory
2020-12-02 17:24:56,708 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory
2020-12-02 17:24:56,914 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting object uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl@16eb3ea3
2020-12-02 17:24:56,920 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory
2020-12-02 17:24:56,920 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory
2020-12-02 17:24:56,921 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory
2020-12-02 17:24:56,921 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory
2020-12-02 17:24:56,933 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[org.semanticweb.owlapi.rio.RioN3ParserFactory@239a307b, org.semanticweb.owlapi.functional.parser.OWLFunctionalSyntaxOWLParserFactory@60f00693, org.semanticweb.owlapi.rio.RioTrixParserFactory@4b8d604b, org.semanticweb.owlapi.rio.RioJsonParserFactory@4e5ed836, org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParserFactory@3932c79a, org.semanticweb.owlapi.rio.RioTrigParserFactory@5b7a7f33, org.semanticweb.owlapi.rio.RioNQuadsParserFactory@5745ca0e, org.semanticweb.owlapi.rio.RioTurtleParserFactory@15888343, org.semanticweb.owlapi.rio.RioRDFXMLParserFactory@26abb146, org.semanticweb.owlapi.owlxml.parser.OWLXMLParserFactory@aba625, org.semanticweb.owlapi.oboformat.OBOFormatOWLAPIParserFactory@821330f, org.semanticweb.owlapi.rio.RioNTriplesParserFactory@15a34df2, org.semanticweb.owlapi.krss2.parser.KRSS2OWLParserFactory@30f842ca, org.semanticweb.owlapi.rio.RioBinaryRdfParserFactory@1a245833, org.semanticweb.owlapi.rio.RioJsonLDParserFactory@5b799640, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxOntologyParserFactory@6a8658ff, org.semanticweb.owlapi.rio.RioRDFaParserFactory@55cb6996, org.semanticweb.owlapi.rdf.turtle.parser.TurtleOntologyParserFactory@25df00a0]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setOntologyParsers(java.util.Set).
2020-12-02 17:24:56,934 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory
2020-12-02 17:24:56,934 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory
2020-12-02 17:24:56,934 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory
2020-12-02 17:24:56,934 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory
2020-12-02 17:24:56,936 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl@28cda624]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setOntologyFactories(java.util.Set).
2020-12-02 17:24:56,936 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory
2020-12-02 17:24:56,936 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory
2020-12-02 17:24:56,936 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory
2020-12-02 17:24:56,936 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory
2020-12-02 17:24:56,941 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[org.semanticweb.owlapi.rio.RioNQuadsStorerFactory@6cd24612, org.semanticweb.owlapi.rio.RioNTriplesStorerFactory@51891008, org.semanticweb.owlapi.owlxml.renderer.OWLXMLStorerFactory@1df8da7a, org.semanticweb.owlapi.rio.RioRDFXMLStorerFactory@d2de489, org.semanticweb.owlapi.rio.RioBinaryRdfStorerFactory@2584b82d, org.semanticweb.owlapi.rdf.turtle.renderer.TurtleStorerFactory@6e2aa843, org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxStorerFactory@49b2a47d, org.semanticweb.owlapi.rio.RioTrigStorerFactory@5a7fe64f, org.semanticweb.owlapi.rio.RioTurtleStorerFactory@7dc19a70, org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLStorerFactory@37313c65, org.semanticweb.owlapi.krss2.renderer.KRSS2OWLSyntaxStorerFactory@49c90a9c, org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxHTMLStorerFactory@565f390, org.semanticweb.owlapi.rio.RioN3StorerFactory@2d0399f4, org.semanticweb.owlapi.manchestersyntax.renderer.ManchesterSyntaxStorerFactory@1f9f6368, org.semanticweb.owlapi.oboformat.OBOFormatStorerFactory@6d5620ce, org.semanticweb.owlapi.rio.RioJsonLDStorerFactory@626abbd0, org.semanticweb.owlapi.functional.renderer.FunctionalSyntaxStorerFactory@660acfb, org.semanticweb.owlapi.rio.RioJsonStorerFactory@3aa078fd, org.semanticweb.owlapi.rio.RioTrixStorerFactory@1b66c0fb, org.semanticweb.owlapi.latex.renderer.LatexStorerFactory@700fb871]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setOntologyStorers(java.util.Set).
2020-12-02 17:24:56,942 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLOntologyIRIMapper
2020-12-02 17:24:56,942 DEBUG org.semanticweb.owlapi.utilities.Injector - No files found for META-INF/services/org.semanticweb.owlapi.model.OWLOntologyIRIMapper
2020-12-02 17:24:56,942 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setIRIMappers(java.util.Set).
2020-12-02 17:24:57,393 ERROR org.obolibrary.robot.IOHelper - Not a valid QName: http://example.com/resource/source_med_id/1
UNKNOWN ENTITY ERROR could not interpret 'http://example.com/resource/source_med_id/1' in row 3, column 2 ("ID") in table "build/reference_medications_for_robot.tsv".
For details see: http://robot.obolibrary.org/template#unknown-entity-error
org.obolibrary.robot.exceptions.RowParseException: template#UNKNOWN ENTITY ERROR could not interpret 'http://example.com/resource/source_med_id/1' in row 3, column 2 ("ID") in table "build/reference_medications_for_robot.tsv".
    at org.obolibrary.robot.Template.processRow(Template.java:731)
    at org.obolibrary.robot.Template.generateOutputOntology(Template.java:377)
    at org.obolibrary.robot.TemplateOperation.template(TemplateOperation.java:184)
    at org.obolibrary.robot.TemplateCommand.execute(TemplateCommand.java:148)
    at org.obolibrary.robot.CommandManager.executeCommand(CommandManager.java:248)
    at org.obolibrary.robot.CommandManager.execute(CommandManager.java:192)
    at org.obolibrary.robot.CommandManager.main(CommandManager.java:139)
    at org.obolibrary.robot.CommandLineInterface.main(CommandLineInterface.java:60)
(base) ibi-admin-017:pipeline markampa$ 
beckyjackson commented 3 years ago

That's odd, I used your example above. Please just email me the template file to make sure I'm getting it right.

On Wed, Dec 2, 2020, 2:27 PM Mark A. Miller notifications@github.com wrote:

Thanks. It doesn't look like that made any difference.

I can email you the first few rows of the template file if that would help. It wouldn't include and PHI, but I err on the side of caution when it comes to pasting that kind of thing into web forms.

(base) ibi-admin-017:pipeline markampa$ robot -version ROBOT version 1.8.0-SNAPSHOT (base) ibi-admin-017:pipeline markampa$ robot -vvv template --prefix "xsd: http://www.w3.org/2001/XMLSchema#" --prefix "obo: http://purl.obolibrary.org/obo/" --prefix "mydata: http://example.com/resource/" --template build/reference_medications_for_robot.tsv --output build/reference_medications_from_robot.ttl 2020-12-02 17:24:56,694 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager 2020-12-02 17:24:56,694 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager 2020-12-02 17:24:56,694 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager 2020-12-02 17:24:56,694 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyManager 2020-12-02 17:24:56,708 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory 2020-12-02 17:24:56,708 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory 2020-12-02 17:24:56,708 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory 2020-12-02 17:24:56,708 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLDataFactory 2020-12-02 17:24:56,914 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting object uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl@16eb3ea3 2020-12-02 17:24:56,920 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory 2020-12-02 17:24:56,920 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory 2020-12-02 17:24:56,921 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory 2020-12-02 17:24:56,921 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.io.OWLParserFactory 2020-12-02 17:24:56,933 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[org.semanticweb.owlapi.rio.RioN3ParserFactory@239a307b, org.semanticweb.owlapi.functional.parser.OWLFunctionalSyntaxOWLParserFactory@60f00693, org.semanticweb.owlapi.rio.RioTrixParserFactory@4b8d604b, org.semanticweb.owlapi.rio.RioJsonParserFactory@4e5ed836, org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParserFactory@3932c79a, org.semanticweb.owlapi.rio.RioTrigParserFactory@5b7a7f33, org.semanticweb.owlapi.rio.RioNQuadsParserFactory@5745ca0e, org.semanticweb.owlapi.rio.RioTurtleParserFactory@15888343, org.semanticweb.owlapi.rio.RioRDFXMLParserFactory@26abb146, org.semanticweb.owlapi.owlxml.parser.OWLXMLParserFactory@aba625, org.semanticweb.owlapi.oboformat.OBOFormatOWLAPIParserFactory@821330f, org.semanticweb.owlapi.rio.RioNTriplesParserFactory@15a34df2, org.semanticweb.owlapi.krss2.parser.KRSS2OWLParserFactory@30f842ca, org.semanticweb.owlapi.rio.RioBinaryRdfParserFactory@1a245833, org.semanticweb.owlapi.rio.RioJsonLDParserFactory@5b799640, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxOntologyParserFactory@6a8658ff, org.semanticweb.owlapi.rio.RioRDFaParserFactory@55cb6996, org.semanticweb.owlapi.rdf.turtle.parser.TurtleOntologyParserFactory@25df00a0]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setOntologyParsers(java.util.Set). 2020-12-02 17:24:56,934 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory 2020-12-02 17:24:56,934 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory 2020-12-02 17:24:56,934 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory 2020-12-02 17:24:56,934 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLOntologyFactory 2020-12-02 17:24:56,936 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl@28cda624]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setOntologyFactories(java.util.Set). 2020-12-02 17:24:56,936 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory 2020-12-02 17:24:56,936 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory 2020-12-02 17:24:56,936 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory 2020-12-02 17:24:56,936 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading URL for service jar:file:/usr/local/bin/robot.jar!/META-INF/services/org.semanticweb.owlapi.model.OWLStorerFactory 2020-12-02 17:24:56,941 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[org.semanticweb.owlapi.rio.RioNQuadsStorerFactory@6cd24612, org.semanticweb.owlapi.rio.RioNTriplesStorerFactory@51891008, org.semanticweb.owlapi.owlxml.renderer.OWLXMLStorerFactory@1df8da7a, org.semanticweb.owlapi.rio.RioRDFXMLStorerFactory@d2de489, org.semanticweb.owlapi.rio.RioBinaryRdfStorerFactory@2584b82d, org.semanticweb.owlapi.rdf.turtle.renderer.TurtleStorerFactory@6e2aa843, org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxStorerFactory@49b2a47d, org.semanticweb.owlapi.rio.RioTrigStorerFactory@5a7fe64f, org.semanticweb.owlapi.rio.RioTurtleStorerFactory@7dc19a70, org.semanticweb.owlapi.rdf.rdfxml.renderer.RDFXMLStorerFactory@37313c65, org.semanticweb.owlapi.krss2.renderer.KRSS2OWLSyntaxStorerFactory@49c90a9c, org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxHTMLStorerFactory@565f390, org.semanticweb.owlapi.rio.RioN3StorerFactory@2d0399f4, org.semanticweb.owlapi.manchestersyntax.renderer.ManchesterSyntaxStorerFactory@1f9f6368, org.semanticweb.owlapi.oboformat.OBOFormatStorerFactory@6d5620ce, org.semanticweb.owlapi.rio.RioJsonLDStorerFactory@626abbd0, org.semanticweb.owlapi.functional.renderer.FunctionalSyntaxStorerFactory@660acfb, org.semanticweb.owlapi.rio.RioJsonStorerFactory@3aa078fd, org.semanticweb.owlapi.rio.RioTrixStorerFactory@1b66c0fb, org.semanticweb.owlapi.latex.renderer.LatexStorerFactory@700fb871]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setOntologyStorers(java.util.Set). 2020-12-02 17:24:56,942 DEBUG org.semanticweb.owlapi.utilities.Injector - Loading file META-INF/services/org.semanticweb.owlapi.model.OWLOntologyIRIMapper 2020-12-02 17:24:56,942 DEBUG org.semanticweb.owlapi.utilities.Injector - No files found for META-INF/services/org.semanticweb.owlapi.model.OWLOntologyIRIMapper 2020-12-02 17:24:56,942 DEBUG org.semanticweb.owlapi.utilities.Injector - Injecting values [[]] on method public void uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.setIRIMappers(java.util.Set). 2020-12-02 17:24:57,393 ERROR org.obolibrary.robot.IOHelper - Not a valid QName: http://example.com/resource/source_med_id/1 UNKNOWN ENTITY ERROR could not interpret 'http://example.com/resource/source_med_id/1' in row 3, column 2 ("ID") in table "build/reference_medications_for_robot.tsv". For details see: http://robot.obolibrary.org/template#unknown-entity-error org.obolibrary.robot.exceptions.RowParseException: template#UNKNOWN ENTITY ERROR could not interpret 'http://example.com/resource/source_med_id/1' in row 3, column 2 ("ID") in table "build/reference_medications_for_robot.tsv". at org.obolibrary.robot.Template.processRow(Template.java:731) at org.obolibrary.robot.Template.generateOutputOntology(Template.java:377) at org.obolibrary.robot.TemplateOperation.template(TemplateOperation.java:184) at org.obolibrary.robot.TemplateCommand.execute(TemplateCommand.java:148) at org.obolibrary.robot.CommandManager.executeCommand(CommandManager.java:248) at org.obolibrary.robot.CommandManager.execute(CommandManager.java:192) at org.obolibrary.robot.CommandManager.main(CommandManager.java:139) at org.obolibrary.robot.CommandLineInterface.main(CommandLineInterface.java:60) (base) ibi-admin-017:pipeline markampa$

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ontodev/robot/issues/782#issuecomment-737533700, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7ZMRSU36HJUGL2EKEMYJLSS25NRANCNFSM4UJV2IHQ .

turbomam commented 3 years ago

@beckyjackson I just emailed sample input to your Gmail account.

The last version of ROBOT that will generate RDF from the sample input seems to be 1.6.0

beckyjackson commented 3 years ago

I think I see the problem. You define a prefixmydata: http://example.com/resource/ and then use terms like: http://example.com/resource/source_med_id/1

This gets converted into mydata:source_med_id/1 which isn't a valid QName because of the dash (even though the full IRI is valid). This is definitely a problem on our end, so I'll try and think of some hack around it 🙂

jamesaoverton commented 3 years ago

QNames vs CURIEs is a big pain. This is my understanding, which may be wrong, and I'd appreciate correction:

mydata:source_med_id/1 includes a / so it is not a valid QName. That means it's illegal in Turtle and probably illegal in SPARQL. It might be a valid CURIE -- I'm not 100% sure. Sometimes the tools support this and sometimes they don't.

ROBOT is stuck in the middle trying to bridge all these tools. We were having trouble with IRI expansions so we changed the code since 1.6.0. This is the first bug we've heard reported. @beckyjackson is trying to relax ROBOT's validation to handle @turbomam's cases, but I'm not sure how far we can go before getting tangled up in other problems.

I guess my preference would be for ROBOT templates to support CURIEs, and not be limited to QNames.

turbomam commented 3 years ago

Thanks for the quick feedback.

I can pursue exclusively using legal, fully qualified IRIs or QNames. I experimented with that a little before I opened this case, but not rigorously.

Any idea why my input worked under ROBOT 1.6.0?

beckyjackson commented 3 years ago

Prior to 1.6.0, we didn't validate QNames - so allowed all sorts of inputs, until we found that ROBOT was allowing some invalid inputs and causing the writers to fail - https://github.com/ontodev/robot/pull/783

jamesaoverton commented 3 years ago

@turbomam Yes, I think your safest option is to use IRIs or QNames throughout.

I'd like to merge #783 and close this issue. We need to think harder about how ROBOT resolves names in various places, but that's a larger question.

Thanks again for the thorough bug report!

turbomam commented 3 years ago

Thanks. Merge/close OK with me.

turbomam commented 3 years ago

I had closed this, but then reopened in case that's required for merging. I'll leave it to @jamesaoverton or @beckyjackson to take the next steps, unless you need some action on my part.