Skip to content

Fix KBART URL for Revista española de sanidad penitenciaria using ISSN redirect#84

Merged
robertatakenaka merged 4 commits intomasterfrom
copilot/update-url-revista-espanola
Feb 3, 2026
Merged

Fix KBART URL for Revista española de sanidad penitenciaria using ISSN redirect#84
robertatakenaka merged 4 commits intomasterfrom
copilot/update-url-revista-espanola

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

The journal "Revista española de sanidad penitenciaria" (SciELO Spain) discontinued its print ISSN 1575-0620 in favor of 2013-6463. KBART URLs still reference the old ISSN via the pid parameter, breaking database access.

Changes

  • Added ISSN redirect mechanism in export/kbart.py:

    • ISSN_URL_REDIRECTS dictionary maps deprecated ISSNs to current ones
    • Pre-compiled regex patterns (_ISSN_REDIRECT_PATTERNS) for performance
    • URL transformation applies during KBART generation in fmt_csv()
  • Regex pattern precisely targets pid parameter: ([?&]pid=)<old_issn>(&|$)

    • Avoids false positives in other URL components
    • Works regardless of parameter order

Result

# Before
"http://scielo.isciii.es/scielo.php?nrm=iso&pid=1575-0620&lng=&script=sci_issues"

# After
"http://scielo.isciii.es/scielo.php?nrm=iso&pid=2013-6463&lng=&script=sci_issues"

Future ISSN changes can be added to ISSN_URL_REDIRECTS without modifying logic.

Original prompt

This section details on the original issue you should resolve

<issue_title>Atualizar a URL do periódico "Revista española de sanidad penitenciaria" de SciELO Espanha no KBART</issue_title>
<issue_description>No KBART da coleção SciELO Espanha, a URL do periódico “Revista española de sanidad penitenciaria” utiliza o ISSN da versão impressa na URL. Porém o periódico deixou de usar o ISSN impresso e isso foi alterado na coleção SciELO Espanha, mas não reflete na URL informada no KBART, ocasionando erro de acesso à página dos periódicos nas bases de dados.

URL no KBART: http://scielo.isciii.es/scielo.php?nrm=iso&pid=1575-0620&lng=&script=sci_issues
URL válida: http://scielo.isciii.es/scielo.php?nrm=iso&pid=2013-6463&lng=&script=sci_issues

Faça uma troca pontual somente para esta revista, pois o correto é usar o conteúdo de journal.scielo_issn como ID </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 3, 2026 21:08
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Update URL for Revista española de sanidad penitenciaria in KBART Fix KBART URL for Revista española de sanidad penitenciaria using ISSN redirect Feb 3, 2026
Copilot AI requested a review from robertatakenaka February 3, 2026 21:12
@robertatakenaka robertatakenaka marked this pull request as ready for review February 3, 2026 22:22
Copilot AI review requested due to automatic review settings February 3, 2026 22:22
@robertatakenaka robertatakenaka merged commit 224c59f into master Feb 3, 2026
2 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates KBART URL generation to rewrite SciELO Spain journal issue URLs that still use a deprecated ISSN in the pid query parameter, restoring correct access for “Revista española de sanidad penitenciaria”.

Changes:

  • Added an ISSN_URL_REDIRECTS mapping and precompiled regex patterns to transform deprecated pid=<issn> values.
  • Applied the redirect transformation during KBART CSV URL generation in fmt_csv().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

line.append(data.url().replace('sci_serial', 'sci_issues'))
# Generate the URL
url = data.url().replace('sci_serial', 'sci_issues')

Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be trailing whitespace on the blank line after the url = ... assignment. Please remove the extra spaces to keep the diff clean and avoid whitespace-only changes.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines +182 to +189

# Apply ISSN redirects for journals that changed their ISSN in URLs
# This is necessary for journals that no longer use their print ISSN
for old_issn, new_issn in ISSN_URL_REDIRECTS.items():
# Use pre-compiled regex pattern for better performance
pattern = _ISSN_REDIRECT_PATTERNS[old_issn]
url = pattern.sub(r'\g<1>' + new_issn + r'\2', url)

Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be trailing whitespace on the blank line after the ISSN-redirect substitution loop. Please remove the extra spaces (or drop the blank line) to avoid whitespace-only diffs.

Suggested change
# Apply ISSN redirects for journals that changed their ISSN in URLs
# This is necessary for journals that no longer use their print ISSN
for old_issn, new_issn in ISSN_URL_REDIRECTS.items():
# Use pre-compiled regex pattern for better performance
pattern = _ISSN_REDIRECT_PATTERNS[old_issn]
url = pattern.sub(r'\g<1>' + new_issn + r'\2', url)
# Apply ISSN redirects for journals that changed their ISSN in URLs
# This is necessary for journals that no longer use their print ISSN
for old_issn, new_issn in ISSN_URL_REDIRECTS.items():
# Use pre-compiled regex pattern for better performance
pattern = _ISSN_REDIRECT_PATTERNS[old_issn]
url = pattern.sub(r'\g<1>' + new_issn + r'\2', url)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Atualizar a URL do periódico "Revista española de sanidad penitenciaria" de SciELO Espanha no KBART

2 participants