query-33e3ce7d9317b135aa113f50e35b32d4

rq turtle/ttl

LirazelfTagishsimon One row per article:

Use at

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 ?link ?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 . }
  BIND (URI(CONCAT("https://sco.wikipedia.org/wiki/", ENCODE_FOR_URI(?article))) AS ?link)
  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; v3("?P31"):::projected v2("?article"):::projected v1("?item"):::projected v4("?link"):::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 bind1[/"concat('https://sco.wikipedia.org/wiki/',encode-for-uri(?article))"/] v2 --o bind1 bind1 --as--o v4 subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c2 --"mwapi:language"--> c22 end