Search code examples
sparqldbpedia

How to query dbpedia for baseball players full names and date of birth


I would like to query this ontology http://dbpedia.org/ontology/BaseballPlayer for full name and date of birth of each player but it seems like I'm doing something wrong.

Is this SPARQL query correct? Unfortunately it doesn't return any results.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX onto: <http://dbpedia.org/ontology/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?uri 
WHERE 
{
        ?subject rdfs:label 'baseball player'@en .
        ?uri foaf:givenName ?uri

}

Solution

  • select * where {
      ?s a dbo:BaseballPlayer ;
         foaf:name ?name ;
         dbo:birthDate ?birthDate 
    }
    

    SPARQL results