Querying: Difference between revisions

Jump to navigation Jump to search
Line 100: Line 100:
  group by ?number
  group by ?number
  order by ?number
  order by ?number
===Sancak status ending between 1830 and 1840===
This query will return a region more than once, if it undergoes status change more than once during this time period.[https://tinyurl.com/2ew6y2vw run]
SELECT ?sancak ?sancakLabel (YEAR(?starttime) as ?start) (YEAR(?endtime) as ?end)
WHERE
{
  ?sancak ogt:P6 og:Q1.
  ?sancak ogp:P15 ?statement.
  ?statement ogps:P15 og:Q4.
  ?statement ogpq:P7 ?starttime.
  OPTIONAL{?statement ogpq:P8 ?endtime.}
  OPTIONAL{?statement ogpq:P22 ?endtime.}
  FILTER(YEAR(?endtime) >= 1830 && YEAR(?endtime) <= 1840) 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
ORDER BY (?endtime)


== Federated query with Wikidata ==
== Federated query with Wikidata ==

Navigation menu