[英]How to query all properties of owl:Thing of dbpedia using SPARQL?
When I use the following SPARQL query I get all properties of the DBpedia class Country:当我使用以下 SPARQL 查询时,我获得了 DBpedia 类 Country 的所有属性:
select ?range ?domain ?prop ?label
Where{
?class rdfs:subClassOf{0,1} ?domain.
?prop rdfs:domain ?domain.
?prop rdfs:range ?range.
?prop rdfs:label ?label.
FILTER(lang(?label) = 'en')
FILTER(?class = <http://dbpedia.org/ontology/Country>)
}
When I try to do this with 'Thing' or 'OWL:Thing' or 'A Thing' or anything equivalent instead of Country, I get an empty result.当我尝试使用 'Thing' 或 'OWL:Thing' 或 'A Thing' 或任何等价物代替 Country 执行此操作时,我得到一个空结果。
I want to adopt the ontology of DBpedia's owl:Thing, so I want to retrieve all properties ofhttp://mappings.dbpedia.org/server/ontology/classes/owl%3AThing (including labela and range).我想采用DBpedia的owl:Thing的本体,所以我想检索http://mappings.dbpedia.org/server/ontology/classes/owl%3AThing的所有属性(包括labela和range)。
Does anyone know how I can achieve this?有谁知道我如何实现这一目标?
There is not property in DBpedia with the domain owl:Thing
: DBpedia 中没有域
owl:Thing
属性:
select * {
?prop rdfs:domain owl:Thing
}
The reason for this is probably that if no explicit domain is given, owl:Thing
is the trivial domain.这样做的原因可能是如果没有给出明确的域,
owl:Thing
就是平凡的域。 You can check this also if you look at particular properties from your referred list, eg dbo:abbreviation如果您查看参考列表中的特定属性,您也可以检查这一点,例如dbo:abbreviation
Workaround query:解决方法查询:
SELECT ?range (owl:Thing as ?domain) ?prop ?label {
VALUES ?type {owl:DatatypeProperty owl:ObjectProperty}
?prop a ?type
OPTIONAL {?prop rdfs:range ?range }
?prop rdfs:label ?label.
FILTER(langmatches(lang(?label), 'en'))
FILTER NOT EXISTS {?prop rdfs:domain ?domain}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.