Add additional topic metadata fields for OpenAlex integration
All checks were successful
Test pipeline / test (push) Successful in 14s

This commit is contained in:
Alexander Minges 2025-05-20 10:04:11 +02:00
parent 314da684d1
commit f7130898fc
Signed by: Athemis
SSH key fingerprint: SHA256:TUXshgulbwL+FRYvBNo54pCsI0auROsSEgSvueKbkZ4

View file

@ -1045,8 +1045,15 @@ class CitationBuilder:
for topic in self.data.get("topics", []): for topic in self.data.get("topics", []):
if topic.get("score") >= 0.8: if topic.get("score") >= 0.8:
if name := topic.get("display_name"):
topics.append([PrimitiveMetadataField("topicClassValue", False, name)]) topic_class_value_field = PrimitiveMetadataField("topicClassValue",
False, topic.get("display_name"))
topic_class_vocab_field = PrimitiveMetadataField("topicClassVocab",
False, "OpenAlex")
topic_class_vocab_uri_field = PrimitiveMetadataField(
"topicClassVocabURI", False, topic.get("id"))
topics.append([topic_class_value_field, topic_class_vocab_field, topic_class_vocab_uri_field])
return topics return topics