diff --git a/web/slurper/management/commands/import_wikidata.py b/web/slurper/management/commands/import_wikidata.py index 1902a16..f3fc650 100644 --- a/web/slurper/management/commands/import_wikidata.py +++ b/web/slurper/management/commands/import_wikidata.py @@ -4,7 +4,12 @@ class Command(BaseCommand): def handle(self, *args, **options): - for slurper in source_wikidata.SLURPERS: + print("", end="") + n = len(source_wikidata.SLURPERS) + for i, slurper in enumerate(source_wikidata.SLURPERS): + print(f"\r query {i}/{n}: {slurper.source.label}".ljust(50), end="") slurper.save_items() - for slurper in source_wikidata.SLURPERS: + for i, slurper in enumerate(source_wikidata.SLURPERS): + print(f"\r links {i}/{n}: {slurper.source.label}".ljust(50), end="") slurper.save_links() + print("\r done.".ljust(60)) diff --git a/web/slurper/source_wikidata.py b/web/slurper/source_wikidata.py index f843282..2a780c8 100644 --- a/web/slurper/source_wikidata.py +++ b/web/slurper/source_wikidata.py @@ -167,11 +167,10 @@ def __init__(self, source, query): self.query = ( """ SELECT - DISTINCT ?item ?itemLabel ?itemDescription ?image + DISTINCT ?item ?itemLabel ?itemDescription ?image ?art """ + self._sparql_source_vars_select() + """ - ?art WHERE { """ + query