SPARQL query against DBPedia to get all property-v

2020-05-07 18:01发布

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}

2条回答
等我变得足够好
2楼-- · 2020-05-07 18:48

I am giving you the query which will give you information about Apple Company rather than apple Fruit.

PREFIX dbprop: <http://dbpedia.org/property/>
PREFIX db: <http://dbpedia.org/resource/>
SELECT ?property, ?value WHERE {db:Apple_Inc ?property ?value}
查看更多
来,给爷笑一个
3楼-- · 2020-05-07 19:01

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

Working query:

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

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

查看更多
登录 后发表回答