query-04b66480bd00c948020ceac97f91b882

rq turtle/ttl

MediaWiki api

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT * WHERE {

  BIND(wd:Q2673411 AS ?item)
  BIND(<https://en.wikipedia.org/> AS ?wiki)

  BIND(STRBEFORE(STRAFTER(STR(?wiki), "https://"), "/") AS ?domain)
  ?sitelink schema:about ?item;
            schema:isPartOf ?wiki;
            schema:name ?title.
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:endpoint ?domain;
                    wikibase:api "Generator";
                    mwapi:generator "allpages";
                    mwapi:gapfrom ?title;
                    mwapi:gapto ?title.
    ?id wikibase:apiOutput "@pageid".
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?domain"):::projected v6("?id"):::projected v1("?item"):::projected v4("?sitelink"):::projected v5("?title"):::projected v2("?wiki"):::projected c5(["bd:serviceParam"]):::iri c10(["allpages"]):::literal c14(["@pageid"]):::literal c8(["Generator"]):::literal bind0[/"'wd:Q2673411'"/] bind0 --as--o v1 bind1[/"https://en.wikipedia.org/"/] bind1 --as--o v2 bind2[/"substring-before(substring-after(str(?wiki),'https://'),'/')"/] v2 --o bind2 bind2 --as--o v3 v4 --"schema:about"--> v1 v4 --"schema:isPartOf"--> v2 v4 --"schema:name"--> v5 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c5 --"mwapi:endpoint"--> v3 c5 --"mwapi:api"--> c8 c5 --"mwapi:generator"--> c10 c5 --"mwapi:gapfrom"--> v5 c5 --"mwapi:gapto"--> v5 v6 --"mwapi:apiOutput"--> c14 end