|
|
@ -92,9 +92,22 @@ class Command(BaseCommand): |
|
|
|
def search_on_dblp(self, publication: Publication): |
|
|
|
query, results, total = dblp.PublicationResult.from_search(publication.title, 100) |
|
|
|
if total == 0: return |
|
|
|
plausible = [] |
|
|
|
for result in results: |
|
|
|
if publication.doi and result.doi: |
|
|
|
if publication.doi.lower() == result.doi.lower(): |
|
|
|
plausible = [result] |
|
|
|
break |
|
|
|
else: continue # quite definitely not the same publication |
|
|
|
elif publication.title == result.title and publication.year == result.year: |
|
|
|
plausible.append(result) |
|
|
|
self.log_warn(f"Not quite certain about {result.cite_key} for publication {publication.title}") |
|
|
|
else: continue # I'd rather look at that in detail for now |
|
|
|
if len(plausible) == 1: |
|
|
|
result = plausible[0] |
|
|
|
if result.access.lower() == 'withdrawn': |
|
|
|
self.log_warn(f"Publication {publication.title} was WITHDRAWN!") |
|
|
|
return |
|
|
|
publication.cite_key = result.cite_key |
|
|
|
publication.year = result.year |
|
|
|
if not result.is_peer_reviewed == None: |
|
|
@ -150,11 +163,6 @@ class Command(BaseCommand): |
|
|
|
else: |
|
|
|
self.log_info(f"Author '{author}' already assigned to publication '{publication}' at position '{position}'") |
|
|
|
|
|
|
|
else: continue # quite definitely not the same publication |
|
|
|
elif publication.title == result.title and publication.year == result.year: |
|
|
|
self.log_warn(f"Not quite certain about {result.cite_key} for publication {publication.title}") |
|
|
|
else: continue # I'd rather look at that in detail for now |
|
|
|
|
|
|
|
def find_secondary_on_dblp(self): |
|
|
|
self.log_info("--- Searching for snowballed sources on DBLP ---") |
|
|
|
for publication in tqdm(Publication.objects.exclude(cite_key__startswith=dblp.CITE_KEY_PREFIX), unit="publication"): |
|
|
|