Apr 162012
 

Did you know that bigdata has a built-in REST API for client-server access to the RDF database? We call this interface the “NanoSparqlServer”, and it’s API is outlined in detail on the wiki:

https://sourceforge.net/apps/mediawiki/bigdata/index.php?title=NanoSparqlServer

What’s new with the NSS is that we’ve recently added a Java API around it so that you can write client code without having to understand the HTTP API or make HTTP calls directly. This is why there is suddenly a new dependency on Apache’s HTTP Components in the codebase. The Java wrapper is called “RemoteRepository”. If you’re comfortable writing application code against the Sesame SAIL/Repository API you should feel pretty at home with the RemoteRepository class. Not exactly the same, but very very similar.

The class itself is pretty self-explanatory but if you like examples, there is a test case for every API call in RemoteRepository in the class TestNanoSparqlClient. (That test case also conveniently demonstrates how to launch a NanoSparqlServer wrapping a bigdata journal using Jetty, which it does at the beginning of every test.)

  2 Responses to “Client-Server API”

  1. Hi,
    Am having issues understanding how to install/configure bigdata? The documentation isn’t clear enough. For instance, do I need to have a sesame repository to create a bigdata store? What’s the difference between the endpoint localhost:8080/bigdata and nanosparql endpoint? Are they the same? I will be loading data to the rdf store remotely, do i do that through the REST service or can I programmatically do it through the API?

  2. Have you checked out the “Getting Started” page on the wiki?

    https://sourceforge.net/apps/mediawiki/bigdata/index.php?title=GettingStarted

    Basically, once you have a journal properties file set up and your journal is created, you can either work with it directly (embedded) via the Sesame SAIL/Repository API or you can work with it client-server through the NSS. The NSS is just a web service. TestNanoSparqlClient shows you how to set up the web service through Jetty. There is also an ant task to bundle a war for use in Tomcat.

    By Sesame repository are you talking about the Sesame Server, or just the SAIL/Repository API? The NSS is a replacement for the Sesame Server, which does not interact well with bigdata’s concurrency semantics. The SAIL/Repository API is still the easiest way to interact with bigdata, for loading data or otherwise. The NSS is for when you need to add a remoting layer.

    You can load data through the NSS, but for bulk loading large amounts of data we recommend the java class DataLoader, which must be run directly against the journal.