Skip to content

Commit

Permalink
Merge pull request #197 from arthur-schnitzler/194-no-wikidata-id-found
Browse files Browse the repository at this point in the history
removes entities with wikidata-ids from no wikidata collection
  • Loading branch information
csae8092 authored Jun 4, 2024
2 parents d2cb638 + 75f34a9 commit be58446
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dumper/management/commands/wikidata_minter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ class Command(BaseCommand):
help = "mint WikiData IDs for GND-URIs"

def handle(self, *args, **kwargs):
LIMIT = 100
LIMIT = 2
USER_AGENT_PMB = "pmb (https://pmb.acdh.oeaw.ac.at)"
col, _ = Collection.objects.get_or_create(name="No WikiData-ID found")
ents = TempEntityClass.objects.filter(uri__uri__icontains="wikidata").filter(collection=col)
print(f"found {ents.count()} entities with wikidata-ids but related to {col}")
if ents:
print(f"remove relation to {col}")
for x in tqdm(ents, total=ents.count()):
x.collection.remove(col)
types = ["d-nb.info", "geonames"]
for uri_type in types:
print(f"processing URIS with type: {uri_type}")
Expand Down

0 comments on commit be58446

Please sign in to comment.