简体   繁体   中英

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:

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.

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).

Does anyone know how I can achieve this?

There is not property in DBpedia with the domain 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. You can check this also if you look at particular properties from your referred list, eg 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}
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM