Thanks for the tips Andy. I finally solved the problem with them.
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 my piece of code I created the repository with the repositoryID as
ds/sparql
String endpointFuseki = "http://localhost:3030/";
> String repositoryID="ds/sparql"
>
> HTTPRepository endPoint = new HTTPRepository(endpointFuseki,
> repositoryID);
>
2012/11/20 Andy Seaborne <[email protected]>
> If the log isn't showing anything, then requests aren't arriving at Fuseki
> within Jetty. That means a URL is sent that isn't routed to a n endpoint.
> Usually, the URL is wrong.
>
> You have named a Sesame repository
> http://localhost:3030/ds/**sparql<http://localhost:3030/ds/sparql>-- but that
> in Fuseki is a SPARQL endpoint, not a Sesame repository
>
> http://www.openrdf.org/doc/**sesame2/system/ch08.html<http://www.openrdf.org/doc/sesame2/system/ch08.html>says:
>
> """
> Queries on a specific repository with ID <ID> can be evaluated by sending
> requests to: <SESAME_URL>/repositories/<ID>**.
> """
> e.g.
> GET /openrdf-sesame/repositories/**mem-rdf?query
>
> so my guess is that it is attaching "/repositories" to the address you
> specified and hence the SPARQL endpoint it uses is not actually the one you
> pass in.
>
> You might try:
>
> HTTPRepository("http://**localhost:3030/ds <http://localhost:3030/ds>",
> "")
> HTTPRepository("http://**localhost:3030/ <http://localhost:3030/>", "ds")
>
> if then sesame constructs the right URL for the SPARQL endpoint by adding
> the /query and filling in ?query= but it is inserts /repositories, it's
> not going to work.
>
> The reverse works for me: sesame server and SOH/Fuseki command line tools:
>
> s-query --service 'http://localhost:8080/**openrdf-workbench/**
> repositories/ds/query<http://localhost:8080/openrdf-workbench/repositories/ds/query>'
> 'ASK{}'
>
> Or try running Fuseki with a dataset at "/repositories/ds"
>
> Andy
>
>
>
> On 19/11/12 22:24, David Perez-Lopez wrote:
>
>> Thanks for answering Andy,
>>
>> Just in case it helps these is the piece of code I'm using for testing the
>> connection. Again if I use the URL stored in the variable endpointAEMT, it
>> works but if I do it with the one in endpointFuseki it doesn't.
>>
>> public static void main(String[] args) {
>>
>> // Doesn't work with
>> String endpointFuseki =
>> "http://localhost:3030/ds/**sparql<http://localhost:3030/ds/sparql>
>> ";
>>
>> // Works with Virtuoso endpoint
>> String endpointAEMT =
>> "http://aemet.linkeddata.es/**sparql<http://aemet.linkeddata.es/sparql>
>> ";
>>
>> try {
>> HTTPRepository endPoint = new HTTPRepository(endpointFuseki,
>> "");
>> 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();
>> }
>> }
>>
>>
>>
>>
>> And the log shows something like:
>>
>>> 15:41:22 INFO [1] 404 Service Description: /ds/sparql
>>> ?
>>>
>>>
>> In fact in my method call there is no trace in the server terminal
>>
>> If a request is sent without a query, it's a service description request
>>
>>> (which you can't set yet).
>>>
>>> Try in a browser you get:
>>> [[
>>> Error 404: Service Description: /ds/sparql
>>> ]]
>>>
>>> You need a query.
>>>
>>> In a browser try:
>>>
>>> http://localhost:3030/ds/**sparql?query=ASK{}&output=text<http://localhost:3030/ds/sparql?query=ASK%7B%7D&output=text>
>>>
>>> (a simple query - force output to text)
>>>
>>> This is the SPARQL protocol which sesame supports (it's not chnaged for
>>> SPARQL 1.1). There needs to be ?query or the POSTed form equivalent.
>>>
>>>
>> The browser replies with yes
>>
>>
>> I've tried with the Firefox addons firebug & tamperData to change the form
>> method to GET and modify the accepts and the parameters sent in the POST
>> variables to try to reproduce the same environment that are sent with the
>> Sesame connector, it keeps working with the browser but no lack with the
>> connector.
>>
>>
>