Discussion:
[d2rq-dev] Using the assembler to union d2rq to a TDB model [SEC=UNCLASSIFIED]
Paul Murray
2015-02-25 02:53:31 UTC
Permalink
I hope this list is still live.

I am attempting to union a d2rq model to some data in TDB (and some static RDF files). The effect that I am trying to achieve is to add our new database to the data available at http://biodiversity.org.au/sparql/ . The TDB data there contains legacy identifiers. Our new database has mappings for these old IDs, so If I can jam the while lot into a single big graph, then it should be possible to span the data with SPARQL.

To keep things organised, I am putting the different data sets into named graphs. I don't see that the d2r server does this at all.

I have tried a variety of things - I run into class version problems, incompatible interfaces, various other things. I'm at the stage of thinking that I need to hack up the d2r code and rewrite SystemLoader, rigging it up to return a Graph that is not the d2r graph but that has that d2r graph as a subgraph. I have found that if I change the declaration of getModelD2RQ and getGraphD2RQ to return just the interface type, none of the existing code complains - but the point is that I shouldn't have to do this: there is a d2r jana assembler and it should just work.

So:

* Is there a version of fuseki/joseki that the d2rq assembler is known to work with?
Alternatively:
* can I launch the d2r server with an external assembler file?

---------------
If you are curious about the existing data, try this SPARQL query on http://biodiversity.org.au/sparql/ . (If you explore our data, please add a limit clause to all your sparql)

prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dcterms: <http://purl.org/dc/terms/>
prefix g: <http://biodiversity.org.au/voc/graph/GRAPH#>

select ?label ?title ?desc ?uri
where {
graph g:meta {
?uri a g:GraphURI .
OPTIONAL { ?uri rdfs:label ?label } .
OPTIONAL { ?uri dcterms:title ?title } .
OPTIONAL { ?uri dcterms:description ?desc } .
}
}
ORDER BY ?uri
LIMIT 100
Richard Cyganiak
2015-02-26 10:30:58 UTC
Permalink
Hi Paul,

A quick initial response.

Even though D2RQ is made for directly querying a relational DB with SPARQL, if you need to integrate data from multiple sources, I recommend dumping them all to RDF and loading them into a single RDF store. This is the best way to get performance and reliability. Of course, it may not be possible for you due to database size or quickly changing data.

The D2RQ assembler works for me with the version of Joseki that ships with D2RQ, Joseki 3.4.4.

I’m not sure what you mean by “external assembler file.” Can you explain or give an example?

Best,
Richard
Post by Paul Murray
I hope this list is still live.
I am attempting to union a d2rq model to some data in TDB (and some static RDF files). The effect that I am trying to achieve is to add our new database to the data available at http://biodiversity.org.au/sparql/ . The TDB data there contains legacy identifiers. Our new database has mappings for these old IDs, so If I can jam the while lot into a single big graph, then it should be possible to span the data with SPARQL.
To keep things organised, I am putting the different data sets into named graphs. I don't see that the d2r server does this at all.
I have tried a variety of things - I run into class version problems, incompatible interfaces, various other things. I'm at the stage of thinking that I need to hack up the d2r code and rewrite SystemLoader, rigging it up to return a Graph that is not the d2r graph but that has that d2r graph as a subgraph. I have found that if I change the declaration of getModelD2RQ and getGraphD2RQ to return just the interface type, none of the existing code complains - but the point is that I shouldn't have to do this: there is a d2r jana assembler and it should just work.
* Is there a version of fuseki/joseki that the d2rq assembler is known to work with?
* can I launch the d2r server with an external assembler file?
---------------
If you are curious about the existing data, try this SPARQL query on http://biodiversity.org.au/sparql/ . (If you explore our data, please add a limit clause to all your sparql)
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dcterms: <http://purl.org/dc/terms/>
prefix g: <http://biodiversity.org.au/voc/graph/GRAPH#>
select ?label ?title ?desc ?uri
where {
graph g:meta {
?uri a g:GraphURI .
OPTIONAL { ?uri rdfs:label ?label } .
OPTIONAL { ?uri dcterms:title ?title } .
OPTIONAL { ?uri dcterms:description ?desc } .
}
}
ORDER BY ?uri
LIMIT 100
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
Diogo FC Patrao
2015-02-26 14:05:10 UTC
Permalink
Hi Paul

You can join results from different endpoints using the SERVICE clause of
sparql 1.1.

I also invite you to know the SPARQLfederator project, which turns a
conjunctive query into a regular sparql query automatically unifying
diferent endpoints :

https://github.com/djogopatrao/SPARQLFederator

Other tool you may look is fedx.

Cheers

