query-f99b28d5c177632a35841745a80348fe
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 schema: <http://schema.org/>
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 ?constituency ?constituencyLabel ?constituencyDescription ?sitelink ?article WHERE
{
{ select ?constituency where {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "en.wikipedia.org";
wikibase:api "Generator";
mwapi:generator "categorymembers";
mwapi:gcmtitle "Category:Parliamentary constituencies in Coventry" ; # specifically here
mwapi:gcmprop "ids|title|type";
mwapi:gcmlimit "max".
?constituency wikibase:apiOutputItem mwapi:item.
}
filter(bound(?constituency))
} } ?positionStatement pq:P768 ?constituency .
?item p:P39 ?positionStatement .
?positionStatement ps:P39 ?position.
?position wdt:P279* wd:Q486839 .
OPTIONAL { ?article schema:about ?item ;
schema:isPartOf <https://en.wikipedia.org/> ;
schema:name ?sitelink .}
SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?article"):::projected
v1("?constituency"):::projected
v3("?item"):::projected
v4("?position")
v2("?positionStatement")
v6("?sitelink"):::projected
c16(["mwapi:item"]):::iri
c21(["wd:Q486839"]):::iri
c10(["Category:Parliamentary constituencies in Coventry"]):::literal
c4(["en.wikipedia.org"]):::literal
c24([https://en.wikipedia.org/]):::iri
c2(["bd:serviceParam"]):::iri
c14(["max"]):::literal
c28(["en"]):::literal
c8(["categorymembers"]):::literal
c12(["ids|title|type"]):::literal
c6(["Generator"]):::literal
f0[["bound(?constituency)"]]
f0 --> v1
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:apiOutputItem"--> c16
end
v2 --"p:qualifier/P768"--> v1
v3 --"p:P39"--> v2
v2 --"p:statement/P39"--> v4
v4 --"p:direct/P279"--> c21
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."schema:about".-> v3
v5 --"schema:isPartOf"--> c24
v5 --"schema:name"--> v6
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c2 --"mwapi:language"--> c28
end