Crossref export: emit hasPreprint relation from related-article preprint entries#327
Draft
Crossref export: emit hasPreprint relation from related-article preprint entries#327
Conversation
… entries Agent-Logs-Url: https://github.com/scieloorg/articles_meta/sessions/4132fd93-82e7-460e-ba46-59f75ea60c86 Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix preprint relation data not sent to Crossref
Crossref export: emit hasPreprint relation from related-article preprint entries
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XMLProgramRelatedItemPipeonly emittedisTranslationOf/hasTranslationrelations, so a JATS<related-article related-article-type="preprint" .../>was dropped from thexmlcrossrefdeposit and the preprint link was never registered with Crossref (e.g. http://doi.org/10.1590/0102-469854644).O que esse PR faz?
Estende
XMLProgramRelatedItemPipe._transform_original(emarticlemeta/export_crossref.py) para emitir, noprogramdojournal_articleprincipal, um<intra_work_relation relationship-type="hasPreprint" identifier-type="doi">para cada entrada dev241cujot == 'preprint'. SciELO armazena<related-article>emv241com subcamposi(href/DOI),t(related-article-type) en(ext-link-type); apenas entradas comn == 'doi'(ou ausente) são emitidas, poishasPreprintexige DOI._get_preprint_relations(raw)que filtraraw.data['article']['v241'];_transform_originalitera o resultado e adiciona umrelated_itempor preprint, depois das traduções.journal_articleprincipal (DOI canônico). As traduções já apontam para ele viahasTranslation, então o vínculo com o preprint fica ancorado na obra original.tests/test_export_crossref.pycobrindo (1) emissão correta no artigo principal e ausência nas traduções, (2) ausência dev241, (3)related-article-typediferente depreprint.Trecho do XML resultante:
Onde a revisão poderia começar?
articlemeta/export_crossref.py—XMLProgramRelatedItemPipe._get_preprint_relationse_transform_original.Como este poderia ser testado manualmente?
<related-article ext-link-type="doi" related-article-type="preprint" xlink:href="..."/>(ex.: PIDS0102-46982024000100100, DOI10.1590/0102-469854644).article.v241populado (subcamposi,t=preprint,n=doi).xmlcrossrefe verificar a presença, nojournal_articleprincipal, de<program><related_item><intra_work_relation relationship-type="hasPreprint" identifier-type="doi">…</intra_work_relation></related_item></program>apontando para o DOI do preprint.pytest tests/test_export_crossref.py -k "related_item or preprint".Algum cenário de contexto que queira dar?
A relação
hasPreprinté o mecanismo do Crossref para vincular o artigo final ao preprint correspondente (visível emrelationna API do Crossref). Hoje esse vínculo se perde no depósito, embora esteja correto no XML do artigo. A mudança não afeta o depósito de relações de tradução já existentes.Screenshots
N/A — alteração apenas no XML gerado.
Referências
v241↔<related-article>emscieloorg/prodtools(prodtools/db/xc_models.py).Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
articlemeta.scielo.org/usr/bin/curl curl -s REDACTED(dns block)/usr/bin/curl curl -s REDACTED -o /tmp/sample.json -w %{http_code}\n _TOKEN"; }; f(dns block)If you need me to access, download, or install something from one of these locations, you can either: