0

I want to check the bibliography in a big editorial project. This works quite well with

biber --validate-datamodel debug-biber-check-datamodel

But there is a problem with the field booktitle. Bibdesk adds booktitle to all book items and I need booktitle for crossref as well.

Running validate-datamodel on the file below, I get the following warnings:

WARN - Datamodel: Entry 'HPSGHandbook' (ref.bib): Invalid field 'booktitle' for entrytype 'book'
WARN - Datamodel: Entry 'HPSGHandbook' (ref.bib): Missing mandatory field 'author'

Is there a way to get rid of these messages? I now it is possible to add to a datamodel but I could not figure out how.

\documentclass{scrbook}

\begin{filecontents}{ref.bib}

@incollection{AC2020a,
Author = {Anne Abeillé and Rui P. Chaves},
Crossref = {HPSGHandbook},
Title = {Coordination}}


@book{HPSGHandbook,
Address = {Berlin},
Booktitle = {{Head-Driven Phrase Structure Grammar: The} Handbook},
Editor = {Stefan Müller and Anne Abeillé and Borsley, Robert D. and Jean-Pierre Koenig},
Publisher = {Language Sciene Press},
Title = {{Head-Driven Phrase Structure Grammar: The} Handbook},
Year = {2020}}

\end{filecontents}

\usepackage[
        backend=biber,
]{biblatex}
\addbibresource{ref.bib}

\begin{document}

\cite{AC2020a,HPSGHandbook}

\printbibliography
\end{document}
1

These messages are perfectly sensible according to the standard data model: @books don't have a booktitle but should have an author.

Things get much, much better when you make HPSGHandbook an @collection. In that case you won't get a warning about a missing author (because @collection is not supposed to have one) and you won't need the booktitle, because the title will be automatically inherited by a child @incollection as booktitle.

\documentclass{article}

\begin{filecontents}{\jobname.bib}
@incollection{AC2020a,
  author   = {Anne Abeillé and Rui P. Chaves},
  title    = {Coordination},
  crossref = {HPSGHandbook},
}
@collection{HPSGHandbook,
  editor    = {Stefan Müller and Anne Abeillé and Borsley, Robert D. and Jean-Pierre Koenig},
  title     = {Head-Driven Phrase Structure Grammar: The Handbook},
  year      = {2020},
  address   = {Berlin},
  publisher = {Language Science Press},
}
\end{filecontents}

\usepackage[
  backend=biber,
]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
\autocite{AC2020a,HPSGHandbook}

\printbibliography
\end{document}

[1] Anne Abeillé and Rui P. Chaves. “Coordination”. In: Head-Driven Phrase Structure Grammar: The Handbook. Ed. by Stefan Müller et al. Berlin: Language Sciene Press, 2020.//[2] Stefan Müller et al., eds. Head-Driven Phrase Structure Grammar: The Handbook. Berlin: Language Sciene Press, 2020.


I really don't see the point in changing the data model in a way to allow the bad input to pass. The whole point of data model validation is to pick up issues in your file that you might not see when you just look at the output.

If you insist, here is an MWE that includes a changed data model that adds booktitle to the known fields for @book and drops the requirement to have an author. It's quite long, because the data model constraints have to be restated (there is no interface to remove a single mandatory-field constraint, see also the comments below my answer to How to cite report-like documents that do not have/need an institution?).

\documentclass{article}

\begin{filecontents}{\jobname.bib}
@incollection{AC2020a,
  author   = {Anne Abeillé and Rui P. Chaves},
  title    = {Coordination},
  crossref = {HPSGHandbook},
}
@book{HPSGHandbook,
  editor    = {Stefan Müller and Anne Abeillé and Borsley, Robert D. and Jean-Pierre Koenig},
 title      = {Head-Driven Phrase Structure Grammar: The Handbook},
  booktitle = {Head-Driven Phrase Structure Grammar: The Handbook},
  year      = {2020},
  address   = {Berlin},
  publisher = {Language Sciene Press},
}
\end{filecontents}
\begin{filecontents}{bookparent.dbx}
\DeclareDatamodelEntryfields[book]{
  booktitle}
  
\ResetDatamodelConstraints

\DeclareDatamodelConstraints[
  article,
  book,
  inbook,
  bookinbook,
  suppbook,
  booklet,
  collection,
  incollection,
  suppcollection,
  manual,
  misc,
  mvbook,
  mvcollection,
  online,
  patent,
  periodical,
  suppperiodical,
  proceedings,
  inproceedings,
  reference,
  inreference,
  report,
  set,
  thesis,
  unpublished]{
    \constraint[type=mandatory]{
      \constraintfieldsxor{
        \constraintfield{date}
        \constraintfield{year}
      }
    }
  }

\DeclareDatamodelConstraints[set]{
  \constraint[type=mandatory]{
    \constraintfield{entryset}
  }
}

\DeclareDatamodelConstraints[article]{
  \constraint[type=mandatory]{
    \constraintfield{author}
    \constraintfield{journaltitle}
    \constraintfield{title}
  }
}

\DeclareDatamodelConstraints[book,mvbook,mvcollection,mvreference]{
  \constraint[type=mandatory]{
    \constraintfield{title}
  }
}

