Clarification needed on what is a JSON tiddler - technical view

I am working on a range of tools which have at there heart the idea of JSON in tiddlywiki. However I think it is not as strait forward as it seems at first glance.

Differences observed;
First consider JSON tiddlers containing tiddlers see Constructing JSON tiddlers

  1. If we export one or more tiddlers as a JSON file the file contains the tiddlers with each title first.
  2. If you look inside a plugin you will see it is almost the same but all tiddlers are wrapped in;
{
    "tiddlers": {
   <!-- all tiddlers here -->
}
  1. if you import a JSON file and edit the Import Tiddler you will see it follows the same format as 2.

Now consider tiddler containing other data
4. Tiddlers created referencing data tiddlers eg index and listops
5. JSON tiddlers created using the New JSON tools in TW 5.2.3
6. Other JSON layouts for external use eg Example package.json for IIS
7. Tiddlywikis own internal storage of tiddlers and when they are saved through NodeJS

It seems we, at least I, need some shared terminology which helps distinguish between different JSON tiddlers and when and If they contain tiddlers themself or just Arrays or Objects - do we call this Arbitrary JSON data within DataTiddlers

The documentation names the macros used to generate JSON containing tiddlers and you can see the templates used, but it does not quite document the format.

2 Likes

You are right – That’s a tricky question, because JSON (JavaScript Object Notation) as described at: JSON is defined as

JSON (JavaScript Object Notation) is a lightweight data-interchange format.

It’s a “data-interchange” format and it can be used to store every type of info we have in TW.

TW internally tiddlers are stored as JavaScript objects, which look very similar but not exactly the same … Now the text-field of a tiddler can store data-tiddlers, that use the JSON format. …

So it’s possible to create nested structures, that can have different use-cases. … We do have some terminology based on those usecases but they are not formalized.

I have an idea, how to describe it, but I have to think about it, where we can use existing terminology and where to create new terms. It should be understandable an it has to be “true”.

:thinking:

Sorry for the late reply, but it needed some time to prepare something, which I hope is useful and correct

I did respond at: How do TWs JSON Formats Look Like

1 Like