使用SPARQL从dbpedia资源中选择一个属性值 [英] Select a property value from dbpedia resource with SPARQL

查看:195
本文介绍了使用SPARQL从dbpedia资源中选择一个属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在DBpedia上使用SPARQL查询。
我可以使用此查询检索有关资源的所有信息:

i'm trying to use SPARQL query on DBpedia. I can retrieve all information about a resource with this query:

PREFIX db: <http://dbpedia.org/resource/
PREFIX prop: <http://dbpedia.org/property/>
PREFIX onto: <http://dbpedia.org/ontology/>
SELECT ?property ?value 
WHERE { db:Luciano_Ligabue ?property ?value  };

现在,我只想检索dbpedia-owl这样一个属性的值:birthDate。
我正在尝试不同的方式,但是我无法获取所需的信息。

Now I want to retrieve the value of just one property such as dbpedia-owl: birthDate. I'm trying in different way, but i can't retrieve the information needed.

有人可以帮助我吗?
谢谢大家。

Can someone help me, please? Thank you guys.

推荐答案

您需要向我们显示您所使用的确切查询。您提供的不是合法的SPARQL。 sparql.org验证器指出应该有一个> 放在 PREFIX db的末尾:< http://dbpedia.org/resource/ ,并且不应有; 在最后一行。因此,您的查询似乎没有返回您想要的结果;这甚至不是合法的查询。

You need to show us the exact query you're using. The one you've provided isn't legal SPARQL. The sparql.org validator points out that there should be a > at the end of PREFIX db: <http://dbpedia.org/resource/, and that there should be no ; at the final line. So your query doesn't appear to return what you want it to; it's not even a legal query.

DBpedia有时响应速度有些慢,所以我现在无法测试,但听起来您只需要(我使用的前缀与 DBpedia端点使用的原因是,它使复制和粘贴更加容易,但是您已经定义了 db :代替 dbpedia: onto:代替 dbpedia -owl:):

DBpedia is sometimes a bit slow to respond, so I can't test this right now, but it sounds like you just need (I'm using the same prefixes that the DBpedia endpoint uses, because it makes copying and pasting easier, but you've defined db: instead of dbpedia: and onto: instead of dbpedia-owl:):

select ?value where {
  dbpedia:Luciano_Ligabue dbpedia-owl:birthDate ?value
}

这篇关于使用SPARQL从dbpedia资源中选择一个属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