Querying: Difference between revisions

→‎Sample queries: kaza count per year
(→‎Sample queries: kaza count per year)
Line 44: Line 44:
  }
  }
  ORDER BY desc(?duration)
  ORDER BY desc(?duration)
=== Number of kazas created each year ===
In each year, how many kazas were inaugurated? [https://tinyurl.com/2z9gjrch run]
SELECT ?year (COUNT (DISTINCT ?kaza) AS ?count)
WHERE
{
  ?kaza ogt:P15 og:Q3.
  ?kaza ogp:P15 ?statement.
  ?statement ogps:P15 og:Q3.
  ?statement ogpq:P7 ?starttime.
  bind(year(?starttime) as ?year)
}
GROUP BY ?year
ORDER BY desc(?count)


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