Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft KDL data model #225

Open
zkat opened this issue Oct 6, 2021 · 2 comments
Open

Draft KDL data model #225

zkat opened this issue Oct 6, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@zkat
Copy link
Member

zkat commented Oct 6, 2021

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:

  • Is an empty string tag different to no tag ( does ("")value differ from value)?
  • Is an empty list of child nodes different from no child nodes (does node {} differ from node)?

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):

  • a document is a list of nodes
  • a node consist of
    • a tag being a name
    • a name
    • a list of arguments, each being a value
    • a set of properties, each consisting of a name and value, and each name being unique
    • a list of children being a document

Originally posted by @nichtich in #183

@zkat
Copy link
Member Author

zkat commented Oct 6, 2021

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

@zkat zkat added enhancement New feature or request help wanted Extra attention is needed labels Oct 6, 2021
@tabatkins tabatkins changed the title 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: Draft KDL data model Oct 6, 2021
@nichtich
Copy link

nichtich commented Oct 7, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants