query-5d286fc3a0d411e667ba8973079acf2b
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
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#>
SELECT distinct ?item ?itemLabel ?title ?name ?nameLabel ?institution?institutionLabel ?P971 ?P971Label ?P4224 where
{
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "en.wikipedia.org";
wikibase:api "Generator";
mwapi:generator "categorymembers";
mwapi:gcmtitle "Category:Academics by university or college in England" ; # specifically here
mwapi:gcmprop "ids|title|type";
mwapi:gcmlimit "max".
# out
?name wikibase:apiOutput mwapi:title. # en-wikipedia article / category name
?item wikibase:apiOutputItem mwapi:item. # wikidata QId for the person's item
}
?item wdt:P31 wd:Q4167836 .
optional {?item wdt:P971 ?P971 . }
optional {?item wdt:P4224 ?P4224 . }
optional {?item p:P4224 [pq:P108 ?institution ]. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?P4224"):::projected
v3("?P971"):::projected
v5("?institution"):::projected
v2("?item"):::projected
v1("?name"):::projected
a1((" "))
c18(["mwapi:item"]):::iri
c10(["Category:Academics by university or college in England"]):::literal
c4(["en.wikipedia.org"]):::literal
c2(["bd:serviceParam"]):::iri
c14(["max"]):::literal
c8(["categorymembers"]):::literal
c27(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c20(["wd:Q4167836"]):::iri
c16(["mwapi:title"]):::iri
c12(["ids|title|type"]):::literal
c6(["Generator"]):::literal
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 --"mwapi:endpoint"--> c4
c2 --"mwapi:api"--> c6
c2 --"mwapi:generator"--> c8
c2 --"mwapi:gcmtitle"--> c10
c2 --"mwapi:gcmprop"--> c12
c2 --"mwapi:gcmlimit"--> c14
v1 --"mwapi:apiOutput"--> c16
v2 --"mwapi:apiOutputItem"--> c18
end
v2 --"p:direct/P31"--> c20
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P971".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P4224".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
a1 -."p:qualifier/P108".-> v5
v2 --"p:P4224"--> a1
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c2 --"mwapi:language"--> c27
end