query-67292d435b01cf053e8799962cab9c44
Graph view of banks
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Graph
SELECT DISTINCT ?subj ?subjLabel (YEAR(?startdt) AS ?from) (YEAR(?enddt) AS ?to) ?rgb ?hplaceLabel ?successor ?successorLabel ?succbegin ?succstop
WHERE
{
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
VALUES ?bustypes {
wd:Q22687
}
?subj wdt:P31/wdt:P279* ?bustypes .
?subj wdt:P131 ?admin.
?admin wdt:P131 ?adminup.
{?subj wdt:P131 wd:Q22.}.
OPTIONAL {?subj wdt:P159 ?hplace. }.
?subj wdt:P571 ?startdt.
FILTER (YEAR(?startdt) < 1990 && YEAR(?startdt) > 1300).
FILTER (?subj != wd:Q971680).#ugly Clydesdale
OPTIONAL {?subj wdt:P131 ?admin. }.
OPTIONAL {?subj wdt:P576 ?enddt.}
OPTIONAL {?subj wdt:P1056 ?didwhat.}
OPTIONAL {?subj wdt:P156 ?successor}. OPTIONAL {?subj p:P156 ?sid.
OPTIONAL {?sid pq:P585 ?succbegin.}. OPTIONAL {?sid pq:P580 ?succbegin.}.
OPTIONAL { ?sid pq:P582 ?succstop}.}.
OPTIONAL {?subj wdt:P7888 ?successor}. OPTIONAL {?subj p:P7888 ?sid.
OPTIONAL {?sid pq:P585 ?succbegin.}. OPTIONAL {?sid pq:P580 ?succbegin.}.
OPTIONAL { ?sid pq:P582 ?succstop}.}.
BIND(IF(BOUND(?successor), "faf082", IF(BOUND(?enddt),"fca9af","a8f777")) AS ?rgb).
#BIND(IF(YEAR(?startdt)<1800,"121212","00FF00") AS ?rgb).
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?admin")
v5("?adminup")
v3("?bustypes")
v8("?didwhat")
v7("?enddt"):::projected
v14("?from")
v6("?hplace")
v13("?rgb"):::projected
v10("?sid")
v2("?startdt"):::projected
v1("?subj"):::projected
v11("?succbegin"):::projected
v9("?successor"):::projected
v12("?succstop"):::projected
v15("?to")
a1((" "))
c11(["wd:Q22"]):::iri
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?subj != 'wd:Q971680'"]]
f0 --> v1
f1[["year-from-dateTime(?startdt) < '1990^^xsd:integer'year-from-dateTime(?startdt) > '1300^^xsd:integer'"]]
f1 --> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind2[/VALUES ?bustypes/]
bind2-->v3
bind20(["wd:Q22687"])
bind20 --> bind2
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> v3
v1 --"p:direct/P131"--> v4
v4 --"p:direct/P131"--> v5
v1 --"p:direct/P131"--> c11
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P159".-> v6
end
v1 --"p:direct/P571"--> v2
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P131".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P576".-> v7
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P1056".-> v8
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P156".-> v9
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:P156".-> v10
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v10 -."p:qualifier/P585".-> v11
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v10 -."p:qualifier/P580".-> v11
end
subgraph optional8["(optional)"]
style optional8 fill:#bbf,stroke-dasharray: 5 5;
v10 -."p:qualifier/P582".-> v12
end
end
subgraph optional9["(optional)"]
style optional9 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P7888".-> v9
end
subgraph optional10["(optional)"]
style optional10 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:P7888".-> v10
subgraph optional11["(optional)"]
style optional11 fill:#bbf,stroke-dasharray: 5 5;
v10 -."p:qualifier/P585".-> v11
end
subgraph optional12["(optional)"]
style optional12 fill:#bbf,stroke-dasharray: 5 5;
v10 -."p:qualifier/P580".-> v11
end
subgraph optional13["(optional)"]
style optional13 fill:#bbf,stroke-dasharray: 5 5;
v10 -."p:qualifier/P582".-> v12
end
end
bind3[/"if(bound(?successor),'faf082',if(bound(?enddt),'fca9af','a8f777'))"/]
v9 --o bind3
v7 --o bind3
bind3 --as--o v13
bind4[/"year-from-dateTime(?startdt)"/]
v2 --o bind4
bind4 --as--o v14
bind5[/"year-from-dateTime(?enddt)"/]
v7 --o bind5
bind5 --as--o v15