def iterate_items():
    query = '\n        SELECT ?item\n        {\n          ?item p:P5163 ?statement .\n          ?statement ps:P5163 ?value .\n          #?item wdt:P31 wd:Q5 .\n          ?article schema:about ?item .\n          ?article schema:isPartOf <https://ru.wikipedia.org/>.\n          FILTER REGEX(?value, "^(?!group/)", "i")\n          FILTER NOT EXISTS{ ?statement pq:P9269 [] }\n        }\n    '
    generator = pg.WikidataSPARQLPageGenerator(query, site=repo)
    for item in generator:
        add_ok_numeric_id(item)
        sleep(5)
def iterate_items():
    query = '\n        SELECT ?item\n        {\n          ?item p:P5163 ?statement .\n          ?statement ps:P5163 ?value .\n          #?item wdt:P31 wd:Q5 .\n          ?article schema:about ?item .\n          ?article schema:isPartOf <https://ru.wikipedia.org/>.\n          FILTER REGEX(?value, "^(?!group/)", "i")\n          FILTER NOT EXISTS{ ?statement pq:P9269 [] }\n        }\n    '
    generator = pg.WikidataSPARQLPageGenerator(query, site=repo)
    for item in generator:
        add_ok_numeric_id(item)
        sleep(5)