query-5bf39a32816a42bf55c15e01ce57dd22
layer per tipografiQualcosa mi sfugge, non piglia il layer, forse perchè conto i ?workp nella SELECT? Inoltre se aggiungo ?start ?end in SELECT smette di contare i ?workp. Ho chiesto anche su "richiedi una query" ma non mi si filano :)
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT DISTINCT (COUNT(?workp) as ?number) ?coord ?layer
WHERE {
?item wdt:P31 wd:Q5; wdt:P937 ?workp; wdt:P106 ?activity .
?workp wdt:P625 ?coord; wdt:P17 wd:Q38.
values ?activity { wd:Q175151 wd:Q1229025 wd:Q998550 wd:Q2516866 wd:Q40881196 }
?item wdt:P2031 ?start.
?item wdt:P2032 ?end.
FILTER ("1450"^^xsd:dateTime < ?start).
FILTER ("1500"^^xsd:dateTime > ?end).
BIND( IF(?number < 5, "0-4", IF(?number < 10, "5-9", IF(?number < 15, "10-14", IF(?number < 20, "15-19", IF(?number < 25, "20-24","25+"))))) AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "it, en". }
}
GROUP BY ?coord ?layer
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?activity")
v6("?coord"):::projected
v1("?end")
v3("?item")
v7("?layer"):::projected
v8("?number")
v2("?start")
v4("?workp"):::projected
c15(["it, en"]):::literal
c9(["wd:Q38"]):::iri
c13(["bd:serviceParam"]):::iri
c4(["wd:Q5"]):::iri
f0[["'1500^^xsd:dateTime' > ?end"]]
f0 --> v1
f1[["'1450^^xsd:dateTime' < ?start"]]
f1 --> v2
v3 --"wdt:P31"--> c4
v3 --"wdt:P937"--> v4
v3 --"wdt:P106"--> v7
v4 --"wdt:P625"--> v6
v4 --"wdt:P17"--> c9
bind2[/VALUES ?activity/]
bind2-->v7
bind20(["wd:Q175151"])
bind20 --> bind2
bind21(["wd:Q1229025"])
bind21 --> bind2
bind22(["wd:Q998550"])
bind22 --> bind2
bind23(["wd:Q2516866"])
bind23 --> bind2
bind24(["wd:Q40881196"])
bind24 --> bind2
v3 --"wdt:P2031"--> v2
v3 --"wdt:P2032"--> v1
bind3[/"if(?number < '5^^xsd:integer','0-4',if(?number < '10^^xsd:integer','5-9',if(?number < '15^^xsd:integer','10-14',if(?number < '20^^xsd:integer','15-19',if(?number < '25^^xsd:integer','20-24','25+')))))"/]
v8 --o bind3
bind3 --as--o v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end
bind5[/"count(?workp)"/]
v4 --o bind5
bind5 --as--o v8