Sparqlify exits with exit code 0 on Java type conversion error
Sparqlify exits with exit code 0, even when Java throws an error due to a conversion error. To reproduce: any text field mapped through ?somevariable = typedLiteral('some text', xsd:double) or ?somevariable = typedLiteral(?mytextfield, xsd:double)
Sparqlify should preferably exit with an error so that scripts can properly handle the exception, such as halt the ingestion of an empty rdf dump file.
Hi Rein, Thanks for the report!
The column types must be compatible to the given xsd types, Should you really need the value as a double, then you would have to do the cast in the SQL: ...
With ?x =(?mydouble, xsd:double)
From [[Select lgd_tryparse_float(mytext) as mydouble]]
whereas lgd_tryparse_float is a helper function that returns NULL when parsing fails (rather than raising an error), defined in this file
Not sure if Postgres in the meantime already provides such a function natively
Anyway, as a TODO I note down, that there should be a validation step after the config file was processed, which checks whether the column types and typed-literal datatypes are actually compatible.