Contact US
One benefit of this format, which you might see immediately, is that there are no more curly or square brackets. YAML can be considered a superset of JSON with a few extra features such as comments, anchoring, and aliasing. Simply precede a line in the file with a # character and it is considered a comment. Anchoring and aliasing has to do with removing the necessity to duplicate data throughout the file. Also, the alias simplifies updates to an attribute, where the change needs to only happen in a single place, instead of multiple ones.
Session:
# This is a comment
Scenario: &scenario TikTok
Counter: 5
Electrode: AF3
THETA: 9.681
ALPHA: 3.849
GAMMA: 0.738
Scenario: *scenario
Counter: 6
Electrode: Pz
THETA: 8.392
ALPHA: 4.142
GAMMA: 1.106
Notice that the first instance of Scenario: is followed by an ampersand, &, then the name of the identifier followed by the value. In all future locations where this same value is needed, enter the identifier preceded with a star instead of placing the actual value. YAML isn’t prime time yet and not the primary choice for doing Big Data analytics. But it is up and coming and worthy of being called out. The best uses of YAML include when you have been using JSON but want the additional features available in YAML.
Archives
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- July 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- May 2022
- April 2022
- February 2022
- January 2022
- December 2021
- October 2021
- September 2021
- August 2021
- June 2021
- May 2021
- April 2021
Contact US