You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by David Jordan <da...@bellsouth.net> on 2013/02/09 18:42:58 UTC
use of arq with sdb & mysql
I am trying to use the arq command with sdb/mysql. I have had a few problems getting the class path set up properly.
I have downloaded apache-jena-2.7.4 and jena-sdb-1.3.5.
The arq command uses environment variable JENA_HOME to build up a class path with all the jars under its lib directory. The first problem I hit was that the SDB jar was not in the Jena lib directory, so I copied jena-sdb-1.3.5.jar into the JENA_HOME/lib directory. I also needed to copy the mysql-connector jar into the directory too. These were understandable and easy enough to figure out.
Now I am getting the following exception:
Exception in thread "main" java.lang.NoSuchMethodError: com.hp.hpl.jena.sparql.algebra.optimize.TransformFilterEquality: method <init>(Z)V not found
In arq, I echo'd out the class path so we could see which jars I am including.
This does not look like a missing jar issue, it looks more like an incompatibility of classes across jars.
macpro:OWLgenealogy davejrdn$ arq --desc=db.ttl --query query1.rq
Classpath
/Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/commons-codec-1.5.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/httpclient-4.1.2.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/httpcore-4.1.3.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jcl-over-slf4j-1.6.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-arq-2.9.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-arq-2.9.4.jar.cpgz /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-core-2.7.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-iri-0.9.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-sdb-1.3.5.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-tdb-0.9.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/log4j-1.2.16.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/mysql-connector-java-5.0.8-bin.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/slf4j-api-1.6.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/slf4j-log4j12-1.6.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/xercesImpl-2.10.0.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/xml-apis-1.4.01.jar
end of classpath
Exception in thread "main" java.lang.NoSuchMethodError: com.hp.hpl.jena.sparql.algebra.optimize.TransformFilterEquality: method <init>(Z)V not found
at com.hp.hpl.jena.sdb.engine.QueryEngineSDB.init(QueryEngineSDB.java:107)
at com.hp.hpl.jena.sdb.engine.QueryEngineSDB.<init>(QueryEngineSDB.java:70)
at com.hp.hpl.jena.sdb.engine.QueryEngineSDB$QueryEngineFactorySDB.create(QueryEngineSDB.java:180)
at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:509)
at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:486)
at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:494)
at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:194)
at com.hp.hpl.jena.sparql.util.QueryExecUtils.doSelectQuery(QueryExecUtils.java:198)
at com.hp.hpl.jena.sparql.util.QueryExecUtils.executeQuery(QueryExecUtils.java:75)
at arq.query.queryExec(query.java:186)
at arq.query.exec(query.java:145)
at arq.cmdline.CmdMain.mainMethod(CmdMain.java:101)
at arq.cmdline.CmdMain.mainRun(CmdMain.java:63)
at arq.cmdline.CmdMain.mainRun(CmdMain.java:50)
at arq.query.main(query.java:65)
at arq.arq.main(arq.java:34)
Re: use of arq with sdb & mysql
Posted by David Jordan <da...@bellsouth.net>.
There was no intention of criticizing the Jena development or testing process in my earlier email.
I was mistaken in assuming that the separate binaries for SDB and Jena
on the main download page were compatible with one another.
I have not said anything about testing SDB on all the SQL databases supported.
Nor did I say anything about testing of SDB.
I am just trying to get an environment configured properly so I can use SDB.
I happen to be using MySQL, but that has not been an issue.
My experience has been that the official binary releases of software are
generally going to be more stable than the latest development builds.
So I have just been pulling the latest official releases in binary form.
But it sounds like you guys are doing agile with tests run against each development build.
So using the development versions may be stable.
I have not used Maven, nor know what a POM is.
I thought Maven was a build tool. I use Eclipse, Ant and the jars distributed.
I was just looking for a complete set of the right versions of jars so things would work.
I had been reading Jena documentation and assumed I should use arq to issue queries.
Now that I look more at sdb docs, I guess I need to use sdbquery instead of arq.
Thanks for your help, I now have jars that work.
On Feb 9, 2013, at 5:33 PM, Andy Seaborne wrote:
> On 09/02/13 21:54, David Jordan wrote:
>>
>> Thanks, that took care of it, and I see this snapshot of SDB includes the Jena 2.10.0.
>> So when using Jena with SDB, I assume then I should just have the class path point to the jars under SDB/lib?
>> Yet the executables like arq are only distributed with Jena, so I need the Jena/bin and SDB/bin in my PATH?
>>
>>
>> On Feb 9, 2013, at 4:32 PM, David Jordan wrote:
>>
>>>
>>> So the latest versions of Jena and SDB posted are not necessarily compatible?
>>> It would be nice then if you included with the Jena distribution the most up-to-date version of the SDB jar that works with it.
>>> The TDB jar is included.
>
> We do not have the resources or facilities to test SDB on every combination of SQL database supported.
>
> Jena is about community - it is not "owned" by the committers or anyone else. This is a distinguishing feature of Apache.
>
> If you want testing, maintenance and enhancement of SDB, then actively contribute patches and report testing. Run Continuous Integration on SDB in the environments you care about.
>
> The project releases and supports tested software. We released 1.3.5 by asking the community.
>
> If people want to join and help systematic regular testing of SDB that would be great. If there is no help, it does not get tested. It's as simple as that.
>
>>> If this new version of SDB (1.3.6 snapshot) depends on Jena 2.10.0, I guess I need to download it too.
>
> maven is your friend here. Given a POM it will sort out the right dependencies for you.
>
> (or ant/ivy or various other build tools)
>
>>> My thinking was the development snapshot versions may be less robust (more problems) than official release versions.
>
> Technically true but in practice we run a "clean trunk" - that is, trunk works. (We reserve the right to vary that but it has not happened in Apache or before.)
>
> A release is the source code; in our case, the "org.apache.jena:jena" artifact.
>
> "open source"
>
> "open" - you have the right to take and modify the code including IP issues.
>
> "source" - the source is primary; you can take the source, check the license and copyright on every piece of the system. Binaries are convenience.
>
> Andy
>
>>> On Feb 9, 2013, at 4:11 PM, Andy Seaborne wrote:
>>>
>>>> On 09/02/13 17:42, David Jordan wrote:
>>>>> I have downloaded apache-jena-2.7.4 and jena-sdb-1.3.5.
>>>>
>>>> The POM for SDB 1.3.5 says Jena 2.7.3 and ARQ 2.9.3.
>>>>
>>>> You can use the development version of SDB 1.3.6-SNAPSHOT, which depends on Jena 2.10.0 (the next version)
>>>>
>>>> https://repository.apache.org/content/repositories/snapshots/org/apache/jena/jena-sdb/
>>>>
>>>> which gets built against the rest of the Jena code base every night.
>>>>
>>>> Andy
>>>>
>>>
>>
>
Re: use of arq with sdb & mysql
Posted by Andy Seaborne <an...@apache.org>.
On 09/02/13 21:54, David Jordan wrote:
>
> Thanks, that took care of it, and I see this snapshot of SDB includes the Jena 2.10.0.
> So when using Jena with SDB, I assume then I should just have the class path point to the jars under SDB/lib?
> Yet the executables like arq are only distributed with Jena, so I need the Jena/bin and SDB/bin in my PATH?
>
>
> On Feb 9, 2013, at 4:32 PM, David Jordan wrote:
>
>>
>> So the latest versions of Jena and SDB posted are not necessarily compatible?
>> It would be nice then if you included with the Jena distribution the most up-to-date version of the SDB jar that works with it.
>> The TDB jar is included.
We do not have the resources or facilities to test SDB on every
combination of SQL database supported.
Jena is about community - it is not "owned" by the committers or anyone
else. This is a distinguishing feature of Apache.
If you want testing, maintenance and enhancement of SDB, then actively
contribute patches and report testing. Run Continuous Integration on
SDB in the environments you care about.
The project releases and supports tested software. We released 1.3.5 by
asking the community.
If people want to join and help systematic regular testing of SDB that
would be great. If there is no help, it does not get tested. It's as
simple as that.
>> If this new version of SDB (1.3.6 snapshot) depends on Jena 2.10.0, I guess I need to download it too.
maven is your friend here. Given a POM it will sort out the right
dependencies for you.
(or ant/ivy or various other build tools)
>> My thinking was the development snapshot versions may be less robust (more problems) than official release versions.
Technically true but in practice we run a "clean trunk" - that is, trunk
works. (We reserve the right to vary that but it has not happened in
Apache or before.)
A release is the source code; in our case, the "org.apache.jena:jena"
artifact.
"open source"
"open" - you have the right to take and modify the code including IP issues.
"source" - the source is primary; you can take the source, check the
license and copyright on every piece of the system. Binaries are
convenience.
Andy
>> On Feb 9, 2013, at 4:11 PM, Andy Seaborne wrote:
>>
>>> On 09/02/13 17:42, David Jordan wrote:
>>>> I have downloaded apache-jena-2.7.4 and jena-sdb-1.3.5.
>>>
>>> The POM for SDB 1.3.5 says Jena 2.7.3 and ARQ 2.9.3.
>>>
>>> You can use the development version of SDB 1.3.6-SNAPSHOT, which depends on Jena 2.10.0 (the next version)
>>>
>>> https://repository.apache.org/content/repositories/snapshots/org/apache/jena/jena-sdb/
>>>
>>> which gets built against the rest of the Jena code base every night.
>>>
>>> Andy
>>>
>>
>
Re: use of arq with sdb & mysql
Posted by David Jordan <da...@bellsouth.net>.
Thanks, that took care of it, and I see this snapshot of SDB includes the Jena 2.10.0.
So when using Jena with SDB, I assume then I should just have the class path point to the jars under SDB/lib?
Yet the executables like arq are only distributed with Jena, so I need the Jena/bin and SDB/bin in my PATH?
On Feb 9, 2013, at 4:32 PM, David Jordan wrote:
>
> So the latest versions of Jena and SDB posted are not necessarily compatible?
> It would be nice then if you included with the Jena distribution the most up-to-date version of the SDB jar that works with it.
> The TDB jar is included.
>
> If this new version of SDB (1.3.6 snapshot) depends on Jena 2.10.0, I guess I need to download it too.
> My thinking was the development snapshot versions may be less robust (more problems) than official release versions.
>
>
> On Feb 9, 2013, at 4:11 PM, Andy Seaborne wrote:
>
>> On 09/02/13 17:42, David Jordan wrote:
>>> I have downloaded apache-jena-2.7.4 and jena-sdb-1.3.5.
>>
>> The POM for SDB 1.3.5 says Jena 2.7.3 and ARQ 2.9.3.
>>
>> You can use the development version of SDB 1.3.6-SNAPSHOT, which depends on Jena 2.10.0 (the next version)
>>
>> https://repository.apache.org/content/repositories/snapshots/org/apache/jena/jena-sdb/
>>
>> which gets built against the rest of the Jena code base every night.
>>
>> Andy
>>
>
Re: use of arq with sdb & mysql
Posted by David Jordan <da...@bellsouth.net>.
So the latest versions of Jena and SDB posted are not necessarily compatible?
It would be nice then if you included with the Jena distribution the most up-to-date version of the SDB jar that works with it.
The TDB jar is included.
If this new version of SDB (1.3.6 snapshot) depends on Jena 2.10.0, I guess I need to download it too.
My thinking was the development snapshot versions may be less robust (more problems) than official release versions.
On Feb 9, 2013, at 4:11 PM, Andy Seaborne wrote:
> On 09/02/13 17:42, David Jordan wrote:
>> I have downloaded apache-jena-2.7.4 and jena-sdb-1.3.5.
>
> The POM for SDB 1.3.5 says Jena 2.7.3 and ARQ 2.9.3.
>
> You can use the development version of SDB 1.3.6-SNAPSHOT, which depends on Jena 2.10.0 (the next version)
>
> https://repository.apache.org/content/repositories/snapshots/org/apache/jena/jena-sdb/
>
> which gets built against the rest of the Jena code base every night.
>
> Andy
>
Re: use of arq with sdb & mysql
Posted by Andy Seaborne <an...@apache.org>.
On 09/02/13 17:42, David Jordan wrote:
> I have downloaded apache-jena-2.7.4 and jena-sdb-1.3.5.
The POM for SDB 1.3.5 says Jena 2.7.3 and ARQ 2.9.3.
You can use the development version of SDB 1.3.6-SNAPSHOT, which depends
on Jena 2.10.0 (the next version)
https://repository.apache.org/content/repositories/snapshots/org/apache/jena/jena-sdb/
which gets built against the rest of the Jena code base every night.
Andy
Re: use of arq with sdb & mysql
Posted by David Jordan <da...@bellsouth.net>.
I am getting a similar, but slightly different, stack trace when I try to issue queries through my Java program.
Query query = QueryFactory.read(queryFileName, Syntax.syntaxSPARQL_11);
QueryExecution exec = QueryExecutionFactory.create(query, model);
ResultSet rs = exec.execSelect();
List<String> resultVars = rs.getResultVars();
while( rs.hasNext() ){
I have already written code that has read RDF data and stored it into the MySQL database.
So I believe my assembler file is valid.
Any ideas what may be wrong?
Thread [main] (Suspended (exception NoSuchMethodError))
QueryEngineSDB.init(DatasetStoreGraph, Query, Binding, Context) line: 107
QueryEngineSDB.<init>(DatasetStoreGraph, Op, Binding, Context) line: 76
QueryEngineSDB$QueryEngineFactorySDB.create(Op, DatasetGraph, Binding, Context) line: 197
GraphSDB.graphBaseFind(TripleMatch) line: 173
GraphSDB(GraphBase2).find(TripleMatch) line: 258
GraphSDB(GraphBase2).graphBaseFind(Node, Node, Node) line: 280
GraphSDB(GraphBase2).find(Node, Node, Node) line: 276
QueryIterTriplePattern$TripleMapper.<init>(Binding, Triple, ExecutionContext) line: 80
QueryIterTriplePattern.nextStage(Binding) line: 53
QueryIterTriplePattern(QueryIterRepeatApply).makeNextStage() line: 113
QueryIterTriplePattern(QueryIterRepeatApply).hasNextBinding() line: 65
QueryIterTriplePattern(QueryIteratorBase).hasNext() line: 112
QueryIterBlockTriples.hasNextBinding() line: 64
QueryIterBlockTriples(QueryIteratorBase).hasNext() line: 112
SortedDataBag<E>(AbstractDataBag<E>).addAll(Iterator<? extends E>) line: 74
QueryIterSort$SortedBindingIterator.initializeIterator() line: 89
QueryIterSort$SortedBindingIterator(IteratorDelayedInitialization<T>).init() line: 37
QueryIterSort$SortedBindingIterator(IteratorDelayedInitialization<T>).hasNext() line: 47
QueryIterSort(QueryIterPlainWrapper).hasNextBinding() line: 54
QueryIterSort(QueryIteratorBase).hasNext() line: 112
QueryIterProject(QueryIterConvert).hasNextBinding() line: 59
QueryIterProject(QueryIteratorBase).hasNext() line: 112
QueryIteratorCheck(QueryIteratorWrapper).hasNextBinding() line: 40
QueryIteratorCheck(QueryIteratorBase).hasNext() line: 112
QueryIteratorCloseable(QueryIteratorWrapper).hasNextBinding() line: 40
QueryIteratorCloseable(QueryIteratorBase).hasNext() line: 112
ResultSetStream.hasNext() line: 72
RunQueries.main(String[]) line: 43
On Feb 9, 2013, at 12:42 PM, David Jordan wrote:
>
> I am trying to use the arq command with sdb/mysql. I have had a few problems getting the class path set up properly.
>
> I have downloaded apache-jena-2.7.4 and jena-sdb-1.3.5.
> The arq command uses environment variable JENA_HOME to build up a class path with all the jars under its lib directory. The first problem I hit was that the SDB jar was not in the Jena lib directory, so I copied jena-sdb-1.3.5.jar into the JENA_HOME/lib directory. I also needed to copy the mysql-connector jar into the directory too. These were understandable and easy enough to figure out.
>
> Now I am getting the following exception:
> Exception in thread "main" java.lang.NoSuchMethodError: com.hp.hpl.jena.sparql.algebra.optimize.TransformFilterEquality: method <init>(Z)V not found
>
> In arq, I echo'd out the class path so we could see which jars I am including.
>
> This does not look like a missing jar issue, it looks more like an incompatibility of classes across jars.
>
> macpro:OWLgenealogy davejrdn$ arq --desc=db.ttl --query query1.rq
> Classpath
> /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/commons-codec-1.5.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/httpclient-4.1.2.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/httpcore-4.1.3.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jcl-over-slf4j-1.6.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-arq-2.9.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-arq-2.9.4.jar.cpgz /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-core-2.7.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-iri-0.9.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-sdb-1.3.5.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/jena-tdb-0.9.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/log4j-1.2.16.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/mysql-connector-java-5.0.8-bin.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/slf4j-api-1.6.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/slf4j-log4j12-1.6.4.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/xercesImpl-2.10.0.jar /Users/davejrdn/Documents/Jena/apache-jena-2.7.4/lib/xml-apis-1.4.01.jar
> end of classpath
> Exception in thread "main" java.lang.NoSuchMethodError: com.hp.hpl.jena.sparql.algebra.optimize.TransformFilterEquality: method <init>(Z)V not found
> at com.hp.hpl.jena.sdb.engine.QueryEngineSDB.init(QueryEngineSDB.java:107)
> at com.hp.hpl.jena.sdb.engine.QueryEngineSDB.<init>(QueryEngineSDB.java:70)
> at com.hp.hpl.jena.sdb.engine.QueryEngineSDB$QueryEngineFactorySDB.create(QueryEngineSDB.java:180)
> at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:509)
> at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:486)
> at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:494)
> at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:194)
> at com.hp.hpl.jena.sparql.util.QueryExecUtils.doSelectQuery(QueryExecUtils.java:198)
> at com.hp.hpl.jena.sparql.util.QueryExecUtils.executeQuery(QueryExecUtils.java:75)
> at arq.query.queryExec(query.java:186)
> at arq.query.exec(query.java:145)
> at arq.cmdline.CmdMain.mainMethod(CmdMain.java:101)
> at arq.cmdline.CmdMain.mainRun(CmdMain.java:63)
> at arq.cmdline.CmdMain.mainRun(CmdMain.java:50)
> at arq.query.main(query.java:65)
> at arq.arq.main(arq.java:34)
>