I want to extend biber
's data model, i.e. I want biber
to accept fields such as review
or owner
as valid entry fields for all entry types.
(Note: This is not about using data from these fields in a document, nor do I want to map custom fields to existing fields such as usera
or customa
. Please see below ("Background") if you wonder why I'm asking this.)
Using biber
in tool mode, I extended the default configuration file (found with biber --tool-conf
) in the following way:
<config>
<!-- skipped 383 lines -->
<datamodel>
<!-- skipped "constants" and "entrytypes" -->
<fields>
<!-- skipped all predefined fields -->
<field fieldtype="field" datatype="literal">owner</field>
<field fieldtype="field" datatype="literal">review</field>
</fields>
<entryfields>
<field>owner</field>
<field>review</field>
<!-- skipped remainder of file -->
</entryfields>
</datamodel>
</config>
I uploaded the full modified biber.conf
to pastebin.com.
As far as I can see, this "works", i.e. running biber --tool input.bib
with this input.bib
@REPORT{Self2016,
YEAR = {2016},
AUTHOR = {Self, My},
TITLE = {The title},
OWNER = {Me},
REVIEW = {Important stuff.}
}
does not delete the review
and owner
fields with the modified configuration file (whereas the default configuration deletes these fields).
My Question is: Why does this work? I found this solution more or less by trial and error. I suppose that adding the <field ...>
in <fields>
tells biber
that such a field may exist. Actually, this extension of the configuration alone is functional. I further assume that the entry under <entryfields>
makes the new field a valid field for all entry types. If I skip this part, biber
complains when I call it with --validate-datamodel
.
Could you please tell me if my assumptions are correct and help me to understand where this can be found in the biber or biblatex manual? I think §4.5.4 in the biblatex
manual is quite relevant, but is there any documentation on how the LaTeX commands documented there are related to the XML structure in biber.conf
?
Besides, is this the correct way to extend the data model or did I do it terribly wrong but the test case is too simple to reveal this?
Background: I use JabRef to manage my references. Sometimes, I use JabRef's "Review" tab to annotate an entry. These notes are saved in the review
field of the respective entry. From time to time, I run biber
in tool mode on the BIB file, in order to get clean formatting, sorting and apply some other transformations. This worked well in the past, but as of biber 2.6, biber discards custom entry fields. This is what I reported here on Github where @plk advised me to extend the data model.