-
Notifications
You must be signed in to change notification settings - Fork 2
/
microheights_avgheight_observations_geo_v2.rq
37 lines (30 loc) · 1.35 KB
/
microheights_avgheight_observations_geo_v2.rq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX heightscountry: <https://iisg.amsterdam/microheights/code/country/>
PREFIX microheights: <https://iisg.amsterdam/microheights/>
PREFIX microdim: <https://iisg.amsterdam/microheights/dimension/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
select ?cor ?iso_height ?country_cshapes ?countrydate ?observations ?wkt ?wktTooltip ?wktColor {
{
select ?countrydate ?iso_height ?cor ?wkt ?country_cshapes (COUNT(?indiv) as ?observations) (avg(?height) as ?avg_height) {
{
?indiv microdim:ht_cm ?height .
?indiv microdim:bdec ?birthdecade .
?indiv microdim:age ?age .
?indiv microdim:countryOfResidence ?cor .
?cor microdim:isoAlpha2 ?iso_height .
?country_cshapes <https://iisg.amsterdam/vocab/isoAlpha2> ?iso_cshapes .
?country_cshapes <https://iisg.amsterdam/vocab/cowEnd> ?countrydate .
?country_cshapes geo:hasGeometry / geo:asWKT ?wkt
BIND(STR(?iso_cshapes) as ?iso_cshapes2)
FILTER(REGEX(?iso_height, "[A-Z]"))
FILTER(?iso_height = ?iso_cshapes2)
FILTER (?countrydate > "2000-01-01"^^xsd:date)
FILTER(?age > 19)
}
}
}
bind((?avg_height) as ?wktTooltip)
bind((bif:log((?observations / 58)) / 8) as ?observations2)
bind(concat('viridis,', str(?observations2)) as ?wktColor) .
}