\DeclareDatamodelConstraints[inbook,bookinbook,suppbook]{
  \constraint[type=mandatory]{
    \constraintfield{author}
    \constraintfield{title}
    \constraintfield{booktitle}
  }
}

\DeclareDatamodelConstraints[booklet]{
  \constraint[type=mandatory]{
    \constraintfieldsor{
      \constraintfield{author}
      \constraintfield{editor}
    }
    \constraintfield{title}
  }
}

\DeclareDatamodelConstraints[collection,reference]{
  \constraint[type=mandatory]{
    \constraintfield{editor}
    \constraintfield{title}
  }
}

\DeclareDatamodelConstraints[incollection,suppcollection,inreference]{
  \constraint[type=mandatory]{
    \constraintfield{author}
    \constraintfield{editor}
    \constraintfield{title}
    \constraintfield{booktitle}
  }
}

\DeclareDatamodelConstraints[dataset]{
  \constraint[type=mandatory]{
    \constraintfield{title}
  }
}

\DeclareDatamodelConstraints[manual]{
  \constraint[type=mandatory]{
    \constraintfield{title}
  }
}

\DeclareDatamodelConstraints[misc,software]{
  \constraint[type=mandatory]{
    \constraintfield{title}
  }
}

\DeclareDatamodelConstraints[online]{
  \constraint[type=mandatory]{
    \constraintfield{title}
    \constraintfieldsor{
      \constraintfield{url}
      \constraintfield{doi}
      \constraintfield{eprint}
    }
  }
}

\DeclareDatamodelConstraints[patent]{
  \constraint[type=mandatory]{
    \constraintfield{author}
    \constraintfield{title}
    \constraintfield{number}
  }
}

\DeclareDatamodelConstraints[periodical]{
  \constraint[type=mandatory]{
    \constraintfield{editor}
    \constraintfield{title}
  }
}

\DeclareDatamodelConstraints[proceedings,mvproceedings]{
  \constraint[type=mandatory]{
    \constraintfield{title}
  }
}

\DeclareDatamodelConstraints[inproceedings]{
  \constraint[type=mandatory]{
    \constraintfield{author}
    \constraintfield{title}
    \constraintfield{booktitle}
  }
}

\DeclareDatamodelConstraints[report]{
  \constraint[type=mandatory]{
    \constraintfield{author}
    \constraintfield{title}
    \constraintfield{type}
    \constraintfield{institution}
  }
}

\DeclareDatamodelConstraints[thesis]{
  \constraint[type=mandatory]{
    \constraintfield{author}
    \constraintfield{title}
    \constraintfield{type}
    \constraintfield{institution}
  }
}

\DeclareDatamodelConstraints[unpublished]{
  \constraint[type=mandatory]{
    \constraintfield{author}
    \constraintfield{title}
  }
}

\DeclareDatamodelConstraints{
  \constraint[type=data, datatype=isbn]{
    \constraintfield{isbn}
  }
  \constraint[type=data, datatype=issn]{
    \constraintfield{issn}
  }
  \constraint[type=data, datatype=ismn]{
    \constraintfield{ismn}
  }
  \constraint[type=data, datatype=pattern, pattern=\regexp{(?:sf|sm|sn|pf|pm|pn|pp)}]{
    \constraintfield{gender}
  }
}
\end{filecontents}

\usepackage[
  backend=biber,
  datamodel=bookparent,
]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
\autocite{AC2020a,HPSGHandbook}

\printbibliography
\end{document}
5
  • OK. I tried to switch my bib to collection rather than book for edited volumes. The problem is that this data-type is not defined in my tools (bibdesk) and if I define it, incollection does not inherit the booktitle from the title field of collection for display. – Stefan Müller Sep 24 '20 at 7:54
  • @StefanMüller Well if BibDesk doesn't support these advanced biblatex features maybe you need to think about using a different tool (or about handling these cases manually). I don't quite understand the second half of your comment: As shown in the first MWE, @incollections do inherit their parent-@collection's title as booktitle. – moewe Sep 24 '20 at 14:49
  • Yes, the second part of the sentence also refered to BibDesk: When I define "collection" manually, the title value of collection is not inherited to booktitle of incollection within BibDesk. Maybe I should contact the author. But maybe different tools have similar problems. I want to have my items usable for everybody. – Stefan Müller Sep 28 '20 at 9:43
  • @StefanMüller If I read sourceforge.net/p/bibdesk/feature-requests/787 correctly at least eight years ago the BibDesk developer simply did not want to fully support biblatex functionality in BibDesk. I understand the desire to have a .bib file working everywhere and for everyone, but frankly if you start using advanced biblatex features like crossref inheritance your tool chain should probably support it. I absolutely can't recommend messing with the biblatex data model just to be able to continue using your incompatible toolchain. ... – moewe Sep 29 '20 at 6:03
  • 1
    ... In particular Biber's data model validation is supposed to pick up if you use the data model as intended. If you decide you don't want to use the data model as intended because your toolchain doesn't support it, that's fine as long as you are happy with the output, but there is no point in validating against the data model since you consciously decided to deviate from it. Changing the data model validation constraints without also making sure all styles you use are aware of your modified data model will not result in useful warnings. – moewe Sep 29 '20 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.