2

I am trying to get some information of the DBpedia page of Rodger Federer. I want to query in which years Roger Federer was flagbearer at the Olympic Games. I can extract information from normal property fields (dbp:plays), but not if the property is of the format (is dbp:flagbearer of).

Can someone give me some advise how to extract the years in which Roger Federer was flagbearer and possibly give a query?

TallTed
  • 9,069
  • 2
  • 22
  • 37

1 Answers1

2

You can get that information using the following query.

PREFIX dbp:<http://dbpedia.org/property/>

select ?olympics ?year where { 
   ?olympics dbp:flagbearer <http://dbpedia.org/resource/Roger_Federer>;
             dbp:games ?year .
}

This query will give you the following results in DBpedia.

+---------------------------------------------+------+
|                  olympics                   | year |
+---------------------------------------------+------+
| dbr:Switzerland_at_the_2008_Summer_Olympics | 2008 |
| dbr:Switzerland_at_the_2004_Summer_Olympics | 2004 |
+---------------------------------------------+------+
Nandana
  • 1,240
  • 8
  • 17