Dfcp
Post by Richard Cyganiak
Hi Paul,
A quick initial response.
Even though D2RQ is made for directly querying a relational DB with
SPARQL, if you need to integrate data from multiple sources, I recommend
dumping them all to RDF and loading them into a single RDF store. This is
the best way to get performance and reliability. Of course, it may not be
possible for you due to database size or quickly changing data.
The D2RQ assembler works for me with the version of Joseki that ships with
D2RQ, Joseki 3.4.4.
I’m not sure what you mean by “external assembler file.” Can you explain
or give an example?
Best,
Richard
Post by Paul Murray
I hope this list is still live.
I am attempting to union a d2rq model to some data in TDB (and some
static RDF files). The effect that I am trying to achieve is to add our new
database to the data available at http://biodiversity.org.au/sparql/ .
The TDB data there contains legacy identifiers. Our new database has
mappings for these old IDs, so If I can jam the while lot into a single big
graph, then it should be possible to span the data with SPARQL.
Post by Paul Murray
To keep things organised, I am putting the different data sets into
named graphs. I don't see that the d2r server does this at all.
Post by Paul Murray
I have tried a variety of things - I run into class version problems,
incompatible interfaces, various other things. I'm at the stage of thinking
that I need to hack up the d2r code and rewrite SystemLoader, rigging it
up to return a Graph that is not the d2r graph but that has that d2r graph
as a subgraph. I have found that if I change the declaration of
getModelD2RQ and getGraphD2RQ to return just the interface type, none of
the existing code complains - but the point is that I shouldn't have to do
this: there is a d2r jana assembler and it should just work.
Post by Paul Murray
* Is there a version of fuseki/joseki that the d2rq assembler is known
to work with?
Post by Paul Murray
* can I launch the d2r server with an external assembler file?
---------------
If you are curious about the existing data, try this SPARQL query on
http://biodiversity.org.au/sparql/ . (If you explore our data, please add
a limit clause to all your sparql)
Post by Paul Murray
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dcterms: <http://purl.org/dc/terms/>
prefix g: <http://biodiversity.org.au/voc/graph/GRAPH#>
select ?label ?title ?desc ?uri
where {
graph g:meta {
?uri a g:GraphURI .
OPTIONAL { ?uri rdfs:label ?label } .
OPTIONAL { ?uri dcterms:title ?title } .
OPTIONAL { ?uri dcterms:description ?desc } .
}
}
ORDER BY ?uri
LIMIT 100
------------------------------------------------------------------------------
Post by Paul Murray
Dive into the World of Parallel Programming The Go Parallel Website,
sponsored
Post by Paul Murray
by Intel and developed in partnership with Slashdot Media, is your hub
for all
Post by Paul Murray
things parallel software development, from weekly thought leadership
blogs to
Post by Paul Murray
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
Paul Murray
2015-02-27 05:44:09 UTC
Permalink
Apologies for the long email, but I'm trying to describe the problem completely. I'll write this mail as I attempt to make what I want to happen, happen. Maybe in the process of writing this I will solve it for myself :)

