本文介绍了使用SPARQL从DBpedia获取美国物理学家的名单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查询并获取物理学家列表。我该怎么做?

I want to query the American Physicsts and get the list of physicists. How can I do this?

推荐答案

您需要的SPARQL看起来像这样....

The SPARQL you need would look like this ....

PREFIX category: <http://dbpedia.org/resource/Category:>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT *
WHERE {
  ?s dcterms:subject category:American_physicists .
}

查看结果

如果您想要带有更多谓词的列表,则需要使用变量?s 联接更多三元模式。例如,要检索每个物理学家的生日...

If you want the list with some extra predicates you need to join more triple patterns using the variable ?s. For instance, to retrieve the birthdate for each physicist ...

PREFIX category: <http://dbpedia.org/resource/Category:>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dbpedia: <http://dbpedia.org/ontology/>

SELECT *
WHERE {
  ?s dcterms:subject category:American_physicists .
  ?s dbpedia:birthDate ?bithdate .
}

结果

这篇关于使用SPARQL从DBpedia获取美国物理学家的名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 06:21