Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SPARQL 0.94 KB | None | 0 0
  1. # Chart of P921 usage
  2. # Note: this chart is based on https://www.wikidata.org/wiki/Template:Property_uses
  3. # which is updated once a day by PLbot
  4.  
  5. #defaultView:LineChart
  6. SELECT ?DAY ?COUNT ?property {
  7.   values (?property) {("921") ("50") ("2093")}
  8.   BIND (CONCAT("|", ?property, "=") AS ?p)
  9.   BIND (CONCAT(".+\\", ?p, "(\\d+).+") AS ?r)
  10.   SERVICE wikibase:mwapi {
  11.       bd:serviceParam wikibase:api "Generator" ; wikibase:endpoint "www.wikidata.org" ; mwapi:generator "allpages" ;
  12.       mwapi:gapfrom "Property_uses" ; mwapi:gapto "Property_uses" ; mwapi:gapnamespace "10" ;
  13.       mwapi:prop "revisions" ; mwapi:rvprop "content|timestamp" ; mwapi:rvlimit "50" ; mwapi:rvuser "PLbot" .
  14.       ?t1 wikibase:apiOutput "revisions/rev[1]/@timestamp" . ?r1 wikibase:apiOutput "revisions/rev[1]/text()" .
  15.   }
  16.   BIND (IF(CONTAINS(?r1, ?p), xsd:integer(REPLACE(?r1, ?r, "$1")), -1) AS ?COUNT)
  17.   FILTER (?COUNT != -1)
  18.   BIND (xsd:dateTime(?t1) AS ?DAY)
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement