I'm using JENA TDB Joseki in my work. I need to query multiple datasets and I know that the SPARQL 1.1 allow it, but when I submit any query nothing is returned. Someone can help me please.

I read all FAQs about federated query and none is the same problem.

This is my code:

/ * To change this template, choose Tools | Templates * and open the template in the editor. / package src;

import com.hp.hpl.jena.query.Query; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.query.ResultSetFormatter;

/ * @author nusa / public class FederatedQuery {

    final static String esquemaMediacao = "";

    public static void main(String[] args) {

          String queryString =  
                    "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "  
                    "PREFIX akt: <http://www.aktors.org/ontology/portal#> "  
                    "SELECT * WHERE {  "  
                    "SERVICE <> {?s ?p ?o}" 
                    "LIMIT 10";

            //executando a consulta em cada um dos SPARQL endpoints:

    Query query = QueryFactory.create(queryString);  // exception happens here
    QueryExecution qexec = QueryExecutionFactory.sparqlService(esquemaMediacao,query);

try {
    ResultSet rs = qexec.execSelect();
    if ( rs.hasNext() ) {
        // show the result, more can be done here
catch(Exception e) { 
finally {
System.out.println("\nall done.");

} }

asked 26 Nov '12, 08:54

Danusa%20Ribeiro's gravatar image

Danusa Ribeiro
accept rate: 0%

You will need Fuseki, which replaces Joseki.

If you are using Fuseki: the query endpoint will, if configured correctly, be -- note the /query on the end

  1. Which version?
  2. What happens?
  3. What's the config file?
permanent link

answered 26 Nov '12, 10:48

AndyS's gravatar image

AndyS ♦
accept rate: 33%

Joseki doesn't support federated queries (or Fuseki for that case). Jena, doesn't to my knowledge, include a federated SPARQL query processor on the client and is dependent on support from the SPARQL endpoint itself.

permanent link

answered 26 Nov '12, 09:01

William%20Greenly's gravatar image

William Greenly
accept rate: 13%

Fuseki does support SERVICE.

(26 Nov '12, 10:44) AndyS ♦ AndyS's gravatar image

Thats good to know. Is that everything from SPARQL Fed. Made the assumption based on http://jena.apache.org/documentation/serving_data/index.html

(26 Nov '12, 15:52) William Greenly William%20Greenly's gravatar image
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: 26 Nov '12, 08:54

question was seen: 1,309 times

last updated: 26 Nov '12, 15:52