(TL;DR: I got it going! Yay! But I'll send this saga out anyway because it took me most of the afternoon to write it.)
Post by Richard Cyganiak
Hi Paul,
A quick initial response.
Even though D2RQ is made for directly querying a relational DB with SPARQL, if you need to integrate data from multiple sources, I recommend dumping them all to RDF and loading them into a single RDF store. This is the best way to get performance and reliability. Of course, it may not be possible for you due to database size or quickly changing data.
At present, my data sources are:

1 - A set of OWL ontologies in static RDF. I load these so that SPARQL can be written over them - perhaps I might even be able to drive the Pellet reasoner off them. There are 50 or so. These include our local ontologies as well as a couple of standard ones - SKOS, TDWG (Taxonomic Database Working Group), dublin core, darwin core.

2 - Three separate TDB data sets
** The Australian Faunal Directory (AFD) data. 18G. This gets built by a batch process that takes a day and a bit to complete. We would like to update it once a month, or even weekly.
** The old Australian Plant Names Index (APNI) 10G. This used to be extracted alongside AFD, but this database is not longer being updated. The legacy data needs to remain present on the semantic web.
** A load of the Catalogue of Life, 2011. 34G. Again, this will no longer get updated, I think (mainly because no-one is paying for it to be done). The key part of this data is that it contains mappings from the COL identifiers to AFD and APNI ones.

3 - The new APNI. This is the dataset that I would like to expose via d2r.

I keep this dataset organised by splitting it into named graphs. The named graph named 'meta'
<http://biodiversity.org.au/voc/graph/GRAPH#meta>

describes the named graphs on the service. This is not the default graph of the SPARQL endpoint … but perhaps it should be. At present the default graph on the server is an empty one because I was concerned that I might be exposing it to an update service.

So, you can see that there's reasons for building this hetrogenous mish-mash of multiple types of data sources. I have big data sets, updated on different schedules, using systems that have been in place and working for a couple of years now. Having the datasets stored as RDF and them loading them into memory with a parser is really not a great option. What I want is to append a D2R graph into this thing.
Post by Richard Cyganiak
The D2RQ assembler works for me with the version of Joseki that ships with D2RQ, Joseki 3.4.4.
I’m not sure what you mean by “external assembler file.” Can you explain or give an example?
Ok, this is great news and what I was hoping to hear.

Steps are -
1 - get a standalone install of Joseki 3.4.4 running with an assembler with a couple of simple graphs.
2 - Get the joskei installation inside d2r doing this - acting as a sparql endpoint, serving up static graphs.
3 - Get the joseki installation inside d2r serving up the static graphs alongside a very simple d2r graph
4 - jamming the big thing into it.

Currently, the problem is step 2.

=== STEP 1 - A simple assembler that works ok with Joseki 3.4.4 ===


Let's start with the basics - I want to launch a sparql endpoint in the d2r distribution with just a couple of static, empty named graphs.
Once I have that going, jamming all of this other stuff in there is simply a mater of editing the assembler.

D2R is using Joseki 3.4.4 . Lets write a mapping file that I know works against 3.4.4 . To do this, I will grab a copy of Joseki 3.4.4.

. . .

OK. I save this assembler as simple-setup.ttl, and write a little sampledata.ttl with one row in it .

-----------------------------------

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix module: <http://joseki.org/2003/06/module#> .
@prefix joseki: <http://joseki.org/2005/06/configuration#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .

<#graph1> a ja:MemoryModel
; ja:content
[ ja:externalContent <file:sampledata.ttl>
]
.

<#graph2> a ja:MemoryModel
; ja:content
[ ja:externalContent <file:sampledata.ttl>
]
.

<#graph3> a ja:UnionModel
; ja:subModel <#graph1>
; ja:subModel <#graph2>
.

<#server> a joseki:Server
.

<#service> a joseki:Service
; joseki:serviceRef "sparql"
; joseki:dataset
[ a ja:RDFDataset
; ja:namedGraph
[ ja:graphName <http://example.org/#graph1>
; ja:graph <#graph1>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#graph2>
; ja:graph <#graph2>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#uniongraph>
; ja:graph <#graph3>
]
]
; joseki:processor
[ a joseki:Processor
; module:implementation
[ a joseki:ServiceImpl
; module:className <java:org.joseki.processors.SPARQL>
]
]
.

-----------------------------------

When I save this into the Joseki directory and execute
$ export JOSEKIROOT=.
$ bin/rdfserver simpleconfig.ttl

And then browse to
http://localhost:2020/sparql?query=select+*+where+%7B+GRAPH+%3Fg+%7B+%3Fs+%3Fp+%3Fo+%7D+%7D&output=text

Then I get back some triples. Outstanding.

So! Let's try making this go in the d2r copy of joseki!

=== STEP 2 - Make the simple assembler run in joseki in the d2r2 installation ===

Ok. The d2r root directory does not have an rdf-server executable. It does have a d2r-server executable. This execuable has an option for a d2r mapping file, but not for a jena assembler.

But let's take a punt and see if it will accept a jena assembler anyway:

$ ./d2r-server simpleconfig.ttl
15:44:52 WARN org.eclipse.jetty.webapp.WebAppContext :: Failed startup of context o.e.j.w.WebAppContext{,file:/Users/ibis/git/d2rq-0.8.1/webapp/},webapp
de.fuberlin.wiwiss.d2rq.D2RQException: No d2rq:Database defined in the mapping (E1)

Fine, that's what I expected. The d2r launcher launches an endpoint that has one graph, that graph being a d2r graph initialised by the parameter. It simply doesn't take a general JENA assembler as input.

So lets have a look at the joseki that's inside d2r. The various files in the joseki installation are not present. There is a joseki.jar in the lib directory and that's it.

Let's try launching joseki using the same method that rdfserver in the full installation launches it. The launch in the full installation is:

exec "$JAVA" $JAVA_ARGS -cp "$CP" $LOG joseki.rdfserver "$@"

JAVA_ARGS is just "-server -Xmx1G" , which we can ignore.
LOG is -Dlog4j.configuration=${LOGCONFIG}, which we can also ignore
And CP will have to be all the lib files in the joseki directory

$ CP=$(find lib -name *.jar | while read j ; do echo -n "$j:" ; done)
$ java -cp $CP joseki.rdfserver simpleconfig.ttl

Exception in thread "main" java.lang.NoClassDefFoundError: org/mortbay/jetty/Connector
at joseki.rdfserver.main(rdfserver.java:85)

Riiiiight. In any case, this at the very least isn't going to work because the WEB-INF won't be set up right. The joseki config alone isn't enough - the d2r installation isn't set up correctly to expose the joseki SPARQL endpoint as a service.

================= NEW PLAN =================

OK! New plan - we will include the d2r libraries in the joseki launch!

Well, there's a fair bit of duplication there, which is not a big problem. Except that there are some different versions of some of the libraries, which is bad.

Let's just make a humungous classpath and launch Joseki with the D2R libraries jammed in there. What could possibly go wrong? First, I'll try putting the joseki libraries first.

$ CP=$(find lib -name \*.jar | while read j ; do echo -n "$j:" ; done):$(find ~/git/d2rq-0.8.1/lib -name \*.jar | while read j ; do echo -n "$j:" ; done)
$ java -cp $CP joseki.rdfserver simpleconfig.ttl

SLF4J has a bit of a bitch about a class being in two of the jars, but apart from that it's all good.

So - let's try adding in a d2r assembler

Copy simpleconfig.ttl to withd2r.ttl, and add a mapping to the assembler.

<#graph4> a d2rq:D2RQModel;
d2rq:mappingFile <simplemapping.ttl>;
d2rq:resourceBaseURI <http://localhost:2020/test123>;
.

<#service> a joseki:Service
; joseki:serviceRef "sparql"
; joseki:dataset
[ a ja:RDFDataset
; ja:namedGraph
[ ja:graphName <http://example.org/#graph1>
; ja:graph <#graph1>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#graph2>
; ja:graph <#graph2>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#uniongraph>
; ja:graph <#graph3>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#d2rqgraph>
; ja:graph <#graph4>
]
]
; joseki:processor
[ a joseki:Processor
; module:implementation
[ a joseki:ServiceImpl
; module:className <java:org.joseki.processors.SPARQL>
]
]
.

Ok, blows up with a
the root file:///Users/ibis/Software/Joseki/Joseki-3.4.4/withd2r.ttl#graph4 has no most specific type that is a subclass of ja:Object

This is ok - now I understand what that import is for :) . So lets include the import

<> ja:imports <http://d2rq.org/terms/d2rq> .

This blows up with a
Not found: file:///Users/ibis/Software/Joseki/Joseki-3.4.4/simplemapping.ttl

Which is awesome! The assembler loads and tries to do what I told it to do. Booyah! I'm excited, but I've been this excited before and been cruelly disappointed, all my hopes dashed.

So now I need to create a simple d2r mapping file and name it simplemapping.ttl

----------------------------------------------
@prefix map: <#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
@prefix jdbc: <http://d2rq.org/terms/jdbc/> .

@prefix d2r: <http://sites.wiwiss.fu-berlin.de/suhl/bizer/d2r-server/config.rdf#> .

@prefix nsl: <http://biodiversity.org.au/voc/nsl/NSL#> .

map:Configuration a d2rq:Configuration;
d2rq:serveVocabulary true
.

map:APNI_database a d2rq:Database;
d2rq:jdbcDriver "org.postgresql.Driver";
d2rq:jdbcDSN "jdbc:postgresql://localhost:5432/nsl";
d2rq:username "--DELETED--";
d2rq:password "--DELETED--";
.

map:APNI_Namespace a d2rq:ClassMap;
d2rq:dataStorage map:APNI_database;
d2rq:uriPattern "http://biodiversity.org.au/voc/nsl/NamespaceTerm#@@namespace.rdf_id@@";
d2rq:class nsl:Namespace;
d2rq:class nsl:IdentifiedEntity;
.

--------------------------------------------------

And launch - It launches! Run the query - and it complains that the database is down. Of course.

Start the database, run the query ... And I get an error

