我是 OpenData 的新手,并尝试在 SPARQL 中编写查询。
我的目标是获取以下一组标准的数据: - 类别:Home_automation - 从“事物”类型中选择所有项目 - 在“是产品”中至少有一个条目 - 具有带有德语描述的图片网址
我尝试了以下方法:
PREFIX cat: <http://dbpedia.org/resource/Category:>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT *
WHERE {
cat:Home_automation skos:broader ?x
}
但现在我不知道如何将其他过滤器添加到 where 子句。我尝试使用更广泛的用户:... 来获取项目,但我认为这是错误的方向。
我用以下方法测试了查询:https://dbpedia.org/sparql
结果应该是:
| (label) | (url)
|--------------------------|-----------------------------------
|"Kurzzeitwecker"@de | urls to the picture of the device
|"Staubsauger"@de | -||-
|"Waschmaschine"@de | -||-
|"Geschirrspülmaschine"@de | -||-
请问有人有什么建议吗?
更新:新查询:
PREFIX cat: <http://dbpedia.org/resource/Category:>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?s ?label WHERE {
?s ?p cat:Home_automation .
?s rdf:type owl:Thing .
?s rdfs:label ?label
FILTER (LANG(?label)='de')
}
order by ?p