4
1

Hello,

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:

http://localhost:3030/ds/query?query=select+*+where+{%3Fx+%3Fd+%3Fx}&output=xml&stylesheet=%2Fxml-to-html.xsl

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

davidpl1985
836
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 ♦
13.8k37
accept rate: 33%

edited 19 Nov '12, 12:49

Signified's gravatar image

Signified ♦
24.0k1623

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);
        endPoint.initialize();

        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 {
            conn.close();
        }
        catch (Exception e) {
              e.printStackTrace();
          }
}
permanent link

answered 21 Nov '12, 07:40

davidpl1985's gravatar image

davidpl1985
836
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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:

×152
×141
×61

question asked: 19 Nov '12, 09:09

question was seen: 1,704 times

last updated: 21 Nov '12, 07:40