reteplayground
Aggregate

Which municipality has the most species diversity

SELECT ?muni (COUNT(?t) AS ?trees) (COUNT(DISTINCT ?tx) A…
  ?t a tci:Tree ; tci:inMunicipality ?m ; tci:taxon ?tx .
  ?m rdfs:label ?muni
}
GROUP BY ?muni ORDER BY DESC(?species) LIMIT 20
Run this query → no server · no download · no account
caviri.github.io/rete
Run this query in the playground → no server, no download — the query runs in your browser.

The query

PREFIX tci: <https://data.graphplaza.com/tree-city-inventory/ns#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?muni (COUNT(?t) AS ?trees) (COUNT(DISTINCT ?tx) AS ?species) WHERE { ?t a tci:Tree ; tci:inMunicipality ?m ; tci:taxon ?tx . ?m rdfs:label ?muni } GROUP BY ?muni ORDER BY DESC(?species) LIMIT 20

rete playground · documentation · github.com/caviri/rete