Skip to content

Commit

Permalink
[CST-18016] Improved OpenAlex Publication mapping adding dc.identifie…
Browse files Browse the repository at this point in the history
…r.issn and oaire.citation.title
  • Loading branch information
AdamF42 committed Feb 24, 2025
1 parent 20c371f commit bc2dd1e
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ public void findOneOpenalexPublicationExternalSourceEntriesWithQueryTest() throw
.andExpect(
jsonPath("$._embedded.externalSourceEntries[0].metadata['oaire.version.volume'][0].value")
.value("http://purl.org/coar/version/c_970fb48d4fbd8a85"))
.andExpect(
jsonPath("$._embedded.externalSourceEntries[0].metadata['oaire.citation.title'][0].value")
.value("Journal of Biological Chemistry"))
.andExpect(jsonPath("$._embedded.externalSourceEntries[0].metadata['dc.identifier.issn']",
Matchers.hasSize(3)))
.andExpect(
jsonPath("$._embedded.externalSourceEntries[0].metadata['dc.identifier.doi'][0].value")
.value("10.1016/s0021-9258(19)52451-6"))
Expand Down
56 changes: 56 additions & 0 deletions dspace/config/spring/api/openalex-integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
<entry key-ref="openalex.biblio.lastpage" value-ref="openalexBiblioLastPageContrib"/>
<entry key-ref="openalex.subject" value-ref="openalexPublicationSubjectContrib"/>
<entry key-ref="openalex.license" value-ref="openalexLicenseContrib"/>
<entry key-ref="oaire.citation.title" value-ref="openalexConditionalPrimaryLocationTitleContrib"/>
<entry key-ref="dc.identifier.issn" value-ref="openalexConditionalPrimaryLocationISSNContrib"/>
</util:map>

<bean id="openalexTitleContrib" class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
Expand Down Expand Up @@ -468,6 +470,60 @@
<property name="query" value="/display_name"/>
</bean>

<bean id="oaire.citation.title" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="oaire.citation.title"/>
</bean>
<util:list id="contribCitationList"
value-type="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor"
list-class="java.util.ArrayList">
<ref bean="openalexConditionalPrimaryLocationTitleJourContrib"/>
<ref bean="openalexConditionalPrimaryLocationTitleConfContrib"/>
</util:list>
<bean id="openalexConditionalPrimaryLocationTitleContrib"
class="org.dspace.importer.external.metadatamapping.contributor.MultipleMetadataContributor">
<property name="metadatumContributors" ref="contribCitationList"/>
<property name="field" ref="oaire.citation.title"/>
</bean>
<bean id="openalexConditionalPrimaryLocationTitleJourContrib"
class="org.dspace.importer.external.metadatamapping.contributor.ConditionEqualJsonPathMetadataContributor">
<property name="leftOperandProcessor" ref="openalexPrimaryLocationTypeMetadataProcessor"/>
<property name="rightOperand" value="journal"/>
<property name="metadatumContributor" ref="openalexPrimaryLocationTitleContrib"/>
</bean>
<bean id="openalexPrimaryLocationTitleContrib"
class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="oaire.citation.title"/>
<property name="query" value="/primary_location/source/display_name"/>
</bean>
<bean name="openalexPrimaryLocationTypeMetadataProcessor"
class="org.dspace.importer.external.metadatamapping.contributor.RegexReplacingJsonPathMetadataProcessor">
<property name="path" value="/primary_location/source/type"/>
<property name="regexPattern" value=""/>
<property name="replacement" value=""/>
</bean>
<bean id="openalexConditionalPrimaryLocationTitleConfContrib"
class="org.dspace.importer.external.metadatamapping.contributor.ConditionEqualJsonPathMetadataContributor">
<property name="leftOperandProcessor" ref="openalexPrimaryLocationTypeMetadataProcessor"/>
<property name="rightOperand" value="conference"/>
<property name="metadatumContributor" ref="openalexPrimaryLocationTitleContrib"/>
</bean>

<bean id="dc.identifier.issn" class="org.dspace.importer.external.metadatamapping.MetadataFieldConfig">
<constructor-arg value="dc.identifier.issn"/>
</bean>
<bean id="openalexConditionalPrimaryLocationISSNContrib"
class="org.dspace.importer.external.metadatamapping.contributor.ConditionEqualJsonPathMetadataContributor">
<property name="leftOperandProcessor" ref="openalexPrimaryLocationTypeMetadataProcessor"/>
<property name="rightOperand" value="journal"/>
<property name="metadatumContributor" ref="openalexPrimaryLocationISSNContrib"/>
</bean>
<bean id="openalexPrimaryLocationISSNContrib"
class="org.dspace.importer.external.metadatamapping.contributor.SimpleJsonPathMetadataContributor">
<property name="field" ref="dc.identifier.issn"/>
<property name="query" value="/primary_location/source/issn"/>
</bean>


<util:map id="openalexPersonMetadataFieldMap" key-type="org.dspace.importer.external.metadatamapping.MetadataFieldConfig"
value-type="org.dspace.importer.external.metadatamapping.contributor.MetadataContributor">
<description>Defines which metadatum is mapped on which metadatum. Note that while the key must be unique it
Expand Down

0 comments on commit bc2dd1e

Please sign in to comment.