query-54461ed1d6c86daec7b1f4b9b9273c96
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?title_enwiki (URI(CONCAT("https://en.wikipedia.org/wiki/", ?title_enwiki)) AS ?link) ?namespace
WHERE
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
# Generator to get all transclusions of the Template "WikiProject Climate change"
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam mwapi:generator "alltransclusions" .
bd:serviceParam mwapi:gatfrom "WikiProject Climate change" .
bd:serviceParam mwapi:gatto "WikiProject Climate change" .
bd:serviceParam mwapi:gatlimit "max" .
# Use the info module to get the name of associated page
# (the template is on talk pages, so this gives the subject pages)
bd:serviceParam mwapi:prop "info" .
bd:serviceParam mwapi:inprop "associatedpage" .
# Output
# (There is no point in trying to get associated items, because that would for the found talk pages)
?title_enwiki wikibase:apiOutput "@associatedpage" .
?namespace wikibase:apiOutput "@ns" .
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?link")
v2("?namespace"):::projected
v1("?title_enwiki"):::projected
c8(["alltransclusions"]):::literal
c13(["max"]):::literal
c20(["@ns"]):::literal
c10(["WikiProject Climate change"]):::literal
c4(["en.wikipedia.org"]):::literal
c2(["bd:serviceParam"]):::iri
c19(["@associatedpage"]):::literal
c17(["associatedpage"]):::literal
c6(["Generator"]):::literal
c15(["info"]):::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:gatfrom"--> c10
c2 --"mwapi:gatto"--> c10
c2 --"mwapi:gatlimit"--> c13
c2 --"mwapi:prop"--> c15
c2 --"mwapi:inprop"--> c17
v1 --"mwapi:apiOutput"--> c19
v2 --"mwapi:apiOutput"--> c20
end
bind0[/"concat('https://en.wikipedia.org/wiki/',?title_enwiki)"/]
v1 --o bind0
bind0 --as--o v3