query-d4fa420513f270db175aa4eb2ef9709b
TODO
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#>
SELECT DISTINCT ?item ?itemLabel ?enddate (group_concat(distinct ?denomLabel;separator=", ") as ?denomination) ?inception (group_concat(distinct ?architectLabel;separator=", ") as ?architects) WHERE {
{
SELECT DISTINCT ?item ?denom ?inception ?architect WHERE {
?item wdt:P131* wd:Q365 .
OPTIONAL { ?item wdt:P140 ?denom .
?item wdt:P571 ?inception .
?item wdt:P84 ?architect.}
}
}.
?item p:P31 ?statementNode .
?statementNode ps:P31/wdt:P279* wd:Q16970 .
OPTIONAL {
?statementNode pq:P582 ?enddate .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language 'de,en'.
?item rdfs:label ?itemLabel.
?denom rdfs:label ?denomLabel.
?architect rdfs:label ?architectLabel. }
} group by ?item ?itemLabel ?enddate ?inception
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?architect")
v9("?architectLabel"):::projected
v11("?architects")
v2("?denom")
v8("?denomLabel"):::projected
v10("?denomination")
v6("?enddate"):::projected
v3("?inception"):::projected
v1("?item"):::projected
v7("?itemLabel"):::projected
v5("?statementNode")
a1((" "))
c12(["bd:serviceParam"]):::iri
c9(["wd:Q16970"]):::iri
c14(["de,en"]):::literal
c2(["wd:Q365"]):::iri
v1 --"p:direct/P131"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P140".-> v2
v1 --"p:direct/P571"--> v3
v1 --"p:direct/P84"--> v4
end
v1 --"p:P31"--> v5
v5 --"p:statement/P31"--> a1
a1 --"p:direct/P279"--> c9
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P582".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
v1 --"rdfs:label"--> v7
v2 --"rdfs:label"--> v8
v4 --"rdfs:label"--> v9
end
bind2[/"?denomLabel"/]
v8 --o bind2
bind2 --as--o v10
bind3[/"?architectLabel"/]
v9 --o bind3
bind3 --as--o v11