query-d2989aa6fa2c909c5a2b8f18f57ace54

rq turtle/ttl

Map displaying works with coordinate location (P625)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: Works of public art in Boston neighborhoods
#defaultView:Map{"markercluster":"true"}
SELECT distinct ?work ?workLabel ?coords ?address
(SAMPLE(?image) AS ?image) 
(group_concat(distinct (year(?date)); separator=" or ") as ?year)
(group_concat(distinct ?materialLabel; separator="; ") as ?materials)
(group_concat(distinct ?categoryLabel; separator="; ") as ?categories)
(group_concat(distinct ?creatorLabel; separator="; ") as ?creators)

where {

  ?work wdt:P5008 wd:Q108040915;
        wdt:P136 wd:Q557141;
        wdt:P625 ?coords;
        wdt:P31 ?category.
  optional{?work wdt:P571 ?date.}
  optional{?work wdt:P18 ?image.}
  optional{?work wdt:P170 ?creator.}
  optional{?work wdt:P6375 ?address.}
  optional{?work wdt:P186 ?material.}
  SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". 
                         ?work rdfs:label ?workLabel.
                          ?category rdfs:label ?categoryLabel.
                          ?creator rdfs:label ?creatorLabel.
                          ?material rdfs:label ?materialLabel
                         }
 } group by ?work ?workLabel ?coords ?address

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?address"):::projected v15("?categories") v3("?category") v10("?categoryLabel"):::projected v2("?coords"):::projected v6("?creator") v11("?creatorLabel"):::projected v16("?creators") v4("?date"):::projected v13("?image"):::projected v8("?material") v12("?materialLabel"):::projected v14("?materials") v1("?work"):::projected v9("?workLabel"):::projected v13("?year") c4(["wd:Q557141"]):::iri c13(["bd:serviceParam"]):::iri c2(["wd:Q108040915"]):::iri c15(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"wdt:P5008"--> c2 v1 --"wdt:P136"--> c4 v1 --"wdt:P625"--> v2 v1 --"wdt:P31"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P571".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P18".-> v13 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P170".-> v6 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P6375".-> v7 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P186".-> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 v1 --"rdfs:label"--> v9 v3 --"rdfs:label"--> v10 v6 --"rdfs:label"--> v11 v8 --"rdfs:label"--> v12 end bind5[/"sample(?image)"/] v13 --o bind5 bind5 --as--o v13 bind6[/"year-from-dateTime(?date)"/] v4 --o bind6 bind6 --as--o v13 bind7[/"?materialLabel"/] v12 --o bind7 bind7 --as--o v14 bind8[/"?categoryLabel"/] v10 --o bind8 bind8 --as--o v15 bind9[/"?creatorLabel"/] v11 --o bind9 bind9 --as--o v16