Advanced Relationship Attribute Syntax

From MusicBrainz Wiki
Revision as of 21:47, 4 May 2007 by Murdos (talk | contribs) ((Imported from MoinMoin))
Jump to navigationJump to search

Syntax for AdvancedRelationship Attributes

Defining Attributes

RelationshipEditors can specify AdvancedRelationshipAttributes in the "Edit Rel.Types" menu (http://musicbrainz.org/edit/relationships/link_attrs.html).

The list starts with a "ROOT" node which cannot be edited, but you can add new sub-nodes to that node.

  • Nodes that have no children will be yes/no attributes. Those are displayed as checkboxes when a user edits an AdvancedRelationship.
  • Nodes which have one (two???) or more children will be drop-down attributes. Those are displayed as drop down boxes.

Adding Attributes to Relationship Types

When editing an AdvancedRelationshipType, all existing attributes are presented. Each one has

  • A checkbox to enable the attribute for that relationship type.
  • A "Min." and a "Max" value.
  • These values specify how often the attribute can be selected:
    • choose 0-1 for an optional attribute
    • choose 1-1 for a compulsory attribute
    • choose a higher number if you want people to select multiple values (this only really makes sense for drop-down attributes).

Please AnswerMe: What happens if the Min. or Max fields are left empty?

Displaying Attributes

AdvancedRelationshipAttribute are displayed in the link phrases on the server using the following syntax:

  • {<attribute>}
  • Displays the value <attribute> is set to.
  • {<attribute>: <text>}
  • Displays <text> if <attribute> is set.
  • {<attribute>: <truetext>|<falsetext>}
  • Displays <truetext> if <attribute> is set, else it displays <falsetext>.

All texts can contain a percent sign (%) which will be replaced by the value the attribute is set to.

Example

{instrument:has %|was} {additional:additionally} arranged by

Instrument is a drop-down attribute, additional is a yes/no attribute. Thus it would result in "has Violins arranged by" or "was additionally arranged by".