3 ms·
The complicated part is, that this tree has different types of nodes. Some support properties and child's, some not. So I would call it a chimera tree or mixed
by PurpleRamen 2y ago
The complicated part is, that this tree has different types of nodes. Some support properties and child's, some not. So I would call it a chimera tree or mixed tree, or something like that.
- lucianbr 2y agoFor a query language, you can generalize to all nodes supporting all things. You will be able to write some queries that will never return results, at least in a given input data format. That does not seem so bad.
- hughesjj 2y agoNo it makes so much more sense to introduce nil and then constantly pepper your code with ? (Null-colasecing) Operators everywhere (Looking at you, jq, though to be fair JSON itself supports null...)
- int_19h 2y agoCoincidentally, this is exactly what XPath and XQuery do. E.g. text nodes don't have children nor attributes, yet it is perfectly legal to do text()/foo or text()/@foo - and the result is an empty sequence. If you want this kind of semantics with JSON, take a look at https://www.jsoniq.org https://www.jsoniq.org