Note: because “Relationship” could easily have two very distinct meanings in the discussion, I am going to use “Marriage” as the term for any committed long-term romantic/sexual pairing, regardless of whether there are wedding vows involved. This frees “Relationship” to represent the various structured interconnectivities between tiddlers or other entities.
My personal preference for this is to use additional tiddlers. A single JSON tiddler might possibly work, but I think such relationship tiddlers often are worthy of inspection on their own. Often I will have ViewTemplates for them.
So perhaps I might have some Hollywood listing that included marriages between celebrities, (including Elizabeth Taylor) with Person tiddlers such as these:
+------------------------+ +------------------------+ +------------------------+
| title: id/12345 | | title: id/45678 | | title: id/67890 |
| tags: Person | | tags: Person | | tags: Person |
| name: Richard Burton | | name: Conrad Hilton | | name: Mike Todd |
| ... | | ... | | ... |
+------------------------+ +------------------------+ +------------------------+
+------------------------+ +------------------------+ +------------------------+
| title: id/23456 | | title: id/56789 | | title: id/78901 |
| tags: Person | | tags: Person | | tags: Person |
| name: Eddie Fischer | | name: Elizabeth Taylor | | name: John Warner |
| ... | | ... | | ... |
+------------------------+ +------------------------+ +------------------------+
+------------------------+ +------------------------+ +------------------------+
| title: id/34567 | | title: id/67890 | | title: id/89012 |
| tags: Person | | tags: Person | | tags: Person |
| name: Larry Fortensky | | name: Mike Todd | | name: Michael Wilding |
| ... | | ... | | ... |
+------------------------+ +------------------------+ +------------------------+
and Marriage tiddlers such as these:
+---------------------------+ +---------------------------+
| title: id/3210 | | title: id/7654 |
| tags: Marriage | | tags: Marriage |
| people: id/56789 id/45678 | | people: id/56789 id/12345 |
| married: 1950 | | married: 1964 |
| divorced: 1951 | | divorced: 1974 |
| ... | | ... |
+---------------------------+ +---------------------------+
+---------------------------+ +---------------------------+
| title: id/4321 | | title: id/8765 |
| tags: Marriage | | tags: Marriage |
| people: id/56789 id/89012 | | people: id/56789 id/12345 |
| married: 1952 | | married: 1975 |
| divorced: 1957 | | divorced: 1976 |
| ... | | ... |
+---------------------------+ +---------------------------+
+---------------------------+ +---------------------------+
| title: id/5432 | | title: id/9876 |
| tags: Marriage | | tags: Marriage |
| people: id/56789 id/67890 | | people: id/56789 id/78901 |
| married: 1957 | | married: 1976 |
| ended-in-death: 1958 | | divorced: 1982 |
| ... | | ... |
+---------------------------+ +---------------------------+
+---------------------------+ +---------------------------+
| title: id/6543 | | title: id/0987 |
| tags: Marriage | | tags: Marriage |
| people: id/56789 id/23456 | | people: id/56789 id/34567 |
| married: 1959 | | married: 1991 |
| divorced: 1964 | | divorced: 1996 |
| ... | | ... |
+---------------------------+ +---------------------------+
I think this technique addresses this point:
It takes this on directly, since people’s names are not the titles for our tiddlers. Instead we use some sort of opaque id, perhaps a sequence number, and perhaps a GUID, and perhaps even the value of some external id . I often choose instead of a single namespace as shown here, to have a namespace for each identity, for instance, Person/1, Person/2, … and Marriage/1, Marriage/2, … Either way is fine; the single-namespace avoids some duplication, but is less clear at a glance.
It also addresses this point
Tiddlywiki has a rich querying language for tiddlers. It does not have one for objects stored as JSON strings. JavaScript does. If we were doing things in JS, then such a store might be useful. In wikiscript it just makes sense to use tiddlers.