query-101c19ec4e0ac3d6ebe9abdfe13c259b

rq turtle/ttl

longest* Wikipedia articles about fingers

*(measured in bytes of Wikitext, which is a terrible measure:

it counts categories, comments, and other kinds of metadata,

discounts anything contributed by templates except the template invocation,

and fails to account for different languages using more or less characters per word, or bytes per character)

SELECT ?finger ?fingerLabel ?endpoint ?title ?length ?article WITH { SELECT ?finger ?article ?endpoint ?title WHERE { ?finger wdt:P279 wd:Q620207. ?article schema:about ?finger; schema:isPartOf ?wiki; schema:name ?title. ?wiki wikibase:wikiGroup "wikipedia". # MINUS { ?wiki wikibase:wikiGroup "wikiquote". } # if you want to remove the previous line to check other projects, uncomment this one, Wikiquote is not allowed with MWAPI BIND(STRBEFORE(STRAFTER(STR(?wiki), "https://"), "/") AS ?endpoint) } } AS %articles WHERE { hint:SubQuery hint:optimizer "None". INCLUDE %articles. SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint ?endpoint; mwapi:generator "allpages"; mwapi:gapfrom ?title; mwapi:gaplimit 1; wikibase:limit 1 . ?length_ wikibase:apiOutput "@length". } BIND(xsd:integer(?length_) AS ?length) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC(?length)

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# longest* Wikipedia articles about fingers
# *(measured in bytes of Wikitext, which is a terrible measure:
#   it counts categories, comments, and other kinds of metadata,
#   discounts anything contributed by templates except the template invocation,
#   and fails to account for different languages using more or less characters per word, or bytes per character)
SELECT ?finger ?fingerLabel ?endpoint ?title ?length ?article WHERE {

   {
  SELECT ?finger ?article ?endpoint ?title WHERE {
    ?finger wdt:P279 wd:Q620207.
    ?article schema:about ?finger;
             schema:isPartOf ?wiki;
             schema:name ?title.
    ?wiki wikibase:wikiGroup "wikipedia".
    # MINUS { ?wiki wikibase:wikiGroup "wikiquote". } # if you want to remove the previous line to check other projects, uncomment this one, Wikiquote is not allowed with MWAPI
    BIND(STRBEFORE(STRAFTER(STR(?wiki), "https://"), "/") AS ?endpoint)
  }
}
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Generator";
                    wikibase:endpoint ?endpoint;
                    mwapi:generator "allpages";
                    mwapi:gapfrom ?title;
                    mwapi:gaplimit 1;
                    wikibase:limit 1 .
    ?length_ wikibase:apiOutput "@length".
  }
  BIND(xsd:integer(?length_) AS ?length)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?length)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?article"):::projected v6("?endpoint"):::projected v2("?finger"):::projected v8("?length"):::projected v7("?length_") v5("?title"):::projected v4("?wiki") c17(["1^^xsd:integer"]):::literal c9(["bd:serviceParam"]):::iri c14(["allpages"]):::literal c23(["#91;AUTO_LANGUAGE#93;,en"]):::literal c7(["wikipedia"]):::literal c20(["@length"]):::literal c2(["wd:Q620207"]):::iri c11(["Generator"]):::literal v2 --"wdt:P279"--> c2 v3 --"schema:about"--> v2 v3 --"schema:isPartOf"--> v4 v3 --"schema:name"--> v5 v4 --"mwapi:wikiGroup"--> c7 bind0[/"substring-before(substring-after(str(?wiki),'https://'),'/')"/] v4 --o bind0 bind0 --as--o v6 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c9 --"mwapi:api"--> c11 c9 --"mwapi:endpoint"--> v6 c9 --"mwapi:generator"--> c14 c9 --"mwapi:gapfrom"--> v5 c9 --"mwapi:gaplimit"--> c17 c9 --"mwapi:limit"--> c17 v7 --"mwapi:apiOutput"--> c20 end bind1[/"http://www.w3.org/2001/XMLSchema#integer(?length_)"/] v7 --o bind1 bind1 --as--o v8 subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c9 --"mwapi:language"--> c23 end