You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Olivier Rossel <ol...@gmail.com> on 2012/07/30 11:37:01 UTC

Basic federation in Jena

Hi all.

I want to try Jena basic federation.

I tried this query:
SELECT DISTINCT ?thCenturyClassicalComposers0  WHERE { SERVICE
<http://api.talis.com/stores/bbc-backstage/services/sparql> {
 ?thCenturyClassicalComposers0
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://dbpedia.org/class/yago/20thCenturyClassicalComposers> .
 }} LIMIT 300

with the code provided here:
cf http://tech.groups.yahoo.com/group/jena-dev/message/48130

I get some results.

Now I try this query:

SELECT DISTINCT ?thCenturyClassicalComposers0 ?comment WHERE { SERVICE
<http://api.talis.com/stores/bbc-backstage/services/sparql>
{?thCenturyClassicalComposers0
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://dbpedia.org/class/yago/20thCenturyClassicalComposers> .
 } SERVICE <http://dbpedia.org/sparql> {?thCenturyClassicalComposers0
<http://www.w3.org/2000/01/rdf-schema#comment> ?comment} } LIMIT 300

I get no result.
But when checking data on each endpoint, I should get some results.

Is there something wrong in my SPARQL SERVICE syntax?

BTW,  being able to limit/offset/orderBy and OPTIONALize each SERVICE
block would be uber nice ! ! ! Is it possible already?

Re: Basic federation in Jena

Posted by Tayfun Gökmen Halaç <ta...@gmail.com>.
Dear Olivier,

Your query is OK. Maybe you had another problem except syntax.

You can use a subquery to use LIMIT/OFFSET/ORDERBY for services.
OPTIONAL can be used for any triple pattern in a SERVICE block.

SELECT DISTINCT ?thCenturyClassicalComposers0 ?comment ?optvar WHERE {
{ SELECT ?thCenturyClassicalComposers0 ?tayfun WHERE {
SERVICE <http://api.talis.com/stores/bbc-backstage/services/sparql>
{?thCenturyClassicalComposers0
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://dbpedia.org/class/yago/20thCenturyClassicalComposers> .
OPTIONAL { ?thCenturyClassicalComposers0 <http://example.com/property>
?optvar }  }
} ORDER BY ?thCenturyClassicalComposers0
}
SERVICE <http://dbpedia.org/sparql> {?thCenturyClassicalComposers0
<http://www.w3.org/2000/01/rdf-schema#comment> ?comment}
} LIMIT 10

Best,

Tayfun Gokmen Halac

2012/7/30 Olivier Rossel <ol...@gmail.com>:
> Hi all.
>
> I want to try Jena basic federation.
>
> I tried this query:
> SELECT DISTINCT ?thCenturyClassicalComposers0  WHERE { SERVICE
> <http://api.talis.com/stores/bbc-backstage/services/sparql> {
>  ?thCenturyClassicalComposers0
> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
> <http://dbpedia.org/class/yago/20thCenturyClassicalComposers> .
>  }} LIMIT 300
>
> with the code provided here:
> cf http://tech.groups.yahoo.com/group/jena-dev/message/48130
>
> I get some results.
>
> Now I try this query:
>
> SELECT DISTINCT ?thCenturyClassicalComposers0 ?comment WHERE { SERVICE
> <http://api.talis.com/stores/bbc-backstage/services/sparql>
> {?thCenturyClassicalComposers0
> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
> <http://dbpedia.org/class/yago/20thCenturyClassicalComposers> .
>  } SERVICE <http://dbpedia.org/sparql> {?thCenturyClassicalComposers0
> <http://www.w3.org/2000/01/rdf-schema#comment> ?comment} } LIMIT 300
>
> I get no result.
> But when checking data on each endpoint, I should get some results.
>
> Is there something wrong in my SPARQL SERVICE syntax?
>
> BTW,  being able to limit/offset/orderBy and OPTIONALize each SERVICE
> block would be uber nice ! ! ! Is it possible already?