对另一个sparql查询的所有结果执行sparql查询

时间:2017-03-09 15:59:32

标签: sparql

假设我有一个从sparql查询返回的名称列表。另一个查询使用此列表中的名称并返回其他内容。如何对其他查询返回的列表中的所有名称执行此查询?谢谢

1 个答案:

答案 0 :(得分:2)

您使用子查询。例如,

select ?country ?capital {
  { select ?country {
      #-- criteria for selecting country
  }

  ?country :hasCapital ?country
}

请注意,在琐碎的情况下,您不需要单独的子查询,您可以这样做:

select ?country ?capital {
  #-- criteria for selecting country
  ?country :hasCapital ?country
}
相关问题