Menu

Inheritance

Philip Kime

In order to allow flexible and extensible crossreference inheritance rules, a bcf section is defined which allows:

  • Target can inherit all source fields by default, with exceptions (scope: global, source/target type pair specific)
  • Target can override its own fields with those of the source or not (scope: global, source/target type pair, field)
  • Target can map source fields to different target fields (scope: global, source/target type pair specific)

Here is an example bcf section followed by an explanation of the syntax. See also the [Control_file_schema]

<bcf:inheritance>
  <bcf:defaults inherit_all="true" override_target="false">
    <bcf:type_pair source="*" target="incollection" inherit_all="false"/> 
  </bcf:defaults>
  <bcf:inherit>
    <bcf:type_pair source="book" target="inbook"/>
    <bcf:field source="author" target="bookauthor" override_target="true"/>
    <bcf:field source="title" target="booktitle" override_target="true"/>
    <bcf:field source="titleaddon" target="booktitleaddon"  override_target="true"/>
    <bcf:field source="subtitle" target="booksubtitle" override_target="true"/>
    <bcf:field source="abstract" target=""/>
  </bcf:inherit>
  <bcf:inherit>
    <bcf:type_pair source="*" target="incollection"/>
    <bcf:type_pair source="proceedings" target="*"/>
    <bcf:field source="title" target="booktitle" override_target="false"/>
  </bcf:inherit>
</bcf:inheritance>

Here is an annotated commentary on this fragment:

  <bcf:defaults inherit_all="true" override_target="false">

This says that the default for crossreference inheritance is to allow targets to inherit all of the source entry fields. We also cannot override the target field if it exists.

   <bcf:type_pair source="*" target="incollection" inherit_all="false"/>

This is a source/target type pair default setting. It says that "incollection" entries with a CROSSREF field do not by default inherit fields from their source entry. They can still inherit specifically mentioned fields, it's just that they won't inherit anything unless it's specifically allowed by an inherit section. See below.

The rest of the XML tag for inheritance is a number of "inherit" tags which give the inheritance rules for specific combinations of source/target entry types. You can also say "*" for an entry type to specify more universal inheritance rules.

 <bcf:inherit>
    <bcf:type_pair source="book" target="inbook"/>
    <bcf:field source="author" target="bookauthor" override_target="true"/>
    <bcf:field source="title" target="booktitle" override_target="true"/>
    <bcf:field source="titleaddon" target="booktitleaddon"  override_target="true"/>
    <bcf:field source="subtitle" target="booksubtitle" override_target="true"/>
    <bcf:field source="abstract" skip="true"/>
  </bcf:inherit>

For "inbook" entries which crossreference "book" entries:

  • The source entry "author" field becomes the target entry "bookauthor" field, overriding any value for this if it exists in the target already.
  • The source entry "title" field becomes the target entry "booktitle" field, overriding any value for this if it exists in the target already.
  • The source entry "titleaddon" field becomes the target entry "booktitleaddon" field, overriding any value for this if it exists in the target already.
  • The source entry "subtitle" field becomes the target entry "booksubtitle" field, overriding any value for this if it exists in the target already.
  • The source entry "abstract" field is suppressed and not copied to the target entry

    <bcf:inherit>
    <bcf:type_pair source="" target="incollection"/>
    <bcf:type_pair source="proceedings" target="
    "/>
    <bcf:field source="title" target="booktitle" override_target="false"/>
    </bcf:inherit>

For any entry type which crossreferences a "proceedings" entry and for "incollection" entries which crossreference any entry type:

  • The source entry "title" field becomes the target entry "booktitle" field, only if the target entry doesn't already have a "booktitle" field.

Related

Wiki: Control_file_schema
Wiki: Main_Page

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.