query-1615a0ceda8299533e81025b4444757a

rq turtle/ttl

representation on a map of italian printershi, I'm importing in wikidata data about italian printers from edit16 database and I'd like to document the progress in this project by displaying the workplace of the printers on a map. I started writing this query, I'd like to use layers for cities with a certain numbers of printers but I don't know exactly how (maybe it's the wrong approach). Can i COUNT ?workp and BIND it as ?number? Also, can I limit the scope of the query to ?workp in Italy or Europe? Thanks!

Use at

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 ?item ?coord ?start ?end
WHERE {
  ?item wdt:P31 wd:Q5; wdt:P937 ?workp; wdt:P106 ?activity .
  ?workp wdt:P625 ?coord
  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 ("1850"^^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". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?activity") v6("?coord"):::projected v1("?end"):::projected v3("?item"):::projected v2("?start"):::projected v4("?workp") c13(["it, en"]):::literal c11(["bd:serviceParam"]):::iri c4(["wd:Q5"]):::iri f0[["'1850^^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 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 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end