It is available. There are JSON operators that make it easy enough to address parts of an object stored as a JSON string, either to get or set properties.
What we don’t have are ergonomic means to query data stored that way.
It’s easy to find all tiddlers with certain properties:
[tag[Book]]
<!-- or -->
[tag[Book]author[Neil Gaiman]]
<!-- or -->
[[tag[Book]] :filter[get[publication_year]compare:number:gte[2000]]
But we don’t have easy equivalents for these. We could write them in JS, like this:
JSON.parse(json_string)?.filter(({tags = []}) => tags.includes('Book'))
<!-- or -->
JSON.parse(json_string)?.filter(({tags = [], author}) => tags.includes('Book') && author=='Neil Gaiman'))
<!-- or -->
JSON.parse(json_string)?.filter(({tags = [], publication_year}) => tags.includes('Book') && publication_year >= 2000)
But we have no simple query mechanism in TW to do such things.
Why? I wasn’t paying attention during the discussions or decision, so my answer is just a guess. Take it with a grain of salt:
One of the mantras of TW is “everything’s a tiddler”. If you need a new configuration parameter, put it in a tiddler. If you want a new procedure/function/macro/widget, put it in a tiddler. If you want a temporary global value, put it in a tiddler. Etc.
This universality is very powerful. One of my favorite programming quotes is Alan Perlis’s, “It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.” The reason is simple: you always know what you’re working with. This show in the way operators tend to transform lists of strings into other lists of strings; it’s a very powerful construct.
JS Objects, serialized from JSON strings, are a competing data structure. The ability to nest them, and the multiple types of values (strings, numbers, booleans, objects, arrays) makes for a more expressive data structure than TW’s main store, which is a Dictionary/HashMap of Dictionaries/HashMaps. There would be a strong case to make for a tool similar to TW, built on such a store.
But that is not how TW is designed; we can’t change that without massive backward compatibility problems. So the only other thing we could do, besides ignoring JSON, is to allow it as a source of data parallel to our main store, either as a single big object or as a number of little ones… We’ve done the latter, and done something similar with Dictionary tiddlers.
This seems a reasonable compromise, but it’s possible that it was a big mistake. (I believe I’ve read somewhere that @jeremyruston views it as one.) The trouble is that we now have to support multiple data types, and if we want sophisticated querying—similar to what we have for tiddlers in our various operators—we will have to write a lot of code to support that. If we want to have equivalent behavior to our tiddler store, we will have to carefully keep any changed synchronized between JSON and plain tiddler manipulation. This is a maintenance nightmare for any team, but particularly bad for the relatively small team of core coders.
And to @Maurycy’s point, to be complete, a robust querying API for plain JS Object stores would have to be huge.