query-0144572204fe7a7a4985399982b635bf

rq turtle/ttl

23:34, 1 March 2021 (UTC) Jura:. BTW, above a query based on your data: where did the architects study (when known). --- Dipsacus fullonum: good points by @Elya@

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 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#>
# What else did the same architects build? 
#defaultView:Map
SELECT
  ?item ?itemLabel 
  ?coords 
  (SAMPLE(?img) as ?image) 
  (MIN(YEAR(?date)) as ?year) 
  (GROUP_CONCAT(DISTINCT ?architectLabel;separator=", ") AS ?architects)
  (GROUP_CONCAT(DISTINCT ?buildingLabel;separator=", ") AS ?buildings)
WHERE 
{
  ?building p:P166 [ps:P166 wd:Q1795794; a wikibase:BestRank; pq:P585 ?date ].  
  ?building wdt:P84 ?architect.
  ?item wdt:P84 ?architect.
  FILTER NOT EXISTS { ?item wdt:P166 wd:Q1795794 }
  OPTIONAL{ ?item wdt:P18 ?img }
  OPTIONAL{ ?item wdt:P625 ?coords }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de".
                        ?item rdfs:label ?itemLabel .
                        ?architect rdfs:label ?architectLabel .
                        ?building rdfs:label ?buildingLabel .
                          }
} 
GROUP BY ?item ?itemLabel ?coords

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?architect") v8("?architectLabel"):::projected v12("?architects") v3("?building") v9("?buildingLabel"):::projected v13("?buildings") v6("?coords"):::projected v2("?date"):::projected v10("?image") v5("?img"):::projected v1("?item"):::projected v7("?itemLabel"):::projected v11("?year") a1((" ")) c14(["#91;AUTO_LANGUAGE#93;,de"]):::literal c5(["wikibase:BestRank"]):::iri c12(["bd:serviceParam"]):::iri c2(["wd:Q1795794"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:direct/P166"--> e0c2 e0v1("?item"):::projected e0c2(["wd:Q1795794"]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> c2 v1 --"p:direct/P166"--> c2 a1 --"p:statement/P166"--> c2 a1 --"a"--> c5 a1 --"p:qualifier/P585"--> v2 v3 --"p:P166"--> a1 v3 --"p:direct/P84"--> v4 v1 --"p:direct/P84"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P18".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P625".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 v1 --"rdfs:label"--> v7 v4 --"rdfs:label"--> v8 v3 --"rdfs:label"--> v9 end bind5[/"sample(?img)"/] v5 --o bind5 bind5 --as--o v10 bind6[/"min(year-from-dateTime(?date))"/] v2 --o bind6 bind6 --as--o v11 bind7[/"?architectLabel"/] v8 --o bind7 bind7 --as--o v12 bind8[/"?buildingLabel"/] v9 --o bind8 bind8 --as--o v13