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

Exception when trying to use CSPARQLEngineRSP4J with Jena related objects #13

Open
rahuldh2006 opened this issue Nov 4, 2021 · 3 comments

Comments

@rahuldh2006
Copy link

In RSP4J, when I try to use CSPARQLEngineRSP4J with Jena related objects (for example, JenaRDFParsingStrategy), I get below exception.

Exception in thread "main" java.lang.NoSuchMethodError: 'java.lang.Object org.apache.jena.atlas.lib.Cache.getIfPresent(java.lang.Object)'

Code fragment :

CSPARQLEngineRSP4J csparql = new CSPARQLEngineRSP4J();

JenaRDFParsingStrategy parsingStrategy = new JenaRDFParsingStrategy(RDFBase.TTL);

String filePath = "stream.log";
FileSource fileSource = new FileSource(filePath, 100, parsingStrategy);
csparql.register(fileSource);

DataStream outputStream = new DataStreamImpl<>("http://out/stream");
csparql.setSelectOutput(outputStream);

ContinuousQuery<Graph, Graph, Binding, Binding> cq = csparql.parseCSPARQLSelect(some_query);
ContinuousQueryExecution<Graph, Graph, Binding, Binding> cqe = csparql.parseSelect(cq);

fileSource.stream();

Note that CQELSEngineRSP4J works fine with Jena related objects in RSP4J.

@pbonte
Copy link
Collaborator

pbonte commented Nov 4, 2021

Hi rahuldh2006,

Thanks for spotting this error. This is due to the fact that the the CSPARQL engine is using an old version of Apache Jena, which is much older than the one in RSP4J.

For now, I would suggest you to use the more recent CSPARQL2.0 library: https://github.com/streamreasoning/csparql2
It is also build on top op RSP4J.

Or do you want to specifically use CSPARQL1.0?

@rahuldh2006
Copy link
Author

rahuldh2006 commented Nov 4, 2021

Thanks for the prompt information, Pieter. I will use CSPARQL2.0 library with RSP4J.

What is the Maven dependency to be included in RSP4J pom for CSPARQL2.0 (like for CSPARQL 1.0 in RSP4J, it is as below)
"
com.github.pbonte
CSPARQL-engine
0.9.5.1-pomfix
"

@pbonte
Copy link
Collaborator

pbonte commented Nov 8, 2021

You can use CSPARQL2.0 using the following maven dependency:

<dependency>
    <groupId>com.github.streamreasoning</groupId>
    <artifactId>csparql2</artifactId>
    <version>2.0</version>
</dependency>

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