Add additional topic metadata fields for OpenAlex integration
All checks were successful
Test pipeline / test (push) Successful in 14s
All checks were successful
Test pipeline / test (push) Successful in 14s
This commit is contained in:
parent
314da684d1
commit
f7130898fc
1 changed files with 9 additions and 2 deletions
|
@ -1045,8 +1045,15 @@ class CitationBuilder:
|
|||
|
||||
for topic in self.data.get("topics", []):
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue