query-690362af65557d747734cd029d2eddc0
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?article ?P31 ?P31Label where
{
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "sco.wikipedia.org";
wikibase:api "Generator";
mwapi:generator "categorymembers";
mwapi:gcmtitle "Category:Pages that wis written by a body that's mither tongue isna Scots" ; # specifically here
mwapi:gcmprop "ids|title|type";
mwapi:gcmlimit "max".
# out
?article wikibase:apiOutput mwapi:title. # en-wikipedia article / category name
?item wikibase:apiOutputItem mwapi:item. # wikidata QId for the article
}
filter(bound(?item))
optional {?item wdt:P31 ?P31 . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
- https://www.wikidata.org/wiki/User:Lirazelf/Learning
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2021/09
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?P31"):::projected
v2("?article"):::projected
v1("?item"):::projected
c18(["mwapi:item"]):::iri
c14(["max"]):::literal
c10(["Category:Pages that wis written by a body that's mither tongue isna Scots"]):::literal
c8(["categorymembers"]):::literal
c2(["bd:serviceParam"]):::iri
c22(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c16(["mwapi:title"]):::iri
c12(["ids|title|type"]):::literal
c4(["sco.wikipedia.org"]):::literal
c6(["Generator"]):::literal
f0[["bound(?item)"]]
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
v2 --"mwapi:apiOutput"--> c16
v1 --"mwapi:apiOutputItem"--> c18
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P31".-> v3
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c2 --"mwapi:language"--> c22
end