Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return a more descriptive error when provided mapping file does not exist #54

Closed
DylanVanAssche opened this issue Apr 23, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@DylanVanAssche
Copy link
Contributor

DylanVanAssche commented Apr 23, 2020

Description

RML Mapper crashes with a parsing error for non-existing mapping files:

08:34:42.569 [main] ERROR be.ugent.rml.cli.Main               .main(315) - Unexpected end of file
org.eclipse.rdf4j.rio.RDFParseException: Unexpected end of file
	at org.eclipse.rdf4j.rio.turtle.TurtleParser.throwEOFException(TurtleParser.java:1317)
	at org.eclipse.rdf4j.rio.turtle.TurtleParser.verifyCharacterOrFail(TurtleParser.java:1133)
	at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseQNameOrBoolean(TurtleParser.java:1001)
	at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseValue(TurtleParser.java:578)
	at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseSubject(TurtleParser.java:406)
	at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseTriples(TurtleParser.java:347)
	at org.eclipse.rdf4j.rio.turtle.TurtleParser.parseStatement(TurtleParser.java:216)
	at org.eclipse.rdf4j.rio.turtle.TurtleParser.parse(TurtleParser.java:178)
	at org.eclipse.rdf4j.rio.turtle.TurtleParser.parse(TurtleParser.java:130)
	at be.ugent.rml.store.RDF4JStore.read(RDF4JStore.java:111)
	at be.ugent.rml.cli.Main.main(Main.java:174)
	at be.ugent.rml.cli.Main.main(Main.java:35)

I find it useful to check if the mapping file exists before parsing it. This way, we can return an appropriate error message.

Steps to reproduce

  1. Execute the RML Mapper with -m <mapping file>. The name of the mapping file is a non-existing.
  2. The RML Mapper fails with a Turtle parsing error.

Environment

  • Ubuntu 18.04 LTS
  • OpenJDK 12.0.2 (64 bit)
  • RMLMapper 4.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
2 participants