INFO [***@qtp-1423640817-0] (SPARQL.java:165) - Throwable: Implementing class
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at de.fuberlin.wiwiss.d2rq.algebra.CompatibleRelationGroup.addNodeRelation(CompatibleRelationGroup.java:53)
at de.fuberlin.wiwiss.d2rq.algebra.CompatibleRelationGroup.groupNodeRelations(CompatibleRelationGroup.java:38)

Damn.

Ok - what if I load up the classpath with the d2r libraries first and the joseki libraries second?

$ CP=$(find ~/git/d2rq-0.8.1/lib -name \*.jar | while read j ; do echo -n "$j:" ; done):$(find lib -name \*.jar | while read j ; do echo -n "$j:" ; done)
$ java -cp $CP joseki.rdfserver withd2r.ttl

and browse to http://localhost:2020/sparql?query=select+*+where+%7B+GRAPH+%3Fg+%7B+%3Fs+%3Fp+%3Fo+%7D+%7D&output=text

and

--------------------------------------------------

OMG! OMG! It works! It works!

So: it seems I can make it go by launching joseki but putting all the d2r libraries in the classpath first. It's a little fragile, and what I would like is to not to have to do this - to have a prepackaged setup that works. Obviously the d2r installation has a bunch of stuff I don't need - the gear that supports the d2r web app pages. I still have not confirmed that it will co-operate with the multi-gigabyte TDB datasets I need to use. But ... it does seem to go. I can write a java app to scan the jar files and find which ones declare the same class names, to arrive at a set of jars that don't overlap.

Hopefully, sometime next week I'll be able to show you the new system serving the old and the new data together at biodiversity.org.au. But for now, it's 16:45 on Friday which makes it Beer O'Clock.
Richard Cyganiak
2015-02-27 12:47:37 UTC
Permalink
Just what I love as the first thing in my inbox on an early Friday morning: A nine-page, highly technical report that makes my caffeine-deprived head hurt, and ends with a declaration that the author has already made it to the weekend! ;-)

Jokes aside, thanks for this, Paul. Do you think it would be possible to extract from this:

1. Any Issues (bugs, feature requests) against D2RQ, stating what we should change/fix? These should go here: https://github.com/d2rq/d2rq/issues

2. Something tutorial-like that’s clear enough to share on the D2RQ wiki? https://github.com/d2rq/d2rq/wiki

I would in particular appreciate help with getting any issues into the tracker.

