Skip to content

Commit

Permalink
Merge pull request #1698 from Inist-CNRS/update-inspire-loader
Browse files Browse the repository at this point in the history
Update Inspire Loader
  • Loading branch information
touv authored Sep 20, 2023
2 parents 9fe6da0 + 67fb3e3 commit 2f07253
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions workers/loaders/json-inspirehep.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
#loader json-inspirehep.ini (version novembre 2022 - Inist-CNRS)
#loader json-inspirehep.ini (version juin 2023 - Inist-CNRS)

append = pack
label = json-inspirehep

# load some plugins to activate some statements
[use]
plugin = basics

# Toggle ezs traces (see server stderr log)
[debug]
ezs = false

[JSONParse]
separator = hits.hits.*

Expand All @@ -20,27 +15,33 @@ value = get('id')

path = Titre
value = get('metadata.titles[0].title')
#1e occurrence

path = Type de document
value = get('metadata.document_type')

path = Année de publication
value = get('metadata.publication_info[0].year')
#1e occurrence

path = Revue
value = get('metadata.publication_info[0].journal_title')
#1e occurrence

path = Issue
value = get('metadata.publication_info[0].journal_issue')
#1e occurrence

path = N° de volume
value = get('metadata.publication_info[0].journal_volume')
#1e occurrence

path = N° conférence
value = get('metadata.publication_info[0].cnum')
#1e occurrence

path = Auteurs
value = get('metadata.authors').map(author => ({ full_name: author.full_name, affiliations: author.affiliations ? author.affiliations.map(aff => ({ label: aff.value || "", url: ( aff.record ? aff.record["$ref"] : "q" ) }) ) : [] } ))
value = get('metadata.authors').map(author => ({ full_name: author.full_name, affiliations: author.affiliations ? author.affiliations.map(aff => ({ label: aff.value || "", url: ( aff.record ? aff.record["$ref"] : "empty" ) }) ) : [] } ))

path = Catégorie inspire
value = get('metadata.inspire_categories').map(cat => cat.term).uniq()
Expand All @@ -53,21 +54,26 @@ value = get('metadata.collaborations').map(col => col.value).uniq()

path = Résumé
value = get('metadata.abstracts[0].value')
#1e occurrence

path = DOI
value = get('metadata.dois').map(doi => doi.value).uniq()

[assign]
path = UrlsLabo
value = get('Auteurs').map(author => author.affiliations.map(aff => aff.url)).flatten().uniq()
value = get('Auteurs').map(author => author.affiliations.filter(aff => aff.url!=="empty").map(aff => aff.url)).flatten().uniq()

[assign]
path = codesLabos
value = get("UrlsLabo").map(url => String(url).split("/").slice(-1)[0])
value = get("UrlsLabo").map(url => url.split("/").slice(-1)[0])

[OBJFlatten]
separator = /

[assign]
path = uri
value = get('id')
#constitution identifiant URI LOdex à partir de l'ID

# Ensures that each object contains an identification key (required by lodex)
[swing]
Expand All @@ -91,4 +97,3 @@ path = lodexStamp.usedParser
value = env('parser')
path = lodexStamp.uploadedFilename
value = env('source')

0 comments on commit 2f07253

Please sign in to comment.