jack m
jack m

Reputation: 41

How can get information about sport in Germany from dbpedia using SPARQL query

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

Answers (1)

Joshua Taylor
Joshua Taylor

Reputation: 85813

Fixing the Query

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:labels 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 .
}

SPARQL results

Asking about sport in Germany

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

SPARQL results

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

Related Questions