Best,
Richard
Post by Paul Murray
Apologies for the long email, but I'm trying to describe the problem completely. I'll write this mail as I attempt to make what I want to happen, happen. Maybe in the process of writing this I will solve it for myself :)
(TL;DR: I got it going! Yay! But I'll send this saga out anyway because it took me most of the afternoon to write it.)
Post by Richard Cyganiak
Hi Paul,
A quick initial response.
Even though D2RQ is made for directly querying a relational DB with SPARQL, if you need to integrate data from multiple sources, I recommend dumping them all to RDF and loading them into a single RDF store. This is the best way to get performance and reliability. Of course, it may not be possible for you due to database size or quickly changing data.
1 - A set of OWL ontologies in static RDF. I load these so that SPARQL can be written over them - perhaps I might even be able to drive the Pellet reasoner off them. There are 50 or so. These include our local ontologies as well as a couple of standard ones - SKOS, TDWG (Taxonomic Database Working Group), dublin core, darwin core.
2 - Three separate TDB data sets
** The Australian Faunal Directory (AFD) data. 18G. This gets built by a batch process that takes a day and a bit to complete. We would like to update it once a month, or even weekly.
** The old Australian Plant Names Index (APNI) 10G. This used to be extracted alongside AFD, but this database is not longer being updated. The legacy data needs to remain present on the semantic web.
** A load of the Catalogue of Life, 2011. 34G. Again, this will no longer get updated, I think (mainly because no-one is paying for it to be done). The key part of this data is that it contains mappings from the COL identifiers to AFD and APNI ones.
3 - The new APNI. This is the dataset that I would like to expose via d2r.
I keep this dataset organised by splitting it into named graphs. The named graph named 'meta'
<http://biodiversity.org.au/voc/graph/GRAPH#meta>
describes the named graphs on the service. This is not the default graph of the SPARQL endpoint … but perhaps it should be. At present the default graph on the server is an empty one because I was concerned that I might be exposing it to an update service.
So, you can see that there's reasons for building this hetrogenous mish-mash of multiple types of data sources. I have big data sets, updated on different schedules, using systems that have been in place and working for a couple of years now. Having the datasets stored as RDF and them loading them into memory with a parser is really not a great option. What I want is to append a D2R graph into this thing.
Post by Richard Cyganiak
The D2RQ assembler works for me with the version of Joseki that ships with D2RQ, Joseki 3.4.4.
I’m not sure what you mean by “external assembler file.” Can you explain or give an example?
Ok, this is great news and what I was hoping to hear.
Steps are -
1 - get a standalone install of Joseki 3.4.4 running with an assembler with a couple of simple graphs.
2 - Get the joskei installation inside d2r doing this - acting as a sparql endpoint, serving up static graphs.
3 - Get the joseki installation inside d2r serving up the static graphs alongside a very simple d2r graph
4 - jamming the big thing into it.
Currently, the problem is step 2.
=== STEP 1 - A simple assembler that works ok with Joseki 3.4.4 ===
Let's start with the basics - I want to launch a sparql endpoint in the d2r distribution with just a couple of static, empty named graphs.
Once I have that going, jamming all of this other stuff in there is simply a mater of editing the assembler.
D2R is using Joseki 3.4.4 . Lets write a mapping file that I know works against 3.4.4 . To do this, I will grab a copy of Joseki 3.4.4.
. . .
OK. I save this assembler as simple-setup.ttl, and write a little sampledata.ttl with one row in it .
-----------------------------------
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix module: <http://joseki.org/2003/06/module#> .
@prefix joseki: <http://joseki.org/2005/06/configuration#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
<#graph1> a ja:MemoryModel
; ja:content
[ ja:externalContent <file:sampledata.ttl>
]
.
<#graph2> a ja:MemoryModel
; ja:content
[ ja:externalContent <file:sampledata.ttl>
]
.
<#graph3> a ja:UnionModel
; ja:subModel <#graph1>
; ja:subModel <#graph2>
.
<#server> a joseki:Server
.
<#service> a joseki:Service
; joseki:serviceRef "sparql"
; joseki:dataset
[ a ja:RDFDataset
; ja:namedGraph
[ ja:graphName <http://example.org/#graph1>
; ja:graph <#graph1>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#graph2>
; ja:graph <#graph2>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#uniongraph>
; ja:graph <#graph3>
]
]
; joseki:processor
[ a joseki:Processor
; module:implementation
[ a joseki:ServiceImpl
; module:className <java:org.joseki.processors.SPARQL>
]
]
.
-----------------------------------
When I save this into the Joseki directory and execute
$ export JOSEKIROOT=.
$ bin/rdfserver simpleconfig.ttl
And then browse to
http://localhost:2020/sparql?query=select+*+where+%7B+GRAPH+%3Fg+%7B+%3Fs+%3Fp+%3Fo+%7D+%7D&output=text
Then I get back some triples. Outstanding.
So! Let's try making this go in the d2r copy of joseki!
=== STEP 2 - Make the simple assembler run in joseki in the d2r2 installation ===
Ok. The d2r root directory does not have an rdf-server executable. It does have a d2r-server executable. This execuable has an option for a d2r mapping file, but not for a jena assembler.
$ ./d2r-server simpleconfig.ttl
15:44:52 WARN org.eclipse.jetty.webapp.WebAppContext :: Failed startup of context o.e.j.w.WebAppContext{,file:/Users/ibis/git/d2rq-0.8.1/webapp/},webapp
de.fuberlin.wiwiss.d2rq.D2RQException: No d2rq:Database defined in the mapping (E1)
Fine, that's what I expected. The d2r launcher launches an endpoint that has one graph, that graph being a d2r graph initialised by the parameter. It simply doesn't take a general JENA assembler as input.
So lets have a look at the joseki that's inside d2r. The various files in the joseki installation are not present. There is a joseki.jar in the lib directory and that's it.
JAVA_ARGS is just "-server -Xmx1G" , which we can ignore.
LOG is -Dlog4j.configuration=${LOGCONFIG}, which we can also ignore
And CP will have to be all the lib files in the joseki directory
$ CP=$(find lib -name *.jar | while read j ; do echo -n "$j:" ; done)
$ java -cp $CP joseki.rdfserver simpleconfig.ttl
Exception in thread "main" java.lang.NoClassDefFoundError: org/mortbay/jetty/Connector
at joseki.rdfserver.main(rdfserver.java:85)
Riiiiight. In any case, this at the very least isn't going to work because the WEB-INF won't be set up right. The joseki config alone isn't enough - the d2r installation isn't set up correctly to expose the joseki SPARQL endpoint as a service.
================= NEW PLAN =================
OK! New plan - we will include the d2r libraries in the joseki launch!
Well, there's a fair bit of duplication there, which is not a big problem. Except that there are some different versions of some of the libraries, which is bad.
Let's just make a humungous classpath and launch Joseki with the D2R libraries jammed in there. What could possibly go wrong? First, I'll try putting the joseki libraries first.
$ CP=$(find lib -name \*.jar | while read j ; do echo -n "$j:" ; done):$(find ~/git/d2rq-0.8.1/lib -name \*.jar | while read j ; do echo -n "$j:" ; done)
$ java -cp $CP joseki.rdfserver simpleconfig.ttl
SLF4J has a bit of a bitch about a class being in two of the jars, but apart from that it's all good.
So - let's try adding in a d2r assembler
Copy simpleconfig.ttl to withd2r.ttl, and add a mapping to the assembler.
<#graph4> a d2rq:D2RQModel;
d2rq:mappingFile <simplemapping.ttl>;
d2rq:resourceBaseURI <http://localhost:2020/test123>;
.
<#service> a joseki:Service
; joseki:serviceRef "sparql"
; joseki:dataset
[ a ja:RDFDataset
; ja:namedGraph
[ ja:graphName <http://example.org/#graph1>
; ja:graph <#graph1>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#graph2>
; ja:graph <#graph2>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#uniongraph>
; ja:graph <#graph3>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#d2rqgraph>
; ja:graph <#graph4>
]
]
; joseki:processor
[ a joseki:Processor
; module:implementation
[ a joseki:ServiceImpl
; module:className <java:org.joseki.processors.SPARQL>
]
]
.
Ok, blows up with a
the root file:///Users/ibis/Software/Joseki/Joseki-3.4.4/withd2r.ttl#graph4 has no most specific type that is a subclass of ja:Object
This is ok - now I understand what that import is for :) . So lets include the import
<> ja:imports <http://d2rq.org/terms/d2rq> .
This blows up with a
Not found: file:///Users/ibis/Software/Joseki/Joseki-3.4.4/simplemapping.ttl
Which is awesome! The assembler loads and tries to do what I told it to do. Booyah! I'm excited, but I've been this excited before and been cruelly disappointed, all my hopes dashed.
So now I need to create a simple d2r mapping file and name it simplemapping.ttl
----------------------------------------------
@prefix map: <#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
@prefix jdbc: <http://d2rq.org/terms/jdbc/> .
@prefix d2r: <http://sites.wiwiss.fu-berlin.de/suhl/bizer/d2r-server/config.rdf#> .
@prefix nsl: <http://biodiversity.org.au/voc/nsl/NSL#> .
map:Configuration a d2rq:Configuration;
d2rq:serveVocabulary true
.
map:APNI_database a d2rq:Database;
d2rq:jdbcDriver "org.postgresql.Driver";
d2rq:jdbcDSN "jdbc:postgresql://localhost:5432/nsl";
d2rq:username "--DELETED--";
d2rq:password "--DELETED--";
.
map:APNI_Namespace a d2rq:ClassMap;
d2rq:dataStorage map:APNI_database;
d2rq:class nsl:Namespace;
d2rq:class nsl:IdentifiedEntity;
.
--------------------------------------------------
And launch - It launches! Run the query - and it complains that the database is down. Of course.
Start the database, run the query ... And I get an error
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at de.fuberlin.wiwiss.d2rq.algebra.CompatibleRelationGroup.addNodeRelation(CompatibleRelationGroup.java:53)
at de.fuberlin.wiwiss.d2rq.algebra.CompatibleRelationGroup.groupNodeRelations(CompatibleRelationGroup.java:38)
Damn.
Ok - what if I load up the classpath with the d2r libraries first and the joseki libraries second?
$ CP=$(find ~/git/d2rq-0.8.1/lib -name \*.jar | while read j ; do echo -n "$j:" ; done):$(find lib -name \*.jar | while read j ; do echo -n "$j:" ; done)
$ java -cp $CP joseki.rdfserver withd2r.ttl
and browse to http://localhost:2020/sparql?query=select+*+where+%7B+GRAPH+%3Fg+%7B+%3Fs+%3Fp+%3Fo+%7D+%7D&output=text
and
--------------------------------------------------
OMG! OMG! It works! It works!
So: it seems I can make it go by launching joseki but putting all the d2r libraries in the classpath first. It's a little fragile, and what I would like is to not to have to do this - to have a prepackaged setup that works. Obviously the d2r installation has a bunch of stuff I don't need - the gear that supports the d2r web app pages. I still have not confirmed that it will co-operate with the multi-gigabyte TDB datasets I need to use. But ... it does seem to go. I can write a java app to scan the jar files and find which ones declare the same class names, to arrive at a set of jars that don't overlap.
Hopefully, sometime next week I'll be able to show you the new system serving the old and the new data together at biodiversity.org.au. But for now, it's 16:45 on Friday which makes it Beer O'Clock.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
Diogo FC Patrao
2015-02-27 17:04:54 UTC
Permalink
Hello

