Discussion:
Federated query
Kamalraj Jairam
2015-03-16 00:37:03 UTC
Permalink
Hello,

if i create federated query like

CONSTRUCT
{ ?s <http://localhost/target#patientId> ?o .}
WHERE
{ SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
{ ?s <http://localhost.com/traleerdf/csv#ID> ?o }
SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
{ ?s <http://localhost.com/db#patient_patientid> ?o }
}
LIMIT 10

will jena always send a select query to the endpoints?

I’m getting the following exception i execute this query

om.hp.hpl.jena.sparql.resultset.ResultSetException: skipToHead: Unexpected tag: {http://www.w3.or
Andy Seaborne
2015-03-16 10:12:41 UTC
Permalink
Post by Kamalraj Jairam
Hello,
if i create federated query like
CONSTRUCT
{ ?s <http://localhost/target#patientId> ?o .}
WHERE
{ SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
{ ?s <http://localhost.com/traleerdf/csv#ID> ?o }
SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
{ ?s <http://localhost.com/db#patient_patientid> ?o }
}
LIMIT 10
will jena always send a select query to the endpoints?
I’m getting the following exception i execute this query
om.hp.hpl.jena.sparql.resultset.ResultSetException: skipToHead: Unexpected tag: {http://www.w3.org/1999/02/22-rdf-syntax-ns#}RDF
Thanks
Kamalraj
Yes - SERVICE is always a SELECT, with HTTP headers for SPARQL results sets.

Andy
Mark Feblowitz
2015-03-16 13:05:21 UTC
Permalink
That reminds me of a question I have: for a DISTINCT result from the service, would one embed a SELECT DISTINCT within the SERVICE statement? Or is that assumed to be performed in the enclosing context?

Mark
Post by Andy Seaborne
Post by Kamalraj Jairam
Hello,
if i create federated query like
CONSTRUCT
{ ?s <http://localhost/target#patientId> ?o .}
WHERE
{ SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
{ ?s <http://localhost.com/traleerdf/csv#ID> ?o }
SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
{ ?s <http://localhost.com/db#patient_patientid> ?o }
}
LIMIT 10
will jena always send a select query to the endpoints?
I’m getting the following exception i execute this query
om.hp.hpl.jena.sparql.resultset.ResultSetException: skipToHead: Unexpected tag: {http://www.w3.org/1999/02/22-rdf-syntax-ns#}RDF
Thanks
Kamalraj
Yes - SERVICE is always a SELECT, with HTTP headers for SPARQL results sets.
Andy
Rob Vesse
2015-03-16 14:12:40 UTC
Permalink
You'd need to embed SELECT DISTINCT inside the SERVICE statement

SERVICE { Foo }

Translates to SELECT * WHERE { Foo } on the remote endpoint, Foo can be a
sub-query if you want to apply modifiers to the remote query

Rob
Post by Mark Feblowitz
That reminds me of a question I have: for a DISTINCT result from the
service, would one embed a SELECT DISTINCT within the SERVICE statement?
Or is that assumed to be performed in the enclosing context?
Mark
Post by Andy Seaborne
Post by Kamalraj Jairam
Hello,
if i create federated query like
CONSTRUCT
{ ?s <http://localhost/target#patientId> ?o .}
WHERE
{ SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
{ ?s <http://localhost.com/traleerdf/csv#ID> ?o }
SERVICE <http://localhost:8084/processor/webresources/rs/sparql>
{ ?s <http://localhost.com/db#patient_patientid> ?o }
}
LIMIT 10
will jena always send a select query to the endpoints?
I’m getting the following exception i execute this query
Unexpected tag: {http://www.w3.org/1999/02/22-rdf-syntax-ns#}RDF
Thanks
Kamalraj
Yes - SERVICE is always a SELECT, with HTTP headers for SPARQL results sets.
Andy
Continue reading on narkive:
Loading...