Reputation: 1
Suppose I have a list of names returned from a sparql query. And another query that uses a name from this list and returns something else. How can I execute this query on all names in the list returned by the other query? Thank you
Upvotes: 0
Views: 120
Reputation: 85923
You use a subquery. E.g.,
select ?country ?capital {
{ select ?country {
#-- criteria for selecting country
}
?country :hasCapital ?country
}
Note that in trivial cases, you wouldn't need a separate subquery, you could just do:
select ?country ?capital {
#-- criteria for selecting country
?country :hasCapital ?country
}
Upvotes: 2