Somewhere between the reading something rang a bell in my head - I tried
this before, I guess. I think there's some sort of problem when querying
some concept which is present in two datasets...

I'll explain better. I was trying to integrate two different SQL databases
by mapping each on by D2R. They contained the same information (say, the
procedure codes a patient had, and mapped a class named "Patient" and other
"Procedure", both were linked and got some data typed properties).

Then I tried to use Joseki/Fuseki (can't recall which) and managed to put
the two together. After juggling with the config file, I could start
joseki, and querying for data present in only one database worked (say
patient1 is defined only on database A), however, for a patient with
different procedures in both databases, results were unreliable - each time
I run a query, I got results only from database A or B.

So I suggest you make sure it isn't happening, and thank you for this very
interesting use case.

Cheers,



--
diogo patrão
Post by Richard Cyganiak
Just what I love as the first thing in my inbox on an early Friday
morning: A nine-page, highly technical report that makes my
caffeine-deprived head hurt, and ends with a declaration that the author
has already made it to the weekend! ;-)
1. Any Issues (bugs, feature requests) against D2RQ, stating what we
https://github.com/d2rq/d2rq/issues
2. Something tutorial-like that’s clear enough to share on the D2RQ wiki?
https://github.com/d2rq/d2rq/wiki
I would in particular appreciate help with getting any issues into the tracker.
Best,
Richard
Post by Paul Murray
Apologies for the long email, but I'm trying to describe the problem
completely. I'll write this mail as I attempt to make what I want to
happen, happen. Maybe in the process of writing this I will solve it for
myself :)
Post by Paul Murray
(TL;DR: I got it going! Yay! But I'll send this saga out anyway because
it took me most of the afternoon to write it.)
Post by Paul Murray
Post by Richard Cyganiak
Hi Paul,
A quick initial response.
Even though D2RQ is made for directly querying a relational DB with
SPARQL, if you need to integrate data from multiple sources, I recommend
dumping them all to RDF and loading them into a single RDF store. This is
the best way to get performance and reliability. Of course, it may not be
possible for you due to database size or quickly changing data.
Post by Paul Murray
1 - A set of OWL ontologies in static RDF. I load these so that SPARQL
can be written over them - perhaps I might even be able to drive the Pellet
reasoner off them. There are 50 or so. These include our local ontologies
as well as a couple of standard ones - SKOS, TDWG (Taxonomic Database
Working Group), dublin core, darwin core.
Post by Paul Murray
2 - Three separate TDB data sets
** The Australian Faunal Directory (AFD) data. 18G. This gets built by a
batch process that takes a day and a bit to complete. We would like to
update it once a month, or even weekly.
Post by Paul Murray
** The old Australian Plant Names Index (APNI) 10G. This used to be
extracted alongside AFD, but this database is not longer being updated. The
legacy data needs to remain present on the semantic web.
Post by Paul Murray
** A load of the Catalogue of Life, 2011. 34G. Again, this will no
longer get updated, I think (mainly because no-one is paying for it to be
done). The key part of this data is that it contains mappings from the COL
identifiers to AFD and APNI ones.
Post by Paul Murray
3 - The new APNI. This is the dataset that I would like to expose via
d2r.
Post by Paul Murray
I keep this dataset organised by splitting it into named graphs. The
named graph named 'meta'
Post by Paul Murray
<http://biodiversity.org.au/voc/graph/GRAPH#meta>
describes the named graphs on the service. This is not the default graph
of the SPARQL endpoint 
 but perhaps it should be. At present the default
