Skip to content

Commit

Permalink
Better import status messages
Browse files Browse the repository at this point in the history
  • Loading branch information
katjabercic committed Nov 30, 2023
1 parent 27e1d0f commit 8224991
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions web/slurper/management/commands/import_wikidata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
3 changes: 1 addition & 2 deletions web/slurper/source_wikidata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8224991

Please sign in to comment.