Skip to content
Joshua Shinavier edited this page Jul 10, 2016 · 11 revisions

LinkedDataServer is a RESTful web service to publish a Sesame data store as Linked Data. Given any Sail containing RDF data which you would like to make available, LinkedDataServer will publish it on the Web in accordance with Linked Data principles. It also provides a standards-compliant SPARQL endpoint.

As the resources your data describes are often in a URI space other than your own domain, LinkedDataServer maps URIs on the fly; you only need to give it the base URI of your internal resources and the base URI of the resources as you would like them to appear in the Linked Data.

Here is a usage example:

Sail = new MemoryStore();
sail.initialize();

[add some data to the Sail]

LinkedDataServer server = new LinkedDataServer(
    sail,
    "http://example.org",
    "http://localhost:8182",
    8182);

server.getRouter().attach("/person", WebResource.class);
server.getRouter().attach("/graph", GraphResource.class);
server.getHost().attach("/sparql", new SparqlResource());

server.start();

Now if you issue a GET request for an externally-visible URI:

wget --header="Accept: application/rdf+xml" http://localhost:8182/person/arthur

you should receive an RDF description of that resource (internally referred to as http://example.org/person/arthur) after appropriate redirection and content negotiation.

If you execute a SPARQL query against the "/sparql" endpoint:

wget "http://localhost:8182/sparql?query=SELECT%20%3Fs%20%3Fp%20%3Fo%20WHERE%20%7B%20%3Fs%20%3Fp%20%3Fo%20%7D%20LIMIT%2010"

you should receive results in the SPARQL XML format.

To include LinkedDataServer in a Maven-based project, add the following to the project's POM:

        <dependency>
            <groupId>net.fortytwo.sesametools</groupId>
            <artifactId>linked-data-server</artifactId>
            <version>1.10</version>
        </dependency>
Clone this wiki locally