query-1a297ddc1c0efae4a3c66d9434a72ebb
21:11, 1 March 2021 (UTC)) talk (Elya--(please ping me for an answer)Thanks!
Use at
- https://query.wikidata.org/sparql
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT
?item ?itemLabel
?coords
(SAMPLE(?img) as ?image)
(MIN(YEAR(?date)) as ?year)
(GROUP_CONCAT(DISTINCT ?architectLabel;separator=", ") AS ?architects)
WHERE
{
?item wdt:P166 wd:Q1795794;
p:P166 [ps:P166 ?award; pq:P585 ?date].
OPTIONAL{
?item wdt:P625 ?coords.
}
OPTIONAL{
?item wdt:P18 ?img. # might be more than one. I want the first one
}
OPTIONAL {
?item wdt:P84 ?architect. # up to 7 per ?item, needs grouping
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de".
?item rdfs:label ?itemLabel .
?architect rdfs:label ?architectLabel .
}
}
GROUP BY ?item ?itemLabel ?coords
LIMIT 300
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?architect")
v8("?architectLabel"):::projected
v11("?architects")
v2("?award")
v4("?coords"):::projected
v3("?date"):::projected
v9("?image")
v5("?img"):::projected
v1("?item"):::projected
v7("?itemLabel"):::projected
v10("?year")
a1((" "))
c12(["#91;AUTO_LANGUAGE#93;,de"]):::literal
c10(["bd:serviceParam"]):::iri
c2(["wd:Q1795794"]):::iri
v1 --"p:direct/P166"--> c2
a1 --"p:statement/P166"--> v2
a1 --"p:qualifier/P585"--> v3
v1 --"p:P166"--> a1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P625".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P18".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P84".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
v1 --"rdfs:label"--> v7
v6 --"rdfs:label"--> v8
end
bind3[/"sample(?img)"/]
v5 --o bind3
bind3 --as--o v9
bind4[/"min(year-from-dateTime(?date))"/]
v3 --o bind4
bind4 --as--o v10
bind5[/"?architectLabel"/]
v8 --o bind5
bind5 --as--o v11