YAML

YAML is a simplified markup language (English markup language) for data serialization, leaning on XML ( originally ) and the data structures in the languages ​​Perl, Python and C as well as the presented in RFC 2822 email format. The idea for YAML comes from Clark Evans, the specification was created by himself, Brian Ingerson and Oren Ben- Kiki.

YAML is a recursive acronym for " YAML Is not Markup Language " (originally " Yet Another Markup Language ").

Design goals

The basic assumption of YAML is that any data structure can be represented only with associative lists, lists ( arrays) and individual values ​​( scalars ). This simple concept YAML is much easier to read by humans and to write as for example XML, it also simplifies the processing of the data, since most languages ​​have already integrated such constructs.

Examples

Note:

  • The # character represents a single-line comments, --- marks the beginning of a new section.
  • A comment on the same line as --- can indeed cause problems when reading the YAML file - for reasons of clarity, however, it is in the example still in the same line.

Lists:

--- # Favorite movies, block format - Casablanca - Spellbound - Notorious --- # Shopping list, inline format [ milk, bread, eggs ] Associative lists:

--- # Block name: John Smith age: 33 --- # Inline {name: John Smith, age: 33} Block expressions in which line breaks are retained:

--- |    There was a young fellow of Warwick    Who had reason for feeling euphoric        For he could, by election        Have triune erection    Ionic, Corinthian, and Doric Block - expressions, in which individual line breaks are ignored:

--->    Wrapped text    will be folded    into a single    paragraph      Blank lines denote    paragraph breaks List of associative lists:

- {Name: John Smith, age: 33} -    name: Mary Smith    age: 27 Associative list of lists:

Men: [ John Smith, Bill Jones ] women:    - Mary Smith    - Susan Williams implementations

YAML implementations exist, among others, for the programming languages ​​C, C , JavaScript, ActionScript, Perl, PHP, Python, Java, Ruby, and for. NET platform.

Similar techniques

With JSON, a similar technology that is based more on the object model (DOM) and comes from the JavaScript scripting language. JSON is a proper subset of YAML: Each JSON document is Version 1.2 of the YAML a valid YAML document. Most parsers that are mentioned on the website of YAML, but they only support YAML ≤ 1.1 and therefore not all JSON documents (as of March 18, 2014).

Also for the graphical notation language UML ( Version 2) there is a text-based alternative that is designed to be easy to read for people out - the Human - Usable Textual Notation ( HUTN ). The metamodel of UML and MOF each HUTN is so HUTN may be any UML diagram as an easily readable text. The easy readability differs HUTN from XMI format that is intended for the exchange of data between UML applications.

832026
de