Problema con el mapeo de fuentes de Biber

Problema con el mapeo de fuentes de Biber

Debajo de un mwe:

\begin{filecontents}[overwrite]{\jobname.bib}
@customa{a,
  author = {Author},
  eventdate = {1000-01-01},
  title = {Title},
  journaltitle = {Journaltitle},
  date = {3000},
}
@customa{b,
  author = {Author},
  eventdate = {2000-01-01},
  title = {Title},
  journaltitle = {Journaltitle},
  date = {1000},
}
@customa{c,
  author = {Author},
  eventdate = {3000-01-01},
  title = {Title},
  journaltitle = {Journaltitle},
  date = {2000},
}
@article{article,
  author = {Author},
  title = {Title},
  journaltitle = {Journaltitle},
  date = {2000},
}
\end{filecontents}

\documentclass{article}
\usepackage[style=authortitle]{biblatex}
\addbibresource{\jobname.bib}

\DeclareStyleSourcemap{
  \maps{
    \map{
      \pertype{customa}
      \step[fieldsource=eventdate, match=\regexp{\A(\d+)}]
      \step[fieldset=sortyear, fieldvalue={$1}]
    }
  }
}

\DeclareBibliographyDriver{customa}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \printnames{author}%
  \newunit
  \printeventdate
  \newunit
  \usebibmacro{title}%
  \newunit\newblock
  \bibstring{in}%
  \printunit{\intitlepunct}
  \usebibmacro{journal+issuetitle}%
  \usebibmacro{finentry}}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

El mwe funciona bien.

Por lo que tengo entendido, si <datetype>dateestá definido, biber/biblatex genera automáticamente los campos <datetype>yeary .<datetype>month<datetype>day

Por lo tanto, el código fuente también debería poder escribirse de la siguiente manera.

\DeclareStyleSourcemap{
  \maps{
    \map{
      \pertype{customa}
      \step[fieldsource=eventyear]
      \step[fieldset=sortyear, origfieldval]
    }
  }
}

Pero esta segunda solución no funciona. ¿Por qué? ¿Cuál es el error? Gracias.

Respuesta1

El paso de mapeo de origen, en el que Biber aplica los cambios a los datos, ocurre muy temprano durante el procesamiento del .bibarchivo. En particular, ocurre antes del paso en el que Biber divide los campos de fecha en sus componentes.

Entonces, cuando \DeclareStyleSourcemapse ejecuta, el campo de fecha todavía está eventdate(como se indica en el .bibarchivo) y eventyearlos amigos aún no están disponibles.

información relacionada