From: Pierre Choffet Date: Wed, 3 Jun 2026 20:27:58 +0000 (-0400) Subject: Fix buggy titles fix step X-Git-Url: https://git.choffet.net/?a=commitdiff_plain;h=eb991e6cd7bec7ec112e5001483de8973fd83eb1;p=banq_wikidata.git Fix buggy titles fix step --- diff --git a/README b/README index d53424b..e98eb67 100644 --- a/README +++ b/README @@ -118,7 +118,14 @@ pour les titres d’œuvres en vigueur sur Wikipédia. Une fois l’édition terminée, les correctifs sur les titres peuvent être réintégrés dans le fichier records_fix.xml via la commande suivante : - $ ./banq2wd.sh --merge-fixes records_fix.xml /tmp/titres.tsv + $ ./banq2wd.sh --merge-fixes records_fix.xml 2-filtered.xml > records_fix_new.xml 2>records_fix.log + +Un journal du traitement est créé dans records_fix.log ainsi qu'un fichier +records_fix_new.xml intégrant les nouvelles modifications. Ce dernier peut, +pour validation, être comparé au fichier original « records_fix.xml » et doit le +remplacer si le résultat est correct : + + $ mv records_fix_new.xml records_fix.xml 3. L’import vers Wikidata requiert que les données soient dans un format dont la @@ -185,7 +192,7 @@ seule la structure est purgée des entrées inutiles : pour l’opération est bien valide. Cette validation se fait au moyen d’un schéma XSD fourni dans le dépôt wdef_schemas : - $ xmlstarlet val -e -s wdef_schemas/wdef.xsd 6-wdef-canonicalized.xml 2> /tmp/validation.log + $ xmlstarlet val -e -s wdef_schemas/wdef.xsd 6-wdef-canonicalized.xml 2>/tmp/validation.log 9. Cette dernière étape couvre l’import effectif vers Wikidata. L’opération se diff --git a/banq2wd.sh b/banq2wd.sh index 7877fad..c6439b7 100755 --- a/banq2wd.sh +++ b/banq2wd.sh @@ -264,9 +264,8 @@ mergeFixes() { tr_parameters=(-s "leader=${leader}" -s "original-title=${source_title//\"/${doublequote_workaround}}" -s "title-lang=${title_lang}" -s "fixed-title=${fixed_title//\"/${doublequote_workaround}}" -s "original-subtitle=${source_subtitle//\"/${doublequote_workaround}}" -s "subtitle-lang=${subtitle_lang}" -s "fixed-subtitle=${fixed_subtitle//\"/${doublequote_workaround}}") local fixes_path_tmp="$(mktemp)" - xmlstarlet tr merge_fixes.xslt "${tr_parameters[@]}" "${old_fixes_path_tmp}" >| "${fixes_path_tmp}" + xmlstarlet tr merge_fixes_bibliographic.xslt "${tr_parameters[@]}" "${old_fixes_path_tmp}" >| "${fixes_path_tmp}" - echo ${index} >&2 rm "${old_fixes_path_tmp}" old_fixes_path_tmp="${fixes_path_tmp}" shift diff --git a/merge_fixes_bibliographic.xslt b/merge_fixes_bibliographic.xslt new file mode 100644 index 0000000..bcfc8e4 --- /dev/null +++ b/merge_fixes_bibliographic.xslt @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + %DOUBLEQUOTE-WORKAROUND% + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + subtitle + + + + + + + + + + + + + + + + + + + + + + + + + + + + + L’entrée avec le leader + + a un titre dans la langue «  + +  » qui a été conservé en plus du nouveau titre en «  + +  ». + + + + + + + + + + + + + title + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +