linkedpipes / etl

LinkedPipes ETL is an RDF based, lightweight ETL tool
https://etl.linkedpipes.com
Other
146 stars 30 forks source link

Class cast exception in SPARQL Update #241

Closed jindrichmynarz closed 7 years ago

jindrichmynarz commented 8 years ago

I have a SPARQL Update that causes class cast exception. This is logged from the executor:

[SPARQL update] ERROR c.l.e.e.e.EventFactory - componentFailed
com.linkedpipes.etl.executor.api.v1.RdfException: Can't execute repository action.
    at com.linkedpipes.etl.executor.api.v1.RdfException.failure(RdfException.java:36) ~[api-executor-v1-0.0.0.jar:na]
    at com.linkedpipes.etl.dataunit.sesame.ExceptionFactory.failure(ExceptionFactory.java:18) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.ActionExecutor.execute(ActionExecutor.java:28) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.SesameDataUnitImpl.execute(SesameDataUnitImpl.java:63) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.SingleGraphDataUnitImpl.execute(SingleGraphDataUnitImpl.java:27) ~[na:na]
    at com.linkedpipes.plugin.transformer.sparql.update.SparqlUpdate.execute(SparqlUpdate.java:47) ~[na:na]
    at com.linkedpipes.etl.component.api.impl.SimpleComponentImpl.execute(SimpleComponentImpl.java:292) ~[na:na]
    at com.linkedpipes.etl.executor.component.ExecuteComponent.run(ExecuteComponent.java:123) ~[executor.jar:na]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.lang.ClassCastException: null

This is a vague exception that doesn't help me diagnose the problem. The SPARQL Update is syntactically valid and is executed successfully in Apache Jena Fuseki.

A pipeline to replicate the issue: Test class cast exception.jsonld.zip

Tested using a33468c29ff03799cf9766355795844d4ead1078.

skodapetr commented 8 years ago

On a33468c29ff03799cf9766355795844d4ead1078

2016-10-08 12:45:13,408 [SPARQL update] WARN  o.o.s.n.NativeStoreConnection - Rolling back transaction due to connection close
java.lang.Throwable: null
    at org.openrdf.sail.helpers.AbstractSailConnection.close(AbstractSailConnection.java:241) [sesame-runtime-osgi-4.0.1-SNAPSHOT-custom.jar:na]
    at org.openrdf.repository.sail.SailRepositoryConnection.close(SailRepositoryConnection.java:206) [sesame-runtime-osgi-4.0.1-SNAPSHOT-custom.jar:na]
    at com.linkedpipes.etl.dataunit.sesame.ActionExecutor.execute(ActionExecutor.java:24) [dataunit-sesame-impl-0.0.0.jar:na]
    at com.linkedpipes.etl.dataunit.sesame.SesameDataUnitImpl.execute(SesameDataUnitImpl.java:63) [dataunit-sesame-impl-0.0.0.jar:na]
    at com.linkedpipes.etl.dataunit.sesame.SingleGraphDataUnitImpl.execute(SingleGraphDataUnitImpl.java:27) [dataunit-sesame-impl-0.0.0.jar:na]
    at com.linkedpipes.plugin.transformer.sparql.update.SparqlUpdate.execute(SparqlUpdate.java:47) [file?iri=http%3A%2F%2Fetl.linkedpipes.com%2Fresources%2Fjars%2Ft-sparqlUpdate%2F0.0.0:na]
    at com.linkedpipes.etl.component.api.impl.SimpleComponentImpl.execute(SimpleComponentImpl.java:292) [api-component-v1-impl-0.0.0.jar:na]
    at com.linkedpipes.etl.executor.component.ExecuteComponent.run(ExecuteComponent.java:123) [classes/:na]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92]
2016-10-08 12:45:13,413 [SPARQL update] ERROR c.l.e.e.e.EventFactory - componentFailed
com.linkedpipes.etl.executor.api.v1.RdfException: Can't execute repository action.
    at com.linkedpipes.etl.executor.api.v1.RdfException.failure(RdfException.java:36) ~[classes/:na]
    at com.linkedpipes.etl.dataunit.sesame.ExceptionFactory.failure(ExceptionFactory.java:18) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.ActionExecutor.execute(ActionExecutor.java:28) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.SesameDataUnitImpl.execute(SesameDataUnitImpl.java:63) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.SingleGraphDataUnitImpl.execute(SingleGraphDataUnitImpl.java:27) ~[na:na]
    at com.linkedpipes.plugin.transformer.sparql.update.SparqlUpdate.execute(SparqlUpdate.java:47) ~[na:na]
    at com.linkedpipes.etl.component.api.impl.SimpleComponentImpl.execute(SimpleComponentImpl.java:292) ~[na:na]
    at com.linkedpipes.etl.executor.component.ExecuteComponent.run(ExecuteComponent.java:123) ~[classes/:na]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92]
Caused by: java.lang.ClassCastException: org.openrdf.sail.nativerdf.model.NativeLiteral cannot be cast to org.openrdf.model.Resource
    at org.openrdf.repository.sail.helpers.SailUpdateExecutor.deleteBoundTriples(SailUpdateExecutor.java:598) ~[sesame-repository-sail-4.0.0.jar:na]
    at org.openrdf.repository.sail.helpers.SailUpdateExecutor.executeModify(SailUpdateExecutor.java:508) ~[sesame-repository-sail-4.0.0.jar:na]
    at org.openrdf.repository.sail.helpers.SailUpdateExecutor.executeUpdate(SailUpdateExecutor.java:134) ~[sesame-repository-sail-4.0.0.jar:na]
    at org.openrdf.repository.sail.SailUpdate.execute(SailUpdate.java:91) ~[sesame-repository-sail-4.0.0.jar:na]
    at com.linkedpipes.plugin.transformer.sparql.update.SparqlUpdate.lambda$execute$1(SparqlUpdate.java:54) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.ActionExecutor.execute(ActionExecutor.java:23) ~[na:na]
    ... 6 common frames omitted

and the component failed message:

ClassCastException : org.openrdf.sail.nativerdf.model.NativeLiteral cannot be cast to org.openrdf.model.Resource

We will re-test this on the demo instance (latest develop) to make sure that it works properly. The core problem is bug in sesame (the same bug is also in RDF4J).

skodapetr commented 8 years ago

@jindrichmynarz Could you please test on the latest develop? The query should fail, but you should get error message like in my previous post.

jindrichmynarz commented 8 years ago

In fd220c82e1a7f49aebece6416c991672bc785e62 running the pipeline produces the following exception from the executor:

[SPARQL update] WARN  o.o.s.n.NativeStoreConnection - Rolling back transaction due to connection close
java.lang.Throwable: null
    at org.openrdf.sail.helpers.AbstractSailConnection.close(AbstractSailConnection.java:241) [sesame-runtime-osgi-4.0.1-SNAPSHOT-custom.jar:na]
    at org.openrdf.repository.sail.SailRepositoryConnection.close(SailRepositoryConnection.java:206) [sesame-runtime-osgi-4.0.1-SNAPSHOT-custom.jar:na]
    at com.linkedpipes.etl.dataunit.sesame.ActionExecutor.execute(ActionExecutor.java:24) [dataunit-sesame-impl-0.0.0.jar:na]
    at com.linkedpipes.etl.dataunit.sesame.SesameDataUnitImpl.execute(SesameDataUnitImpl.java:63) [dataunit-sesame-impl-0.0.0.jar:na]
    at com.linkedpipes.etl.dataunit.sesame.SingleGraphDataUnitImpl.execute(SingleGraphDataUnitImpl.java:27) [dataunit-sesame-impl-0.0.0.jar:na]
    at com.linkedpipes.plugin.transformer.sparql.update.SparqlUpdate.execute(SparqlUpdate.java:47) [file?iri=http%3A%2F%2Fetl.linkedpipes.com%2Fresources%2Fjars%2Ft-sparqlUpdate%2F0.0.0:na]
    at com.linkedpipes.etl.component.api.impl.SimpleComponentImpl.execute(SimpleComponentImpl.java:292) [api-component-v1-impl-0.0.0.jar:na]
    at com.linkedpipes.etl.executor.component.ExecuteComponent.run(ExecuteComponent.java:123) [executor.jar:na]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
[SPARQL update] ERROR c.l.e.e.e.EventFactory - componentFailed
com.linkedpipes.etl.executor.api.v1.RdfException: Can't execute repository action.
    at com.linkedpipes.etl.executor.api.v1.RdfException.failure(RdfException.java:36) ~[api-executor-v1-0.0.0.jar:na]
    at com.linkedpipes.etl.dataunit.sesame.ExceptionFactory.failure(ExceptionFactory.java:18) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.ActionExecutor.execute(ActionExecutor.java:28) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.SesameDataUnitImpl.execute(SesameDataUnitImpl.java:63) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.SingleGraphDataUnitImpl.execute(SingleGraphDataUnitImpl.java:27) ~[na:na]
    at com.linkedpipes.plugin.transformer.sparql.update.SparqlUpdate.execute(SparqlUpdate.java:47) ~[na:na]
    at com.linkedpipes.etl.component.api.impl.SimpleComponentImpl.execute(SimpleComponentImpl.java:292) ~[na:na]
    at com.linkedpipes.etl.executor.component.ExecuteComponent.run(ExecuteComponent.java:123) ~[executor.jar:na]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.lang.ClassCastException: org.openrdf.sail.nativerdf.model.NativeLiteral cannot be cast to org.openrdf.model.Resource
    at org.openrdf.repository.sail.helpers.SailUpdateExecutor.deleteBoundTriples(SailUpdateExecutor.java:598) ~[sesame-repository-sail-4.0.0.jar:na]
    at org.openrdf.repository.sail.helpers.SailUpdateExecutor.executeModify(SailUpdateExecutor.java:508) ~[sesame-repository-sail-4.0.0.jar:na]
    at org.openrdf.repository.sail.helpers.SailUpdateExecutor.executeUpdate(SailUpdateExecutor.java:134) ~[sesame-repository-sail-4.0.0.jar:na]
    at org.openrdf.repository.sail.SailUpdate.execute(SailUpdate.java:91) ~[sesame-repository-sail-4.0.0.jar:na]
    at com.linkedpipes.plugin.transformer.sparql.update.SparqlUpdate.lambda$execute$1(SparqlUpdate.java:54) ~[na:na]
    at com.linkedpipes.etl.dataunit.sesame.ActionExecutor.execute(ActionExecutor.java:23) ~[na:na]
    ... 6 common frames omitted
[SPARQL update] ERROR c.l.e.e.e.EventFactory - executionFailed: Component execution failed.
jindrichmynarz commented 8 years ago

So this bug needs to be fixed in the upstream, i.e. Sesame?

jakubklimek commented 8 years ago

Exactly. And Sesame is not developed anymore after they switched to RDF4J. In RDF4J, they are addressing this issue as we speak, however, switching LP-ETL to RDF4J is again a bigger task (rewriting lots of package names etc.).

jindrichmynarz commented 8 years ago

I see. I assume that you plan to migrate from Sesame to RDF4J eventually, right?

jakubklimek commented 8 years ago

Right.

skodapetr commented 7 years ago

@jindrichmynarz As we are using RDF4J in develop now, this should now be functional.

jindrichmynarz commented 7 years ago

When I re-test the attached pipeline with the develop version 8c0611026b53aa057905a0dd8aa7ad564fa7733e, the execution fails, but no cause is shown in the debug view nor in the executor's log. The #316 might indicate there's some mismatch between the executor and the front-end.

jindrichmynarz commented 7 years ago

The pipeline works in d238bea5b716984d501df9ec4bd1b06250d9073e.