graph on the server is an empty one because I was concerned that I might be
exposing it to an update service.
Post by Paul Murray
So, you can see that there's reasons for building this hetrogenous
mish-mash of multiple types of data sources. I have big data sets, updated
on different schedules, using systems that have been in place and working
for a couple of years now. Having the datasets stored as RDF and them
loading them into memory with a parser is really not a great option. What I
want is to append a D2R graph into this thing.
Post by Paul Murray
Post by Richard Cyganiak
The D2RQ assembler works for me with the version of Joseki that ships
with D2RQ, Joseki 3.4.4.
Post by Paul Murray
Post by Richard Cyganiak
I’m not sure what you mean by “external assembler file.” Can you
explain or give an example?
Post by Paul Murray
Ok, this is great news and what I was hoping to hear.
Steps are -
1 - get a standalone install of Joseki 3.4.4 running with an assembler
with a couple of simple graphs.
Post by Paul Murray
2 - Get the joskei installation inside d2r doing this - acting as a
sparql endpoint, serving up static graphs.
Post by Paul Murray
3 - Get the joseki installation inside d2r serving up the static graphs
alongside a very simple d2r graph
Post by Paul Murray
4 - jamming the big thing into it.
Currently, the problem is step 2.
=== STEP 1 - A simple assembler that works ok with Joseki 3.4.4 ===
Let's start with the basics - I want to launch a sparql endpoint in the
d2r distribution with just a couple of static, empty named graphs.
Post by Paul Murray
Once I have that going, jamming all of this other stuff in there is
simply a mater of editing the assembler.
Post by Paul Murray
D2R is using Joseki 3.4.4 . Lets write a mapping file that I know works
against 3.4.4 . To do this, I will grab a copy of Joseki 3.4.4.
Post by Paul Murray
. . .
OK. I save this assembler as simple-setup.ttl, and write a little
sampledata.ttl with one row in it .
Post by Paul Murray
-----------------------------------
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix module: <http://joseki.org/2003/06/module#> .
@prefix joseki: <http://joseki.org/2005/06/configuration#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
<#graph1> a ja:MemoryModel
; ja:content
[ ja:externalContent <file:sampledata.ttl>
]
.
<#graph2> a ja:MemoryModel
; ja:content
[ ja:externalContent <file:sampledata.ttl>
]
.
<#graph3> a ja:UnionModel
; ja:subModel <#graph1>
; ja:subModel <#graph2>
.
<#server> a joseki:Server
.
<#service> a joseki:Service
; joseki:serviceRef "sparql"
; joseki:dataset
[ a ja:RDFDataset
; ja:namedGraph
[ ja:graphName <http://example.org/#graph1>
; ja:graph <#graph1>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#graph2>
; ja:graph <#graph2>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#uniongraph>
; ja:graph <#graph3>
]
]
; joseki:processor
[ a joseki:Processor
; module:implementation
[ a joseki:ServiceImpl
; module:className <java:org.joseki.processors.SPARQL>
]
]
.
-----------------------------------
When I save this into the Joseki directory and execute
$ export JOSEKIROOT=.
$ bin/rdfserver simpleconfig.ttl
And then browse to
http://localhost:2020/sparql?query=select+*+where+%7B+GRAPH+%3Fg+%7B+%3Fs+%3Fp+%3Fo+%7D+%7D&output=text
Post by Paul Murray
Then I get back some triples. Outstanding.
So! Let's try making this go in the d2r copy of joseki!
=== STEP 2 - Make the simple assembler run in joseki in the d2r2
installation ===
Post by Paul Murray
Ok. The d2r root directory does not have an rdf-server executable. It
does have a d2r-server executable. This execuable has an option for a d2r
mapping file, but not for a jena assembler.
Post by Paul Murray
$ ./d2r-server simpleconfig.ttl
15:44:52 WARN org.eclipse.jetty.webapp.WebAppContext :: Failed
startup of context
o.e.j.w.WebAppContext{,file:/Users/ibis/git/d2rq-0.8.1/webapp/},webapp
Post by Paul Murray
de.fuberlin.wiwiss.d2rq.D2RQException: No d2rq:Database defined in
the mapping (E1)
Post by Paul Murray
Fine, that's what I expected. The d2r launcher launches an endpoint that
has one graph, that graph being a d2r graph initialised by the parameter.
It simply doesn't take a general JENA assembler as input.
Post by Paul Murray
So lets have a look at the joseki that's inside d2r. The various files
in the joseki installation are not present. There is a joseki.jar in the
lib directory and that's it.
Post by Paul Murray
Let's try launching joseki using the same method that rdfserver in the
JAVA_ARGS is just "-server -Xmx1G" , which we can ignore.
LOG is -Dlog4j.configuration=${LOGCONFIG}, which we can also ignore
And CP will have to be all the lib files in the joseki directory
$ CP=$(find lib -name *.jar | while read j ; do echo -n "$j:" ; done)
$ java -cp $CP joseki.rdfserver simpleconfig.ttl
org/mortbay/jetty/Connector
Post by Paul Murray
at joseki.rdfserver.main(rdfserver.java:85)
Riiiiight. In any case, this at the very least isn't going to work
because the WEB-INF won't be set up right. The joseki config alone isn't
enough - the d2r installation isn't set up correctly to expose the joseki
SPARQL endpoint as a service.
Post by Paul Murray
================= NEW PLAN =================
OK! New plan - we will include the d2r libraries in the joseki launch!
Well, there's a fair bit of duplication there, which is not a big
problem. Except that there are some different versions of some of the
libraries, which is bad.
Post by Paul Murray
Let's just make a humungous classpath and launch Joseki with the D2R
libraries jammed in there. What could possibly go wrong? First, I'll try
putting the joseki libraries first.
Post by Paul Murray
$ CP=$(find lib -name \*.jar | while read j ; do echo -n "$j:" ;
done):$(find ~/git/d2rq-0.8.1/lib -name \*.jar | while read j ; do echo -n
"$j:" ; done)
Post by Paul Murray
$ java -cp $CP joseki.rdfserver simpleconfig.ttl
SLF4J has a bit of a bitch about a class being in two of the jars, but
apart from that it's all good.
Post by Paul Murray
So - let's try adding in a d2r assembler
Copy simpleconfig.ttl to withd2r.ttl, and add a mapping to the assembler.
<#graph4> a d2rq:D2RQModel;
d2rq:mappingFile <simplemapping.ttl>;
d2rq:resourceBaseURI <http://localhost:2020/test123>;
.
<#service> a joseki:Service
; joseki:serviceRef "sparql"
; joseki:dataset
[ a ja:RDFDataset
; ja:namedGraph
[ ja:graphName <http://example.org/#graph1>
; ja:graph <#graph1>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#graph2>
; ja:graph <#graph2>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#uniongraph>
; ja:graph <#graph3>
]
; ja:namedGraph
[ ja:graphName <http://example.org/#d2rqgraph>
; ja:graph <#graph4>
]
]
; joseki:processor
[ a joseki:Processor
; module:implementation
[ a joseki:ServiceImpl
; module:className <java:org.joseki.processors.SPARQL>
]
]
.
Ok, blows up with a
the root
file:///Users/ibis/Software/Joseki/Joseki-3.4.4/withd2r.ttl#graph4 has no
most specific type that is a subclass of ja:Object
Post by Paul Murray
This is ok - now I understand what that import is for :) . So lets
include the import
Post by Paul Murray
<> ja:imports <http://d2rq.org/terms/d2rq> .
This blows up with a
file:///Users/ibis/Software/Joseki/Joseki-3.4.4/simplemapping.ttl
Post by Paul Murray
Which is awesome! The assembler loads and tries to do what I told it to
do. Booyah! I'm excited, but I've been this excited before and been cruelly
disappointed, all my hopes dashed.
Post by Paul Murray
So now I need to create a simple d2r mapping file and name it
simplemapping.ttl
Post by Paul Murray
----------------------------------------------
@prefix map: <#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
@prefix jdbc: <http://d2rq.org/terms/jdbc/> .
@prefix d2r: <
http://sites.wiwiss.fu-berlin.de/suhl/bizer/d2r-server/config.rdf#> .
Post by Paul Murray
@prefix nsl: <http://biodiversity.org.au/voc/nsl/NSL#> .
map:Configuration a d2rq:Configuration;
d2rq:serveVocabulary true
.
map:APNI_database a d2rq:Database;
d2rq:jdbcDriver "org.postgresql.Driver";
d2rq:jdbcDSN "jdbc:postgresql://localhost:5432/nsl";
d2rq:username "--DELETED--";
d2rq:password "--DELETED--";
.
map:APNI_Namespace a d2rq:ClassMap;
d2rq:dataStorage map:APNI_database;
d2rq:uriPattern "
d2rq:class nsl:Namespace;
d2rq:class nsl:IdentifiedEntity;
.
--------------------------------------------------
And launch - It launches! Run the query - and it complains that the
database is down. Of course.
Post by Paul Murray
Start the database, run the query ... And I get an error
Implementing class
Post by Paul Murray
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Post by Paul Murray
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at
de.fuberlin.wiwiss.d2rq.algebra.CompatibleRelationGroup.addNodeRelation(CompatibleRelationGroup.java:53)
Post by Paul Murray
at
de.fuberlin.wiwiss.d2rq.algebra.CompatibleRelationGroup.groupNodeRelations(CompatibleRelationGroup.java:38)
Post by Paul Murray
Damn.
Ok - what if I load up the classpath with the d2r libraries first and
the joseki libraries second?
Post by Paul Murray
$ CP=$(find ~/git/d2rq-0.8.1/lib -name \*.jar | while read j ; do echo
-n "$j:" ; done):$(find lib -name \*.jar | while read j ; do echo -n "$j:"
; done)
Post by Paul Murray
$ java -cp $CP joseki.rdfserver withd2r.ttl
and browse to
http://localhost:2020/sparql?query=select+*+where+%7B+GRAPH+%3Fg+%7B+%3Fs+%3Fp+%3Fo+%7D+%7D&output=text
Post by Paul Murray
and
--------------------------------------------------
OMG! OMG! It works! It works!
So: it seems I can make it go by launching joseki but putting all the
d2r libraries in the classpath first. It's a little fragile, and what I
would like is to not to have to do this - to have a prepackaged setup that
works. Obviously the d2r installation has a bunch of stuff I don't need -
the gear that supports the d2r web app pages. I still have not confirmed
that it will co-operate with the multi-gigabyte TDB datasets I need to use.
But ... it does seem to go. I can write a java app to scan the jar files
and find which ones declare the same class names, to arrive at a set of
jars that don't overlap.
Post by Paul Murray
Hopefully, sometime next week I'll be able to show you the new system
serving the old and the new data together at biodiversity.org.au. But for
now, it's 16:45 on Friday which makes it Beer O'Clock.
------------------------------------------------------------------------------
Post by Paul Murray
Dive into the World of Parallel Programming The Go Parallel Website,
sponsored
Post by Paul Murray
by Intel and developed in partnership with Slashdot Media, is your hub
for all
Post by Paul Murray
things parallel software development, from weekly thought leadership
blogs to
Post by Paul Murray
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
Paul Murray
2015-03-03 00:44:48 UTC
Permalink
Post by Richard Cyganiak
Just what I love as the first thing in my inbox on an early Friday morning: A nine-page, highly technical report that makes my caffeine-deprived head hurt, and ends with a declaration that the author has already made it to the weekend! ;-)
1. Any Issues (bugs, feature requests) against D2RQ, stating what we should change/fix? These should go here: https://github.com/d2rq/d2rq/issues
Done. https://github.com/d2rq/d2rq/issues/265
Post by Richard Cyganiak
2. Something tutorial-like that’s clear enough to share on the D2RQ wiki? https://github.com/d2rq/d2rq/wiki
On my list :)

Just to restate it - the horrible, intractable difficulties I was having were caused by using an older version of SDB. The newer version used the same version of ARQ as D2RQ, and it all seems to work fine.
Loading...