query-a0b49c5936cf703a8cfe7e2c618a927b
Colleges and Permanent Private Halls with coats of arms and official web sites
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:Map{"hide": ["?location"]}
SELECT DISTINCT ?web ?collegeLabel (IF(BOUND(?hq), ?hq, ?coord) as ?location) ?arms WHERE {
{?college wdt:P31 wd:Q2581649} UNION {?college wdt:P31 wd:Q3338504}
MINUS {?college wdt:P576 []}
OPTIONAL { ?college p:P159/pq:P625 ?hq }
OPTIONAL { ?college wdt:P625 ?coord }
?college wdt:P94 ?arms;
wdt:P856 ?web
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?arms"):::projected
v1("?college")
v3("?coord"):::projected
v2("?hq"):::projected
v6("?location")
v5("?web"):::projected
a1((" "))
a2((" "))
c3(["wd:Q3338504"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal
c11(["bd:serviceParam"]):::iri
c2(["wd:Q2581649"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P31"--> c3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P31"--> c2
end
union0r <== or ==> union0l
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"p:direct/P576"--> a1
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:P159".-> a2
a2 --"p:qualifier/P625"--> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P625".-> v3
end
v1 --"p:direct/P94"--> v4
v1 --"p:direct/P856"--> v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end
bind1[/"if(bound(?hq),?hq,?coord)"/]
v2 --o bind1
v3 --o bind1
bind1 --as--o v6