#20190828 2251

import pywikibot
from pywikibot import pagegenerators as pg
import requests

prop2delete='P5660'

query='select ?item where {?item wdt:%s ?iets}' % prop2delete

def wd_sparql_query(spq):
   generator=pg.WikidataSPARQLPageGenerator(spq,site=pywikibot.Site('wikidata','wikidata'))
   for wd in generator:
     try:
       wd.get(get_redirect=True)
       yield wd
     except:
       pass
x=0
for item in wd_sparql_query(query):
  claim=item.claims[prop2delete][0]
  item.removeClaims(claim,summary='https://www.wikidata.org/w/index.php?title=Wikidata:Properties_for_deletion&oldid=1004301558')
  x=x+1
  y= (12-x)
    
  #print(f'stoppie joppie: {x}/{y}={x/y} - {type(y)}')
Sleeping for 8.3 seconds, 2019-08-19 06:53:25
Sleeping for 9.0 seconds, 2019-08-19 06:53:34
Sleeping for 8.9 seconds, 2019-08-19 06:53:44
Sleeping for 8.9 seconds, 2019-08-19 06:53:54
Sleeping for 8.9 seconds, 2019-08-19 06:54:04
Sleeping for 7.4 seconds, 2019-08-19 06:54:16
Sleeping for 8.9 seconds, 2019-08-19 06:54:24
Sleeping for 9.0 seconds, 2019-08-19 06:54:34
Sleeping for 9.2 seconds, 2019-08-19 06:54:44