Tiddler as Field Value of Another Tiddler

261 views
Skip to first unread message

TJ Walker

unread,
Jun 24, 2018, 4:38:54 PM6/24/18
to tiddl...@googlegroups.com
TiddlerFields are name:value pairs that make up a tiddler

So, tiddlers're more or less dictionaries/associative arrays/maps as db records, right? Within many contexts that offer such constructs, I've found that one dictionary can be set as the value of a key/attribute/field on another dictionary. I was hoping to be able to do this in TiddlyWiki; though, in poring over the docs, I wasn't able to determine how to set one tiddler or a Title List of tiddlers as the value of a custom field on another tiddler. Is this possible?

...

...

...

Mark S.

unread,
Jun 24, 2018, 5:54:13 PM6/24/18
to TiddlyWiki
You can easily add a field to a tiddler that references another tiddler. Or add a field that has a list of tiddlers. But there's nothing to enforce those relationships like in full-blown relational database.

Generally you could use these relations via some mix of (possibly nested) list widgets, filters, and other widgets to create the kind of "reports" you want.

It's better to talk in terms of what your objectives are.

Good luck!
-- Mark

TonyM

unread,
Jun 24, 2018, 8:49:55 PM6/24/18
to TiddlyWiki
T J,

In your question you use an alternative jargon to describe tiddlywiki, then say "I've found that one dictionary can be set as the value of a key/attribute/field on another dictionary." Could you please spell this out a but more, and as mark suggests explain your objectives better.

As a platform I do not believe there is any database model that can not be represented in tiddlywiki, although some such as one that demands"referential integrity" as Mark mentions would be a little convoluted.

Could you explain this further?, but first let me try and answer the question.

Any Field can be use to store lists of tiddlers, just as the tags field already is doing, and there is a convention that uses the list field of a given tiddler  to list the tiddlers tagged with that tiddler, allowing drag-able reordering, and the listops operators etc.. are there to manipulate such lists.

"Set[ing] one tiddler or a Title List of tiddlers as the value of a custom field on another tiddler." Is possible using the above mechanism, and set-field messages, list ops widget and more.

However I believe if we could see your objectives we may even be able to give more detailed or alternative options.

Regrads
Tony

TJ Walker

unread,
Jun 25, 2018, 4:40:12 PM6/25/18
to TiddlyWiki
On Sunday, June 24, 2018 at 6:49:55 PM UTC-6, TonyM wrote:
T J,

In your question you use an alternative jargon to describe tiddlywiki,
 
With the so-called "jargon", I was merely hoping to double check some of my understanding of TW by confirming perceived analogs between its vernacular and terms I happen to be familiar with and find more meaningful or less jargon-y.

then say "I've found that one dictionary can be set as the value of a key/attribute/field on another dictionary." Could you please spell this out a but more,

Sure. Take, for example, JS:
const wiki = {} // associative array as DB
                   —given this structure is a collection of organized data— and DBMS
                   —given mechanisms are offered for managing and retrieving its data

wiki['Tiddler A Title'] = {text:'blah', ...other standard fields..., customField1:'meh'} // associative array as record, a tiddler
wiki['Tiddler B Title'] = {text:'stuff', ...} // another tiddler
wiki['Tiddler C Title'] = {
...standard fields...,
customFieldMyRefList: [
wiki['Tiddler A Title'],
wiki['Tiddler B Title']
] // an array of refs to records as the value of a custom field on a record
}
 
and as mark suggests explain your objectives better.

The abstract nature of my inquiry accurately reflects the abstract nature of my objective: to understand the structures and mechanisms of TW generally/abstractly, to learn what types of things are (im)possible with it —not to, at this point, realize any particular use or application of it.
 
As a platform I do not believe there is any database model that can not be represented in tiddlywiki, although some such as one that demands"referential integrity" as Mark mentions would be a little convoluted.

So, if the value of a tiddler's title field changes, all ref mechanisms break?
 
Could you explain this further?,

I'll revisit if I devise a more concrete use case that I need help with.

but first let me try and answer the question.

Thanks.

 
Any Field can be use to store lists of tiddlers, just as the tags field already is doing, and there is a convention that uses the list field of a given tiddler  to list the tiddlers tagged with that tiddler, allowing drag-able reordering, and the listops operators etc.. are there to manipulate such lists.

"Set[ing] one tiddler or a Title List of tiddlers as the value of a custom field on another tiddler." Is possible using the above mechanism, and set-field messages, list ops widget and more.

Some of the mentioned mechanisms (messages, listops, widgets, et cetera) have helped me find the relevant docs entries that I'd previously been unable to find. Thanks.

However I believe if we could see your objectives we may even be able to give more detailed or alternative options.

Regrads
Tony


On Monday, June 25, 2018 at 6:38:54 AM UTC+10, TJ Walker wrote:
TiddlerFields are name:value pairs that make up a tiddler

So, tiddlers're more or less dictionaries/associative arrays/maps as db records, right? Within many contexts that offer such constructs, I've found that one dictionary can be set as the value of a key/attribute/field on another dictionary. I was hoping to be able to do this in TiddlyWiki; though, in poring over the docs, I wasn't able to determine how to set one tiddler or a Title List of tiddlers as the value of a custom field on another tiddler. Is this possible?

...

...

...

...

Mark S.

unread,
Jun 25, 2018, 5:56:46 PM6/25/18
to TiddlyWiki


On Monday, June 25, 2018 at 1:40:12 PM UTC-7, TJ Walker wrote:

So, if the value of a tiddler's title field changes, all ref mechanisms break?
 

Mostly. All the links to the tiddler will continue pointing at the old location. The exception is when you change the name of a tiddler TW will offer to make corresponding changes within the tags and lists fields of other tiddlers. The upshot is that you're probably better off forming relationships between tiddlers via tags and lists (the actual list field) then by standard links because the latter do not auto-update.

-- Mark


...

...

...

...

TJ Walker

unread,
Jun 25, 2018, 6:31:42 PM6/25/18
to TiddlyWiki
I see. Is there a reason behind this limitation; was it an intentional design decision? Why aren't refs a function of IDs that are permanent (in terms of the life of tiddler) allowing titles to change?

...

...

...

...

...

Diego Mesa

unread,
Jun 25, 2018, 6:58:42 PM6/25/18
to TiddlyWiki
This exact point has been the subject of much discussion/debate! 

@TiddlyTweeter

unread,
Jun 25, 2018, 7:17:56 PM6/25/18
to TiddlyWiki
TJ Walker wrote:

I see. Is there a reason behind this limitation; was it an intentional design decision? Why aren't refs a function of IDs that are permanent (in terms of the life of tiddler) allowing titles to change?

No idea if this was intended. But its simply the case that the title of a tiddler IS its ID. Change it and you change the ID. That is why you can't have two tiddlers with the same title. This can create issues on import if you are not wary.

TonyM

unread,
Jun 25, 2018, 8:42:34 PM6/25/18
to TiddlyWiki
TJ,

There are solutions that support the renaming of tiddlers and I myself will publish a unique id alias soon. Many cases can be handled with the uni-link plugin. I think however this need for re-nameable tiddlers is something a lot of new comers ask for but the more experienced people do not see as very important because this is not normally an issue with a few specific exceptions.

I recommend putting this perceived need to the side and see how much it comes up.

Regards
Tony

TonyM

unread,
Jun 25, 2018, 9:22:28 PM6/25/18
to TiddlyWiki
TJ,

Be assured TiddlyWiki is extremely adaptable, rests on top of common internet standards and technology HTML, CSS, Javascript (special application there of)  and more. It is both a front and backend, a friend to coders and non coders alike and much more.

Responses below,

Regards
Tony


On Tuesday, June 26, 2018 at 6:40:12 AM UTC+10, TJ Walker wrote:
On Sunday, June 24, 2018 at 6:49:55 PM UTC-6, TonyM wrote:
T J,

In your question you use an alternative jargon to describe tiddlywiki,
 
With the so-called "jargon", I was merely hoping to double check some of my understanding of TW by confirming perceived analogs between its vernacular and terms I happen to be familiar with and find more meaningful or less jargon-y.

 Understood and support your approach, however I could not understand it, I just wanted a little more familiar language used.
 

then say "I've found that one dictionary can be set as the value of a key/attribute/field on another dictionary." Could you please spell this out a but more,

Sure. Take, for example, JS:
const wiki = {} // associative array as DB
                   —given this structure is a collection of organized data— and DBMS
                   —given mechanisms are offered for managing and retrieving its data

wiki['Tiddler A Title'] = {text:'blah', ...other standard fields..., customField1:'meh'} // associative array as record, a tiddler
wiki['Tiddler B Title'] = {text:'stuff', ...} // another tiddler
wiki['Tiddler C Title'] = {
...standard fields...,
customFieldMyRefList: [
wiki['Tiddler A Title'],
wiki['Tiddler B Title']
] // an array of refs to records as the value of a custom field on a record
}
 
and as mark suggests explain your objectives better.

The abstract nature of my inquiry accurately reflects the abstract nature of my objective: to understand the structures and mechanisms of TW generally/abstractly, to learn what types of things are (im)possible with it —not to, at this point, realize any particular use or application of it.

I love chatting about the abstract, conceptual and nature of tiddlywiki, and I can help you with this. I am no JS expert, others here are, But I think what you are looking for is more than possible in TiddlyWiki, however there are some conceptual differences from a Procedural or Object programming language. I will try and dig up where I did a comprehensive explanation of this difference.
 
 
As a platform I do not believe there is any database model that can not be represented in tiddlywiki, although some such as one that demands"referential integrity" as Mark mentions would be a little convoluted.

So, if the value of a tiddler's title field changes, all ref mechanisms break?

If you build a solution where the tiddler titles can or need to change, but they also represent a unique ID then yes this will break,  but this is in your hands. Not all reference mechanisms break, and less so if you use the uni-links plugin and alias'e. A Few of us have a solution for strict unique ids for some use cases. However using a changeable field (the Title) as a unique or key field is of course not the way to do it, It is easy to use other fields as the key field, not to mention datatiddlers Json formats and custom lists.

 
Could you explain this further?,

I'll revisit if I devise a more concrete use case that I need help with.

Abstract is also good, but only if use use a common higher level terminology, please.
 

but first let me try and answer the question.

Thanks.
 
Any Field can be use to store lists of tiddlers, just as the tags field already is doing, and there is a convention that uses the list field of a given tiddler  to list the tiddlers tagged with that tiddler, allowing drag-able reordering, and the listops operators etc.. are there to manipulate such lists.

"Set[ing] one tiddler or a Title List of tiddlers as the value of a custom field on another tiddler." Is possible using the above mechanism, and set-field messages, list ops widget and more.

Some of the mentioned mechanisms (messages, listops, widgets, et cetera) have helped me find the relevant docs entries that I'd previously been unable to find. Thanks.

Your Welcome, that was the intent. In learning tiddlywiki on TiddlyWiki.com the "Filter Operators" and Widgets are the most likely areas you will find answers, but search for other tiddlywiki resources because items such as tobias'es solutions http://tobibeer.github.io/tb5/#Welcome and filter info http://tobibeer.github.io/tw/filters/#Filter%20Examples are very helpful as are other sites out there.
Reply all
Reply to author
Forward
0 new messages