Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Nov 5, 2024
1 parent 2ca5523 commit e1be058
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions data/defaults/crossref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ filters:
path: doi-batch-id.lua
- type: lua
path: flatten-references.lua
- type: lua
path: conditional-archives.lua

template: '${.}/../templates/neurolibre.crossref'
22 changes: 22 additions & 0 deletions data/filters/conditional-archives.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function Meta(meta)
-- Check if each DOI is present and not set to 'N/A'
if meta.repository_doi and meta.repository_doi ~= 'N/A' then
meta.include_repository_doi = true
end
if meta.data_doi and meta.data_doi ~= 'N/A' then
meta.include_data_doi = true
end
if meta.book_doi and meta.book_doi ~= 'N/A' then
meta.include_book_doi = true
end
if meta.docker_doi and meta.docker_doi ~= 'N/A' then
meta.include_docker_doi = true
end
if meta.software_review_url and meta.software_review_url ~= 'N/A' then
meta.include_software_review = true
end
if meta.book_exec_url and meta.book_exec_url ~= 'N/A' then
meta.include_book_exec = true
end
return meta
end
12 changes: 11 additions & 1 deletion data/templates/neurolibre.crossref
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,24 @@ $endfor$
<ai:license_ref applies_to="tdm">http://creativecommons.org/licenses/by/4.0/</ai:license_ref>
</ai:program>
<rel:program>
$if(repository_doi != 'N/A')$
$if(include_repository_doi)$
<rel:related_item><rel:description>Repository archive</rel:description><rel:inter_work_relation relationship-type="isSupplementedBy" identifier-type="doi">$repository_doi$</rel:inter_work_relation></rel:related_item>
$endif$
$if(include_data_doi)$
<rel:related_item><rel:description>Dataset archive</rel:description><rel:inter_work_relation relationship-type="isSupplementedBy" identifier-type="doi">$data_doi$</rel:inter_work_relation></rel:related_item>
$endif$
$if(include_book_doi)$
<rel:related_item><rel:description>Book archive</rel:description><rel:inter_work_relation relationship-type="isSupplementedBy" identifier-type="doi">$book_doi$</rel:inter_work_relation></rel:related_item>
$endif$
$if(include_docker_doi)$
<rel:related_item><rel:description>Container archive</rel:description><rel:inter_work_relation relationship-type="isSupplementedBy" identifier-type="doi">$docker_doi$</rel:inter_work_relation></rel:related_item>
$endif$
$if(include_software_review)$
<rel:related_item><rel:description>GitHub technical screening</rel:description><rel:inter_work_relation relationship-type="isSupplementedBy" identifier-type="uri">$software_review_url$</rel:inter_work_relation></rel:related_item>
$endif$
$if(include_book_exec)$
<rel:related_item><rel:description>Executable preprint</rel:description><rel:inter_work_relation relationship-type="isSupplementedBy" identifier-type="uri">$book_exec_url$</rel:inter_work_relation></rel:related_item>
$endif$
</rel:program>
<doi_data>
<doi>$article.doi$</doi>
Expand Down

0 comments on commit e1be058

Please sign in to comment.