Alison,
The general idea is correct, but two of the { in the query have no }, so I'm
not sure about the relationship between the query's two triple patterns.
Another issue is that the triple pattern ?someObject ?remotePredicate
?remoteObject will match all triples, and the remote service will probably
not like that and time out.
Here's a similar SERVICE example query that works from TBC 3.5. Note that I
picked a deliberately obscure DBpedia predicate because I knew that it would
match a reasonable amount of triples instead of timing out:
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?remoteObject
WHERE {
SERVICE <http://DBpedia.org/sparql>
{
?someObject dbpedia-owl:orderInOffice ?remoteObject .
}
}
The SERVICE keyword is often handy for sending a complete query off to a
remote SPARQL endpoint, like this:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX : <http://dbpedia.org/resource/>
SELECT DISTINCT ?successorName
WHERE
{
SERVICE <http://DBpedia.org/sparql>
{
SELECT ?successorName WHERE
{
:Abraham_Lincoln <http://dbpedia.org/ontology/successor> ?successor
.
?successor rdfs:label ?successorName .
FILTER ( lang(?successorName) = "en" )
}
}
}
SERVICE is one of the cooler new things in SPARQL 1.1.
Bob DuCharme
TopQuadrant
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of alymay
Sent: Wednesday, July 06, 2011 2:59 AM
To: TopBraid Suite Users
Subject: [topbraid-users] passing a SPARQL result to a remote graph using
SERVICE
Hi is it possible to pass a SPARQL SELECT result to a remote graph
using SERVICE - something like this:
SELECT distinct ?remoteObject
WHERE {
?someSubject :somePredicate ?someObject .
{
SERVICE <http://remoteService>
{
?someObject ?remotePredicate ?remoteObject .
}
If so what is the correct syntax?
Thanks
Alison
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en