Difference between revisions of "Sparql endpoint/Examples"

From Openresearch
Jump to: navigation, search
(Created page with "===== Query 1, find events which have country location, city location, start date, end date, and home page ===== <pre> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PRE...")
(No difference)

Revision as of 17:22, 21 February 2017

Query 1, find events which have country location, city location, start date, end date, and home page
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX swivt: <http://semantic-mediawiki.org/swivt/1.0#>
PREFIX property: <http://openresearch.org/Special:URIResolver/Property-3A>
PREFIX category: <http://openresearch.org/Special:URIResolver/Category-3A>
PREFIX wiki: <http://openresearch.org/Special:URIResolver/>
PREFIX icaltzd: <https://www.w3.org/2002/12/cal/icaltzd#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?event ?endDate ?startDate ?city ?country ?wikipage ?homepage WHERE {
  ?e property:Has_location_country category:Germany.
  ?e rdfs:label ?event.
  ?e property:Has_location_city ?city.
  ?e property:Has_location_country ?country.
  ?e icaltzd:dtend ?endDate.
  ?e icaltzd:dtstart ?startDate.
  ?e foaf:homepage ?homepage.
  ?e swivt:page ?wikipage.
} ORDER BY DESC(?startDate) LIMIT 100