wiki:SesameDeveloping

Sesame Developing

Implementation Plan

  • We will start by implementing a HTTPSail class that fails on most methods and then start implementing one after another.
  • HTTPSail needs to be configured with the Server address (URL), username/password, perhaps repository ID.
  • First step will be to implement the Querying functionality using HTTP requests and the query result parser. Select and Construct queries will be interesting here.
  • When this works, we can move on to add and delete single triples and see how this behaves.
  • The transaction bit will then "evolve" on the way, when we know more about the protocol.

Good JUnit test should accompany the process. All details below.

Work on the SPARQL Protocol and Client

At the moment we need a SPARQL conformant interface to Sesame2, and as there is none I know of, the power of open source allows us to write one. <img src="http://www.openrdf.org/images/openrdf-text.png" alt="openrdf" /> <b> My first question is: did somebody already write a Servlet that does map Sesame2 servers to the SPARQL protocol?</b>

At the moment sesame2 does not support full SPARQL querying, but it will soon. We don't have to insist on SPARQL as query language, we can pass in SERQL queries and treat them like they were SPARQL, but we have to start with a conformant servlet :-)

Then some longer questions I also asked on the Sesame developer mailinglist:

We think that a SPARQL protocol conformant HTTP servlet is most important for any use of Sesame2 and are willing to invest 10 hours a week into this, more precisely, a clever student worker. We hope to get this done until the end of September.

SPARQL Protocol in Sesame 2

We would implement a SPARQL protocol conformat query server and a <a href="http://www.openrdf.org/issues/browse/SES-205">SPARQL protocol conformant query client (issue tracker)</a> for the reading operations of a HTTPSail. For updates of the model, we would stick to the current implementation of the latest CVS of sesame2. To be precise: what is missing is an implementation of a SAIL that communicates over HTTP with a remote store, and a way to serialize transactional data over the line. But the actual protocol is already there, and described in a document in org.openrdf.sesame.server.http.protocol.txt.

  • The Protocol of Sesame2 (org.openrdf.sesame.server.http.RepositoryServlet) is conformant to the SPARQL protocol, as defined in the WSDL. This has to be confirmed, though.

According to Jeen Broekstra, this protocol is a superset of SPARQL Protocol: The protocol as implemented in that servlet (and as described in the text and the system documentation) is a superset of SPARQL protocol. That is, the query-handling part should be SPARQL-conformant, but it implements operations (such as upload, removal, etc.) that are not part of SPARQL as well.

want to know what the <a href="http://www.w3.org/TR/rdf-sparql-protocol/">sparql protocol is</a>?

We do not have a WSDL description of it though so that makes it a bit more laborious to compare I guess. But just look at how HTTP bindings in SPARQL protocol work: it's a GET request with a query parameter and some optional stuff. If you compare feature-by-feature you'll quickly see that they are the same. If you do find discrepancies I'd be very interested in hearing about them.

More questions

I understand that these are MANY questions, I tried to think of all the calamities we are going to face in the next months. And I expect that some hackers out there already handled half of these questions, so don't hesitate to write <a href="mailto:leo.sauermann@…">me</a>, or <a href="http://leobard.twoday.net/stories/2536840/comment">comment here</a>, or to the <a href="http://sourceforge.net/mailarchive/forum.php?forum_id=9004">sesame devel list</a>.

  • If not, does anybody know how to generate stubs for the servlets automatically (so that they strictly conform to the protocol)?
    • Not interesting here, server is done.
  • We could examine the Jena / Joseki implementation, as it serves as reference implementation.
    • We could use Jena to talk to Sesame and Sesame HTTP Client to talk to Jena. Trick or treat.
  • Is there also a parser for query results, that can be used on the Client side HTTP sail to read results written by the server?
    • Yes. Sesame 2 supports various serializations for query results (SPARQL XML, binary, JSON) and has parsers and writers for all them. Package

org.openrdf.sesame.queryresult.

  • What is the status of the HTTP Client? Did anybody do since we last mailed? if yes, please add comments to this ticket:

http://www.openrdf.org/issues/browse/SES-205

  • Not much progress unfortunately, my time has been eaten up by other stuff.
  • Is the query string already part of the Query object? Jeen said this is a prerequisite for this hack. If not, Jeen: could you do this? This is such a core thing that I don't want to touch it and for you its probably only 50 lines of code. I mean the solution 1) suggested here: http://www.openrdf.org/issues/browse/SES-205#action_10533
    • Jeen will pick this issue up ASAP (possibly in cooperation with Sebastian).
  • Can Sesame2 serialize Query results according to the SPARQL protocol? I see the QueryResultFormat.SPARQL which would indicate that.
  • Do you have a debug environment to test the existing servlets from org.openrdf.sesame.server.http?
    • Not really. We both work in Eclipse but actual testing of the servlets is usually done through manual deployment and test runs. Not very nifty

but since most of our servlets are pretty straightforward it's doable. Obviously most of the business logic in Sesame itself is tested using Junit tests (found in the test/ dir). We do have a test class there for testing the HTTP protocol (i.e. the servlet) but it's hardly a robust set of tests.

  • Does the WebClient work? (the code looks SOOO COOL! spring rocks) - I cannot find any code in the webclient project that actually *changes* triples... hm.
    • Herko ter Horst started working on it, building on Jeen's earlier work, but it is obviously not finished. Other issues are more pressing. It will be continued as soon as possible.
    • Write support depends on the Client HTTP Sail Implementation.
  • When Sebastian starts hacking, whom can he jabber/icq for help?
    • Jeen & Arjohn via e-mail and the Sesame-Devel mailinglist.
  • last but not least: any news about SPARQL query support?
    • This depends on Arjohn, who is continually working on it.
Last modified 18 years ago Last modified on 08/16/06 19:57:25