针对DBPedia的SPARQL查询以获取项目的所有属性值 [英] SPARQL query against DBPedia to get all property-value of the item

查看:144
本文介绍了针对DBPedia的SPARQL查询以获取项目的所有属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是语义Web的新手,我想使用SPARQL查询从DBPedia检索苹果的所有属性值对。下面,我在 http://dbpedia.org/sparql 编辑器中编写了查询,但是没有返回任何结果。你能告诉我我在哪里犯错了吗?

I am a novice in Semantic Web and I would like to retrieve all property-value pairs of "apple" from DBPedia using SPARQL query. Below I have written the query in http://dbpedia.org/sparql editor, but it returns no any results.Could you tell me where I make a mistake, please?

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix dbo: <http://dbpedia.org/ontology/>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix prov: <http://www.w3.org/ns/prov#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix dbp: <http://dbpedia.org/property/>
prefix dct: <http://purl.org/dc/terms/>

select * where {<http://http://dbpedia.org/page/Apple> ?property ?value}


推荐答案

您写了 http:// 两次。另外,查询的正确URI是 / resource / ,而不是 / page /

You wrote http:// twice. Also, the correct URI for the query is /resource/, not /page/.

工作查询:

select * where {<http://dbpedia.org/resource/Apple> ?property ?value}

请记住,这将为您提供有关水果的信息,而不是公司的信息。

Keep in mind this will give you information about the fruit, not the company.

这篇关于针对DBPedia的SPARQL查询以获取项目的所有属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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