query-d3119d77e88a44fcba5af0880a428931

rq turtle/ttl

title: List of articles about Grace Hopper from all Wikipedias, ordered by descending size of the article in that language SELECT ?sitelink ?title ?site ?articlesize WHERE { ?sitelink schema:about wd:Q11641. ?sitelink schema:isPartOf ?site. ?sitelink schema:isPartOf/wikibase:wikiGroup "wikipedia" . ?sitelink schema:name ?title. BIND (STRBEFORE(STRAFTER(STR(?site), "https://"), "/") AS ?endpoint) BIND (STR(?title) AS ?title_nolang) SERVICE wikibase:mwapi { bd:serviceParam wikibase:endpoint ?endpoint. bd:serviceParam wikibase:api "Generator". bd:serviceParam mwapi:generator "revisions". bd:serviceParam mwapi:titles ?title_nolang. bd:serviceParam mwapi:prop "revisions". bd:serviceParam mwapi:rvprop "size". ?size wikibase:apiOutput "revisions/rev[last()]/@size". } BIND ( xsd:integer(?size) AS ?articlesize ) } ORDER BY DESC(?articlesize)

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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#>
#title: List of articles about Grace Hopper from all Wikipedias, ordered by descending size of the article in that language
SELECT  ?sitelink ?title ?site ?articlesize
WHERE
{
  ?sitelink schema:about wd:Q11641.
  ?sitelink schema:isPartOf ?site.
  ?sitelink schema:isPartOf/wikibase:wikiGroup "wikipedia" .
  ?sitelink schema:name ?title.
  BIND (STRBEFORE(STRAFTER(STR(?site), "https://"), "/") AS ?endpoint)
  BIND (STR(?title) AS ?title_nolang)
  SERVICE wikibase:mwapi
  {
    bd:serviceParam wikibase:endpoint ?endpoint.
    bd:serviceParam wikibase:api "Generator".
    bd:serviceParam mwapi:generator "revisions".
    bd:serviceParam mwapi:titles ?title_nolang.
    bd:serviceParam mwapi:prop "revisions".
    bd:serviceParam mwapi:rvprop "size".
    ?size wikibase:apiOutput "revisions/rev[last()]/@size".
  }
  BIND ( xsd:integer(?size) AS ?articlesize )
}
ORDER BY DESC(?articlesize)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?articlesize"):::projected v5("?endpoint") v3("?site"):::projected v2("?sitelink"):::projected v7("?size") v4("?title"):::projected v6("?title_nolang") a1((" ")) c19(["revisions/rev#91;last()#93;/@size"]):::literal c8(["bd:serviceParam"]):::iri c17(["size"]):::literal c13(["revisions"]):::literal c5(["wikipedia"]):::literal c2(["wd:Q11641"]):::iri c11(["Generator"]):::literal v2 --"schema:about"--> c2 v2 --"schema:isPartOf"--> v3 v2 --"schema:isPartOf"--> a1 a1 --"mwapi:wikiGroup"--> c5 v2 --"schema:name"--> v4 bind0[/"substring-before(substring-after(str(?site),'https://'),'/')"/] v3 --o bind0 bind0 --as--o v5 bind1[/"str(?title)"/] v4 --o bind1 bind1 --as--o v6 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c8 --"mwapi:endpoint"--> v5 c8 --"mwapi:api"--> c11 c8 --"mwapi:generator"--> c13 c8 --"mwapi:titles"--> v6 c8 --"mwapi:prop"--> c13 c8 --"mwapi:rvprop"--> c17 v7 --"mwapi:apiOutput"--> c19 end bind2[/"http://www.w3.org/2001/XMLSchema#integer(?size)"/] v7 --o bind2 bind2 --as--o v8