Reputation: 41
How can I get information about sports in Germany from DBpedia using SPARQL? What SPARQL query can get that information? I used this SPARQL query, but I get no results!
SELECT * WHERE {
?c a dbpedia.org/ontology/Country .
?c rdfs:label dbpedia:Germany .
}
Upvotes: 1
Views: 572
Reputation: 85813
The query you posted is malformed. Attempting to run it on the public DBpedia SPARQL endpoint produces an error. The reference dbpedia.org/ontology/Country
should be dbpedia-owl:Country
, and rdfs:label
s are usually strings, so "Germany"@en
should replace dbpedia:Germany
. The corrected query, however, just returns a single result, http://dbpedia.org/resource/Germany.
SELECT * WHERE {
?c a dbpedia-owl:Country .
?c rdfs:label "Germany"@en .
}
Without more information about what kind of data you're trying to obtain, the simplest answer for querying about sport in Germany is that you should ask DBpedia to describe sport in Germany for you, almost literally. The following query is legal SPARQL that you can paste into the public DBpedia endpoint.
describe dbpedia:Sport_in_Germany
There is a Wikipedia article Sport in Germany, and DBpedia's naming convention is such that there is a corresponding DBpedia resource, dbpedia:Sport_in_Germany, which the previous query describes.
Upvotes: 0