kdl-org / kdl

the kdl document language specifications
https://kdl.dev
Other
1.1k stars 61 forks source link

Draft KDL data model #225

Open zkat opened 2 years ago

zkat commented 2 years ago

KDL specification does not explicitly define a data model but only a syntax that implies some data model of KDL. As long as you parse from KDL syntax into some data structure of a programming language, a KDL data model is not needed. In contrast both KQL and KDL Schema build on a data model. The lack of its explicit definition leaves open handling of some edge cases, such as:

The data model should abstract from syntax details such as comments, how nodes are terminated, whether names are given as bare identifiers or given as strings etc.

Here is a draft of a possible data model (without explicit definition of name and value and both questions above answered with no):

Originally posted by @nichtich in https://github.com/kdl-org/kdl/discussions/183

zkat commented 2 years ago

@nichtich I like the data model so far. Do you want to start a PR so we can start iterating on it?

nichtich commented 2 years ago

The KDL Specification briefly refers to "the [intended] data model" in the introduction. This is another data model, so I would remove these words from the KDL Specification to avoid confusion.

As hopefully made clear in the Application Notes, KDL data model should not be mandatory part of KDL Specification. Implementation will likely restrict at least number representation anyway.