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

Sparqlify exits with exit code 0 on Java type conversion error #58

Open
reinvantveer opened this issue Nov 28, 2014 · 1 comment
Open

Comments

@reinvantveer
Copy link

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.

@Aklakan
Copy link
Member

Aklakan commented Nov 28, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants