-5

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.

FrankTan
  • 1,626
  • 6
  • 28
  • 63

2 Answers2

0

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.

Derek Brown
  • 4,232
  • 4
  • 27
  • 44
Charbel
  • 26
  • 4
0

i think i need to know the resource first but for example for the 1. i can do ...

SELECT *
where
{
 <http://dbpedia.org/resource/Name_x> dc:description ?p.
 <http://dbpedia.org/resource/Name_x> foaf:surname ?y
 <http://dbpedia.org/resource/Name_x> foaf:name ?y
 <http://dbpedia.org/resource/Name_x> foaf:office ?y
}       

im checking the others

FrankTan
  • 1,626
  • 6
  • 28
  • 63