jango
jango

Reputation: 1

executing sparql query on all the result of another sparql query

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

Answers (1)

Joshua Taylor
Joshua Taylor

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

Related Questions