开发者

How do I write a SPARQL query? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applic开发者_Go百科able, visit the help center. Closed 12 years ago.

How would I make a SPARQL query about rivers that flow into the Rhine, that are longer than 50 kilometers?


Using DBpedia you could do something like this...

SELECT ?river ?riverName ?length
WHERE {
  ?river <http://dbpedia.org/ontology/riverMouth> <http://dbpedia.org/resource/Rhine> .
  ?river <http://dbpedia.org/ontology/length> ?length .
  FILTER (?length > 50000)
  ?river <http://www.w3.org/2000/01/rdf-schema#label> ?riverName .
  FILTER (lang(?riverName) = "en")
}
ORDER BY ?riverName

I'm assuming the length property in DBpedia uses meters, but you should check. You can test the query at http://dbpedia.org/sparql.

If this was homework and I just gave you the answer, I'd encourage you browse around at http://dbpedia.org/page/Rhine to see how I came up with it :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