query-484c3e5dbefba08428ca3124a3926195

rq turtle/ttl

title: Getting pageviews for all articles in a category SELECT ?title ?pageviews ?date WHERE { VALUES ?item { wd:Q16326821 } # Change category here ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; # To change language version first change here schema:name ?name . SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here mwapi:generator "categorymembers"; mwapi:prop "pageviews"; mwapi:gcmtitle ?name ; mwapi:pvipdays "1"; # How many days back in time to get the pageviews for mwapi:gcmlimit "500". # Max articles to get the results for ?title wikibase:apiOutput mwapi:title . ?pageviews wikibase:apiOutput "pageviews/pvip/text()". ?date wikibase:apiOutput "pageviews/pvip/@date" . } FILTER(?pageviews != "1") # Filters out results with no views } ORDER BY DESC(xsd:integer(?pageviews)) title: Getting pageviews for all articles in a category SELECT ?title ?pageviews ?date WHERE { VALUES ?item { wd:Q16326821 } # Change category here ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; # To change language version first change here schema:name ?name . SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here mwapi:generator "categorymembers"; mwapi:prop "pageviews"; mwapi:gcmtitle ?name ; mwapi:pvipdays "1"; # How many days back in time to get the pageviews for mwapi:gcmlimit "500". # Max articles to get the results for ?title wikibase:apiOutput mwapi:title . ?pageviews wikibase:apiOutput "pageviews/pvip/text()". ?date wikibase:apiOutput "pageviews/pvip/@date" . } FILTER(?pageviews != "1") # Filters out results with no views } ORDER BY DESC(xsd:integer(?pageviews)) title: Getting pageviews for all articles in a category SELECT ?title ?pageviews ?date WHERE { VALUES ?item { wd:Q16326821 } # Change category here ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; # To change language version first change here schema:name ?name . SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here mwapi:generator "categorymembers"; mwapi:prop "pageviews"; mwapi:gcmtitle ?name ; mwapi:pvipdays "1"; # How many days back in time to get the pageviews for mwapi:gcmlimit "500". # Max articles to get the results for ?title wikibase:apiOutput mwapi:title . ?pageviews wikibase:apiOutput "pageviews/pvip/text()". ?date wikibase:apiOutput "pageviews/pvip/@date" . } FILTER(?pageviews != "1") # Filters out results with no views } ORDER BY DESC(xsd:integer(?pageviews)) title: Getting pageviews for all articles in a category SELECT ?title ?pageviews ?date WHERE { VALUES ?item { wd:Q16326821 } # Change category here ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; # To change language version first change here schema:name ?name . SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here mwapi:generator "categorymembers"; mwapi:prop "pageviews"; mwapi:gcmtitle ?name ; mwapi:pvipdays "1"; # How many days back in time to get the pageviews for mwapi:gcmlimit "500". # Max articles to get the results for ?title wikibase:apiOutput mwapi:title . ?pageviews wikibase:apiOutput "pageviews/pvip/text()". ?date wikibase:apiOutput "pageviews/pvip/@date" . } FILTER(?pageviews != "1") # Filters out results with no views } ORDER BY DESC(xsd:integer(?pageviews)) title: Getting pageviews for all articles in a category SELECT ?title ?pageviews ?date WHERE { VALUES ?item { wd:Q16326821 } # Change category here ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; # To change language version first change here schema:name ?name . SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here mwapi:generator "categorymembers"; mwapi:prop "pageviews"; mwapi:gcmtitle ?name ; mwapi:pvipdays "1"; # How many days back in time to get the pageviews for mwapi:gcmlimit "500". # Max articles to get the results for ?title wikibase:apiOutput mwapi:title . ?pageviews wikibase:apiOutput "pageviews/pvip/text()". ?date wikibase:apiOutput "pageviews/pvip/@date" . } FILTER(?pageviews != "1") # Filters out results with no views } ORDER BY DESC(xsd:integer(?pageviews)) title: Getting pageviews for all articles in a category SELECT ?title ?pageviews ?date WHERE { VALUES ?item { wd:Q16326821 } # Change category here ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; # To change language version first change here schema:name ?name . SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here mwapi:generator "categorymembers"; mwapi:prop "pageviews"; mwapi:gcmtitle ?name ; mwapi:pvipdays "1"; # How many days back in time to get the pageviews for mwapi:gcmlimit "500". # Max articles to get the results for ?title wikibase:apiOutput mwapi:title . ?pageviews wikibase:apiOutput "pageviews/pvip/text()". ?date wikibase:apiOutput "pageviews/pvip/@date" . } FILTER(?pageviews != "1") # Filters out results with no views } ORDER BY DESC(xsd:integer(?pageviews)) title: Getting pageviews for all articles in a category SELECT ?title ?pageviews ?date WHERE { VALUES ?item { wd:Q16326821 } # Change category here ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; # To change language version first change here schema:name ?name . SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here mwapi:generator "categorymembers"; mwapi:prop "pageviews"; mwapi:gcmtitle ?name ; mwapi:pvipdays "1"; # How many days back in time to get the pageviews for mwapi:gcmlimit "500". # Max articles to get the results for ?title wikibase:apiOutput mwapi:title . ?pageviews wikibase:apiOutput "pageviews/pvip/text()". ?date wikibase:apiOutput "pageviews/pvip/@date" . } FILTER(?pageviews != "1") # Filters out results with no views } ORDER BY DESC(xsd:integer(?pageviews)) title: Getting pageviews for all articles in a category SELECT ?title ?pageviews ?date WHERE { VALUES ?item { wd:Q16326821 } # Change category here ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; # To change language version first change here schema:name ?name . SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here mwapi:generator "categorymembers"; mwapi:prop "pageviews"; mwapi:gcmtitle ?name ; mwapi:pvipdays "1"; # How many days back in time to get the pageviews for mwapi:gcmlimit "500". # Max articles to get the results for ?title wikibase:apiOutput mwapi:title . ?pageviews wikibase:apiOutput "pageviews/pvip/text()". ?date wikibase:apiOutput "pageviews/pvip/@date" . } FILTER(?pageviews != "1") # Filters out results with no views } ORDER BY DESC(xsd:integer(?pageviews)) title: Getting pageviews for all articles in a category SELECT ?title ?pageviews ?date WHERE { VALUES ?item { wd:Q16326821 } # Change category here ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; # To change language version first change here schema:name ?name . SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here mwapi:generator "categorymembers"; mwapi:prop "pageviews"; mwapi:gcmtitle ?name ; mwapi:pvipdays "1"; # How many days back in time to get the pageviews for mwapi:gcmlimit "500". # Max articles to get the results for ?title wikibase:apiOutput mwapi:title . ?pageviews wikibase:apiOutput "pageviews/pvip/text()". ?date wikibase:apiOutput "pageviews/pvip/@date" . } FILTER(?pageviews != "1") # Filters out results with no views } ORDER BY DESC(xsd:integer(?pageviews)) title: Getting pageviews for all articles in a category SELECT ?title ?pageviews ?date WHERE { VALUES ?item { wd:Q16326821 } # Change category here ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; # To change language version first change here schema:name ?name . SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator"; wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here mwapi:generator "categorymembers"; mwapi:prop "pageviews"; mwapi:gcmtitle ?name ; mwapi:pvipdays "1"; # How many days back in time to get the pageviews for mwapi:gcmlimit "500". # Max articles to get the results for ?title wikibase:apiOutput mwapi:title . ?pageviews wikibase:apiOutput "pageviews/pvip/text()". ?date wikibase:apiOutput "pageviews/pvip/@date" . } FILTER(?pageviews != "1") # Filters out results with no views } ORDER BY DESC(xsd:integer(?pageviews))

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: Getting pageviews for all articles in a category
SELECT ?title ?pageviews ?date WHERE {
  VALUES ?item { wd:Q16326821 } # Change category here
  ?sitelink schema:about ?item ;
            schema:isPartOf <https://en.wikipedia.org/> ; # To change language version first change here
            schema:name ?name .
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Generator";
                    wikibase:endpoint "en.wikipedia.org"; # then also change to the same language here
                    mwapi:generator "categorymembers";
                    mwapi:prop "pageviews";
                    mwapi:gcmtitle ?name ;
                    mwapi:pvipdays "1"; # How many days back in time to get the pageviews for
                    mwapi:gcmlimit "500". # Max articles to get the results for
    ?title wikibase:apiOutput mwapi:title .
    ?pageviews wikibase:apiOutput "pageviews/pvip/text()".
    ?date wikibase:apiOutput "pageviews/pvip/@date" .
  }
  FILTER(?pageviews != "1") # Filters out results with no views 
} ORDER BY DESC(xsd:integer(?pageviews))

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?date"):::projected v2("?item") v4("?name") v1("?pageviews"):::projected v3("?sitelink") v5("?title"):::projected c13(["categorymembers"]):::literal c1(["1"]):::literal c4([https://en.wikipedia.org/]):::iri c11(["en.wikipedia.org"]):::literal c15(["pageviews"]):::literal c7(["bd:serviceParam"]):::iri c19(["500"]):::literal c23(["pageviews/pvip/@date"]):::literal c22(["pageviews/pvip/text()"]):::literal c21(["mwapi:title"]):::iri c9(["Generator"]):::literal f0[["?pageviews != '1'"]] f0 --> v1 bind1[/VALUES ?item/] bind1-->v2 bind10(["wd:Q16326821"]) bind10 --> bind1 v3 --"schema:about"--> v2 v3 --"schema:isPartOf"--> c4 v3 --"schema:name"--> v4 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c7 --"mwapi:api"--> c9 c7 --"mwapi:endpoint"--> c11 c7 --"mwapi:generator"--> c13 c7 --"mwapi:prop"--> c15 c7 --"mwapi:gcmtitle"--> v4 c7 --"mwapi:pvipdays"--> c1 c7 --"mwapi:gcmlimit"--> c19 v5 --"mwapi:apiOutput"--> c21 v1 --"mwapi:apiOutput"--> c22 v6 --"mwapi:apiOutput"--> c23 end