You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to suggest new types for the Core YAML Schema: Table and Matrix.
Table
Would be helpful in scenarios where we have a lot of objects with the same unordered keys
This format could be used for Relational DBMS applications to export and load data using readable text files, instead of the unreadable .csv or .sql files
Developers would be really glad to store data files of integration tests using this format and have readable files with clean revision histories
Matrix
Would be helpful in scenarios where we have a lot of objects with the same ordered keys
Developers could use to store configuration like mapping between roles and resources of an application using spreadsheet softwares that support a file format based on it
Spreadsheet softwares could create a new open standard (based on YAML) that could have these advantages:
Could be cleaner, using one matrix for data and another with styles references from a styles pallete
Could have a clean and readable revision history in version control systems like git
Big Spreadsheet files get zipped every time you make a change. When versioning in git (that already have a compression system) you duplicate the size of this file in the revision history every time you change it. It wouldn't happen if we used a text file
Have you ever unzipped a .xlsx or .ods file to see how unreadable their XML files are?
Examples
Some examples of how da data would be written in a file (Presentation Model) vs how it would be read by the application (Representation Model).
Applications could use metadata in other fields of the YAML to store information about max column sizes in characters.
Table example:
---
# Use this (Presentation Model):name: userscontent: !!table || id | name | type | gender |+---------+----------+-------+--------+| 1 / Leonardo | Human | male || | M. Carre | | || | iro / | || 10 | Isadora | Human | female || 2654895 | Princesa | Dog | female || 2654896 | Pitoco | Dog | male |
---
# To get this (Representation Model):name: userscontent:
- id: 1name: Leonardo M. Carreirotype: Humangender: male
- id: 10name: Isadora Diastype: Humangender: female
- id: 2654895name: Princesatype: Doggender: female
- id: 2654896name: Pitocotype: Doggender: male
Matrix example:
# Use this (Presentation Model):name: map-resources-to-rolescontent: !!matrix || || admin | moderator | reader |+-----------++-------+-----------+--------+| list || X | X | X || get || X | X | X || create || X | X | || edit || X | X | || delete || X | | |
---
# To get this (Representation Model):name: map-resources-to-rolescontent:
- list:
- admin: X
- moderator: X
- reader: X
- get:
- admin: X
- moderator: X
- reader: X
- create:
- admin: X
- moderator: X
- reader: ~
- edit:
- admin: X
- moderator: X
- reader: ~
- delete:
- admin: X
- moderator: ~
- reader: ~
IMHO, YAML already has a tag !!seq, with which can be represented tuple. So here only need field names mapping.
---
# Why not to use this (Presentation Model):name: userscontent: !!fmap |* [ id, name , type , gender ]
- [ 1 , Leonardo, Human, male ]
- [ , M. Carre, , ]
- [ , , iro , ]
- [ 10, Isadora , Human , female ]
- [2654895, Princesa, Dog , female ]
- [2654896, Pitoco , Dog , male ]
...
Named set of tuples for matrix :
# Just this (Presentation Model):name: map-resources-to-rolescontent: !!fnmap |* [ admin, moderator, reader ]list : [ x , x , x ]get : [ x , x , x ]create: [ x , x , ]edit : [ x , x , ]delete: [ x , , ]
...
I would like to suggest new types for the Core YAML Schema: Table and Matrix.
Table
.csv
or.sql
filesMatrix
.xlsx
or.ods
file to see how unreadable their XML files are?Examples
Some examples of how da data would be written in a file (Presentation Model) vs how it would be read by the application (Representation Model).
Applications could use metadata in other fields of the YAML to store information about max column sizes in characters.
Table example:
Matrix example:
Matrix example (without keys):
The text was updated successfully, but these errors were encountered: