W3C home > Mailing lists > Public > semantic-web@w3.org > January 2007

Re: Sesame: getting the underlying SailConnection from a Connection

From: Jeen Broekstra <jeen.broekstra@aduna-software.com>
Date: Fri, 19 Jan 2007 12:10:42 +0100
Message-ID: <45B0A732.70007@aduna-software.com>
To: Aldo Bucchi <aldo.bucchi@gmail.com>
CC: semantic-web@w3.org

Aldo Bucchi wrote:

> I am trying to keep two repositories in sync. One of them is a sesame
> Repository running in a java app, the other one is a Jena Model
> running on another java app.
> Don't ask why jaja, it's just the way it is.
> Well, the thing is that one of them is the main repository ( the
> sesame one ) and the other one is just a mirror.
> I was thinking of listening to sailconnection events ( add and remove
> statements ) and generate a simple rdfxml package with the delta (
> additions and removals ) that can be easily sent over the wire to the
> jena side, but I haven't been able to understand the correct place to
> hook the listeners.
> I am modifying the sesame Repository through
> Repository.getConnection().etc() methods, so I need a way to get hold
> of the underlying SailConnection.

I think this question would probably be more appropriate at Sesame's web
forum[1] or (since it's a question about Sesame 2, which is still under
development) the Sesame developers mailinglist[2], but to give a brief
answer to your question anyway: you can get a hold of the underlying
Sail by using Repository.getSail() (note that in the current SVN version
of Sesame 2 this method has been moved from the Repository interface to
the specific SailRepository implementation). Then, you should register
yourself (well... an object you created anyway ;)) on the Sail as a
SailChangedListener. You will then be notified of any changes to the Sail.

A delta is a bit difficult to realize at present, since the
SailChangedEvent does not currently give you that information - we are
considering extending it to do so though.




[1] http://www.openrdf.org/forum/
[2] https://lists.sourceforge.net/lists/listinfo/sesame-devel
Aduna - Guided Exploration

Prinses Julianaplein 14-b
3817 CS Amersfoort
The Netherlands
+31-33-4659987 (office)
Received on Friday, 19 January 2007 11:14:53 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 08:44:59 UTC