Re: Basic federation in Jena

2012-07-31 Thread Olivier Rossel
Oops, the webpage I mentionned had wrong code.

The correct code to run my query is:
QueryExeuction exec =
QueryExecutionFactory.create(QueryFactory.create(yourfederatedquery,
Syntax.syntaxARQ), new
DatasetImpl(ModelFactory.createDefaultModel()));
exec.execSelect();

Forcing the syntax to Syntax.syntaxARQ is mandatory because
client-side federation is a ARQ-specific feature.


On Tue, Jul 31, 2012 at 9:40 AM, Olivier Rossel
olivier.ros...@gmail.com wrote:
 Hi all.

 I would like 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

2012-07-31 Thread Andy Seaborne

On 31/07/12 08:52, Olivier Rossel wrote:

Oops, the webpage I mentionned had wrong code.

The correct code to run my query is:
QueryExeuction exec =
QueryExecutionFactory.create(QueryFactory.create(yourfederatedquery,
Syntax.syntaxARQ), new
DatasetImpl(ModelFactory.createDefaultModel()));
exec.execSelect();

Forcing the syntax to Syntax.syntaxARQ is mandatory because
client-side federation is a ARQ-specific feature.


Only in very old versions of ARQ - SERVICE is part of SPARQL 1.1




On Tue, Jul 31, 2012 at 9:40 AM, Olivier Rossel
olivier.ros...@gmail.com wrote:

Hi all.

I would like 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

2012-07-31 Thread Andy Seaborne

(same question as yesterday)

A few problems:

1/ Talis are turning off their online service so 
http://api.talis.com/... will stop working sometime.  If this is a 
paid-for store, that wil be in several months; if hosted for free, it'll 
happen in the next few days.


2/ The services have a 30s timeout - if that goes off, you get no 
results from the SERVICE.


3/ DBpedia has

4/ You can use a subselect to restrict the remote query part:


SERVICE ... {
   SELECT * {
   ...
   } LIMIT 300
}

4/ Execution is bottom up:

The second block:

SERVICE http://dbpedia.org/sparql
  { ?thCenturyClassicalComposers0 rdf:comments  ?comment }

may be executed repeatedly due to the execution strategty of ARQ

but when I try:

PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
SELECT * { ?thCenturyClassicalComposers0 rdfs:comments  ?comment }

at the DBpedia sparql endpoint I get:

Error HTTP/1.1 509 Bandwidth Limit Exceeded

Andy

On 31/07/12 08:40, Olivier Rossel wrote:

Hi all.

I would like 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

2012-07-31 Thread Olivier Rossel
 Forcing the syntax to Syntax.syntaxARQ is mandatory because
 client-side federation is a ARQ-specific feature.

 Only in very old versions of ARQ - SERVICE is part of SPARQL 1.1

As far as I understand, SERVICE in SPARQL 1.1 is server-side federation.
And you have no way to federate with local data.

Whereas Syntax.syntaxARQ forces Jena-ARQ to be the federation
query planner. And each SPARQL endpoint receives a part of the query
with variables
correctly pre-bound and no SERVICE keyword.

Is that right?