I've set-up a SPARQL endpoint with fuseki with the following options:

$ java -Xmx1200M -jar fuseki-server.jar --update --mem /ds
14:02:23 INFO  Server               :: Dataset: in-memory
14:02:23 INFO  Server               :: Dataset path = /ds
14:02:23 INFO  Server               :: Fuseki 0.2.5 2012-10-20T17:03:29+0100
14:02:23 INFO  Server               :: Started 2012/11/19 14:02:23 CET on port 3030

then I've added some data to it /s-put http://localhost:3030/ds/data default /Users/david/desarrollo/proyectos/trunk-pom/pom-sparql/src/test/resources/ontologies/democomiccon2011.owl

after that I could query easily the dataset through the web interface, and get some results for example:


My next step was to try to connect with the endpoint through a Sesame connector (2.6.0) using the URL http://localhost:3030/ds/sparql but I got a 404 error.

Previously, I had been able to connect successfully to a Virtuoso server through the same connector, namely to http://aemet.linkeddata.es/sparql

I debugged both connections the one with virtuoso virtuoso connection debug and the one with fuseki fuseki connection debug trying to find differences, but without success. Feel free to check both text files attached

I also tried to simulate the call with Poster extension for firefox and as you can see in the image the GET request works but the POST doesn't Poster extension get/post requests to fuseki server

Any clues of how could I connect to fuseki through a sesame connector? Does it only supports GET requests? Thanks in advance

asked 19 Nov '12, 09:09

davidpl1985's gravatar image

accept rate: 0%

A plain request to /sparql is (SPARQL 1.1. Protocol) a request for the service description - as there isn't one yet, you get a 404. Try from a browser and you'll get text to that effect.

The server log will show the request was received.

A query has /sparql?query=...

permanent link

answered 19 Nov '12, 10:51

AndyS's gravatar image

AndyS ♦
accept rate: 33%

edited 19 Nov '12, 12:49

Signified's gravatar image

Signified ♦

Finally solved, with the tips that Andy S provided in the fuseki mail list. If you want to have a look at the whole discussion check http://markmail.org/message/bootb7tlrg35luou

The problem was that the Sesame repository and the repository ID were not aligned with Fuseki. For my sesame connector the sesame repository always hangs from /repositories so I had to take it into account when defining the dataset in Fuseki.

Therefore, I launched fuseki with the dataset: /repositories/ds

  $ java -Xmx1200M -jar fuseki-server.jar --update --mem /repositories/ds
    18:35:45 INFO  Server               :: Dataset: in-memory
    18:35:45 INFO  Server               :: Dataset path = /repositories/ds
    18:35:45 INFO  Server               :: Fuseki 0.2.5 2012-10-20T17:03:29+0100
    18:35:45 INFO  Server               :: Started 2012/11/20 18:35:45 CET on port 3030

and in the piece of code to connect to fuseki I created the repository with a repositoryID of ds/sparql

 public static void main(String[] args) {

        String endpointFuseki = "http://localhost:3030/";
        String repositoryID="ds/sparql"

    try {
        HTTPRepository endPoint = new HTTPRepository(endpointFuseki, repositoryID);

        RepositoryConnection conn =  endPoint.getConnection();
        try {
            String sparqlQuery = "SELECT * WHERE {?X ?P ?Y} LIMIT 10 ";
            TupleQuery query = conn.prepareTupleQuery(QueryLanguage.SPARQL, sparqlQuery);
            TupleQueryResult result = query.evaluate();

            while (result.hasNext()) {
                // do something linked and open
        } finally {
        catch (Exception e) {
permanent link

answered 21 Nov '12, 07:40

davidpl1985's gravatar image

accept rate: 0%

Hey Mr. David ! I am working on fuseki and i want to use virtoso instead of jena TDB. Can you help me for this ? Thanx in advance.

(17 Jan '15, 13:51) Nauman Ramzan Nauman%20Ramzan's gravatar image

This answer, while probably correct in 2012, is currently out of date. Sesame features a separate type of Repository, the SPARQLRepository, which is specifically intended for use with querying remote SPARQL endpoints, and does not require that the dataset at the remote end resides at a specific address.

(19 Jan '15, 01:04) Jeen Broekstra ♦ Jeen%20Broekstra's gravatar image

@Nauman Ramzan please do not post followup question as answers. If you have a new question, please post it as a new question. Have a look at the FAQ and the Welcome message to learn how to best use this site.

(19 Jan '15, 01:06) Jeen Broekstra ♦ Jeen%20Broekstra's gravatar image

The standard way to connect to any (non-Sesame) SPARQL endpoint (including Fuseki) using the Sesame APIs is as follows:

 String endpointUrl = "http://example.org/sparql"; // the SPARQL endpoint URL
 Repository endpoint = new SPARQLRepository(endpointUrl);

After that you can use the endpoint like any other Sesame Repository, by creating a connection and doing queries on that:

 RepositoryConnection conn = endpoint.getConnection();
 try {
    String query = "SELECT * WHERE {?s ?p ?o } LIMIT 10";
    TupleQueryResult result = conn.prepareTupleQuery(QueryLanguage.SPARQL, query).evaluate();
 finally {

Bonus advantage of using SPARQLRepository is that it automatically maps other API methods to equivalent SPARQL queries, e.g the following will work on any SPARQL endpoint:

 URI john = conn.getValueFactory().createURI("urn:john");
 // get all type information for john
 RepositoryResult<Statement> typeStmts = conn.getStatements(john, RDF.TYPE, null));
permanent link

answered 20 Jan '15, 18:00

Jeen%20Broekstra's gravatar image

Jeen Broekstra ♦
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 19 Nov '12, 09:09

question was seen: 3,032 times

last updated: 20 Jan '15, 18:00