Search code examples
sparqldbpedia

Sparql queries Sparql queries


I need to query dbpedia using sparql:

  1. input: name of a person output: the surname, sex , age, occupation

  2. input: an organization name output: the founder, if it is public or private

  3. input: a date output: if it is an important date for Example: christians, or Easter

  4. input: a city name output: the state, region of the city.


Solution

  • Here is an example for #4

    First you need to look at the Ontology Class of City in DbPedia. city is described as city

    Select distinct ?city ?location 
    Where 
    {
       ?city a dbo:City.
       ?city dbo:location ?location.
    } 
    LIMIT 100
    

    Then you can the filter clause to get the city you want.