简体   繁体   English

使用sparql查询在dbpedia中查找特定人员

[英]Finding specific person in dbpedia using sparql query

So I'm learning SPARQL and trying to get a specific person out of dbpedia using a SPARQL query. 因此,我正在学习SPARQL,并尝试使用SPARQL查询使特定的人脱离dbpedia。 I'm using their endpoint at https://dbpedia.org/sparql to do this query. 我正在使用https://dbpedia.org/sparql上的端点进行此查询。 The person I'm trying to find is Albert Einstein . 我要寻找的人是爱因斯坦。 I found on his page that he has a property of dbp:name. 我在他的页面上发现他具有dbp:name属性。 So I wrote a query to find Albert Einstein by his name: 所以我写了一个查询来查找爱因斯坦的名字:

select ?person where {?person <http://dbpedia.org/property/name> "Albert Einstein"} LIMIT 100

Unfortunately, this gives me just an empty result set (I think) as i'm justing seeing an empty table with the header of 'Person' 不幸的是,这给了我一个空的结果集(我认为),因为我只是看到一个空表,其标题为“ Person”

What's going wrong? 怎么了

I'm not sure why your query doesn't work, but this one does: 我不确定为什么您的查询不起作用,但是这一查询可以做到:

select ?person where {?person foaf:name "Albert Einstein"@en} LIMIT 100

Though this returns all entities named "Albert Einstein", which includes the scientist, but also an album of the same name. 尽管这会返回所有名为“阿尔伯特·爱因斯坦”的实体,其中包括科学家,但也有一个同名专辑。 If you want just people, you can use: 如果只需要人,则可以使用:

select ?person
where {
  ?person foaf:name "Albert Einstein"@en.
  ?person a foaf:Person.
}
LIMIT 100

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM