DBpedia SPARQL and predicate connection
I've got a problem with the DBpedia SPARQL endpoint because the properties of the properties like the label of rdf:type
are not stocked in the endpoint. So when I run this query:
SELECT *
WHERE{
<http://dbpedia.org/ontology/Place> ?predicat ?object .
OPTIONAL{?predicat rdfs:label ?label}
}
I've got nothing for ?label.
If someone got any idea to solve this problem 开发者_开发技巧it would be very helpful.
You can't get the real labels from DBpedia because the SPARQL endpoint doesn't have them. But you can take the local name of the property URI. So, for rdfs:subClassOf you'd get "subClassOf". That's better than nothing. This can be done using Virtuoso's (non-standard) bif:regexp_replace
function.
SELECT DISTINCT (bif:regexp_replace(STR(?p), "^.*[/#]", "") AS ?label) WHERE {
<http://dbpedia.org/ontology/Place> ?p ?o .
}
I don't think there's a SPARQL solution. Dbpedia doesn't have the data you want, and I couldn't easily find a SPARQL endpoint for that RDF at W3C. And I don't think the Virtuoso dbpedia endpoint supports federation yet, even if we did find a SPARQL endpoint for W3C.
Happy to be proven wrong on any of those points.
精彩评论