Skip to content

Latest commit

 

History

History
314 lines (272 loc) · 7.24 KB

YAML2SpecificationCompliance.adoc

File metadata and controls

314 lines (272 loc) · 7.24 KB

Chronicle Wire and YAML 1.2

YAML 1.2 Specification Compliance

Chronicle wire supports a subset of the features available from the YAML 2 specification. This section lists those features and suggests other ways in Chronicle Wire to define the same thing.

YAML 1.2 features supported in Chronicle Wire

The list below lists the features of the specification that are implemented in Chronicle Wire.

Note
The numbers refer to the section in the YAML 2 specification. See http://yaml.org/spec/1.2/spec.html for more information.

Feature

Strict YAML Specification Compliance

Equivalent Operations in Chronicle Wire

Section 2_1, SequenceOfScalars

Yes

Section 2_2, MappingScalarsToScalars

Yes

Section 2_3, MappingScalarsToSequences

Yes

Section 2_4, SequenceOfMappings

No

Section 2.4, Sequence of Mappings

Section 2_5, SequenceOfSequences

Yes

Section 2_6, MappingOfMappings

Yes

Section 2_7, TwoDocumentsInAStream

No

Section 2.7, Two Documents in a Stream

Section 2_8, PlayByPlayFeed

No

Section 2.8, Play by Play Feed from a Game

Section 2_9, SingleDocumentWithTwoComments

No

Section 2.9, Single Document with Two Comments

Section 2_10, NodeAppearsTwiceInThisDocument

No

Section 2_11, MappingBetweenSequences

No

Section 2_12, CompactNestedMapping

No

Section 2.12, Compact Nested Mapping

Section 2_13, InLiteralsNewlinesArePreserved

No

Section 2_14, InThefoldedScalars

No

Section 2.14, In the folded scalars, newlines become spaces

Section 2_15, FoldedNewlines

No

Section 2_16, IndentationDeterminesScope

No

Section 2.16, Indentation determines scope

Section 2_17, QuotedScalars

No

Section 2.17, Quoted Scalars

Section 2_18, Multi_lineFlowScalars

No

Section 2.18, Multi-line Flow Scalars

Section 2_19, Integers

Yes

Section 2_20, FloatingPoint

Yes

Section 2_21, Miscellaneous

No

Section 2.21, Miscellaneous

Section 2_22, Timestamps

Yes

Section 2_23, VariousExplicitTags

No

Section 2_24, GlobalTags

No

Section 2_25, UnorderedSets

No

Section 2_26, OrderedMappings

No

Section 2_27, Invoice

No

Section 2_28, LogFile

No

Yaml 2 Equivalent Operation in Chronicle-Wire

The section numbering below reflects that of the fix specification - see http://yaml.org/spec/1.2/spec.html

2.4 Sequence of Mappings (player statistics)

Yaml Spec Example
 -
   name: Mark McGwire
   hr:   65
   avg:  0.278
 -
   name: Sammy Sosa
   hr:   63
   avg:  0.288
Chronicle-Wire equivalent:
[
    {
      name: Mark McGwire,
      hr:   65,
      avg:  0.278
    },
    {
      name: Sammy Sosa,
      hr:   63,
      avg:  0.288
    }
]

2.7 Two Documents in a Stream (each with a leading comment)

Yaml Spec Example
# Ranking of 1998 home runs
---
- Mark McGwire
- Sammy Sosa
- Ken Griffey

# Team ranking
---
- Chicago Cubs
- St Louis Cardinals
Chronicle-Wire equivalent:
[
# Ranking of 1998 home runs
- Mark McGwire
- Sammy Sosa
- Ken Griffey
,
# Team ranking
- Chicago Cubs
- St Louis Cardinals
]

2.8 Play by Play Feed from a Game

Yaml Spec Example
---
time: 20:03:20
player: Sammy Sosa
action: strike (miss)
...
---
time: 20:03:47
player: Sammy Sosa
action: grand slam
...
Chronicle-Wire equivalent:
[
  {
    time: 20:03:20
    player: Sammy Sosa
    action: strike (miss)
  },
  {
    time: 20:03:47
    player: Sammy Sosa
    action: grand slam
  }
]

2.9 Single Document with Two Comments

Yaml Spec Example
---
hr: # 1998 hr ranking
  - Mark McGwire
  - Sammy Sosa
rbi:
  # 1998 rbi ranking
  - Sammy Sosa
  - Ken Griffey
Chronicle-Wire equivalent:
hr: # 1998 hr ranking
  - Mark McGwire
  - Sammy Sosa
rbi:
  # 1998 rbi ranking
  - Sammy Sosa
  - Ken Griffey

2.12 Compact Nested Mapping

Yaml Spec Example
---
# Products purchased
- item    : Super Hoop
  quantity: 1
- item    : Basketball
  quantity: 4
- item    : Big Shoes
  quantity: 1
Chronicle-Wire equivalent:
# Products purchased
-  {item: Super Hoop,
    quantity: 1}
-  {item: Basketball,
    quantity: 4}
-  {item: Big Shoes,
    quantity: 1}

2.14 In the folded scalars, newlines become spaces

Yaml Spec Example
--- >
  Mark McGwire's
  year was crippled
  by a knee injury.
Chronicle-Wire equivalent:
[Mark McGwire's
  year was crippled
  by a knee injury.]

2.16 Indentation determines scope

Yaml Spec Example
name: Mark McGwire
accomplishment: >
  Mark set a major league
  home run record in 1998.
stats: |
  65 Home Runs
  0.278 Batting Average
Chronicle-Wire equivalent:
name: Mark McGwire
accomplishment:
  Mark set a major league home run record in 1998.
stats:
-  65 Home Runs,
-  0.278 Batting Average

2.17 Quoted Scalars

Yaml Spec Example
unicode: "Sosa did fine.\u263A"
control: "\b1998\t1999\t2000\n"
hex esc: "\x0d\x0a is \r\n"

single: '"Howdy!" he cried.'
quoted: ' # Not a ''comment''.'
tie-fighter: '|\-*-/|'
Chronicle-Wire equivalent:
unicode: "Sosa did fine.\u263A"
control: "\b1998\t1999\t2000\n"
hex esc: "\x0d\x0a is \r\n"
single: "Howdy! he cried.",
quoted: " # Not a ''comment''."
tie-fighter: '|\-*-/|'

2.18 Multi-line Flow Scalars

Yaml Spec Example
plain:
  This unquoted scalar
  spans many lines.

quoted: "So does this
  quoted scalar.\n"
Chronicle-Wire equivalent:
plain: "
  This unquoted scalar
  spans many lines."
quoted: "So does this
  quoted scalar.\n"

2.21 Miscellaneous

Yaml Spec Example
null:
booleans: [ true, false ]
string: '012345'
Chronicle-Wire equivalent:
{
null: ,
booleans: [ true, false ],
string: '012345'
}