What are the advantages/disadvantages of tags vs fields vs slices?

98 views
Skip to first unread message

Saverio

unread,
Mar 2, 2010, 11:16:03 PM3/2/10
to TiddlyWiki
From reading a number of posts over the last few weeks, I have learned
that there are multiple ways to embed structured information within a
tiddler. These include tags, custom (or extended) fields, data
fields, slices, and form fields. Have I missed any? When is it
better to use one over another?

For example, I am constructing my own simple TW task manager. I
started with tiddlers that are tasks, tagged with "action". Other
tiddlers are projects, which are sets of related and sometimes ordered
tasks, tagged with "project". A task tiddler can also be tagged with
the name of a project to which it belongs, and/or also with the names
of any other tasks on which it depends.

The problem is that for a given task, there could be multiple tags,
one of which is the project to which it belongs, and the others are
other tasks on which it depends. To distinguish whether a given tag
of a task tiddler refers to a project or another task requires looking
up that tag's parent tiddler to determine whether it itself is tagged
with either "task" or "project".

I am wondering whether there is a simpler way, or whether it would
just be more efficient to use custom fields, such as
"belongsToProject", and "dependsOnTasks". Another option is to record
this information in slices.

This question generalizes to how best to annotate tiddlers with
semantic tags which encode relationships, such as "isParentOf",
"isChildOf", "hasIngredient", "isMemberOf", etc., etc., etc. I like
the simplicity and transparency of using just plain vanilla tags, but
I think they are not powerful enough.

I am interested in others' opinions and experiences.

Måns

unread,
Mar 3, 2010, 4:51:56 AM3/3/10
to TiddlyWiki
Hi Saverio

> From reading a number of posts over the last few weeks, I have learned
> that there are multiple ways to embed structured information within a
> tiddler.  These include tags, custom (or extended) fields, data
> fields, slices, and form fields.  Have I missed any?  When is it
> better to use one over another?
Fields:(extended):
In my experience extended fields are quick and the options are
endless, when you use them from a custom EditTemplate
If you want to enter fields from the ViewTemplate, you'll need Erics
EditFieldPlugin http://www.tiddlytools.com/#EditFieldPlugin - and
you'll have to accept to save each and every input you make - or you
could install FieldsEditorPlugin http://visualtw.ouvaton.org/VisualTW.html
too speed up a little...
Data fields(text):
If you intend to work with input of data from the ViewTemplate via a
HTMLtemplate or similar - then data fields are very good. When you hit
the edit button, you are able to delete or edit all data (text) at
once (isn't possible with fields). Please correct me if I'm wrong -
but I believe that the amount of text used to write datafields is
making TWs xx-times larger than TW's using fields, because of the
addidtion of <data> xxx::value>/data> everytime you add data...
Slices (text):
Slices and DataFields have the limitation of only beeing able to be
oneliners.....whereas extended fields can have several, which is
sometimes very usefull.

My personal conclusion:
Tags are quick, easy and usable for most things when you just need a
quick way to make structure data - and you'll have the advantage of
using a tiddlers full capacity (wysiwyg, quick edit etc etc etc) as
the containers for whatever the information is...
Custom fields aren't just as accesible, but offer the advantage of
being able to hold several lines of text...
Data fields are accessible from the ViewMode - oneliners, fills your
TW with a lot of (unneccesary?) text ...
Slices are oneliners - but very accessible if you use a plugin as
Eric's (TiddlyTools) GridPlugin http://www.tiddlytools.com/#GridPlugin,
you are able to edit them inline!!

I know there are a lot of different opinions regarding what is the
best way of structuring data in a TW, and I believe there are
better(more elegant) ways to explain pro and cons - however I find
that I use all of them in most of my TWs solving different purposes.
If I have a nice EditTemplate, which uses custom fields - then I use
fields. Has someone made a nice taggersolutionm, I will grab that and
try to use it as much as I possibly can... etc ...

I hope my 2 cents can help you decide what is best for your case...

regards Måns Mårtensson

Mark S.

unread,
Mar 3, 2010, 8:15:53 AM3/3/10
to TiddlyWiki
Tags are useful to show relationships (parent-child) between tiddlers,
and attributes that could apply to entire groups of tiddlers, but they
really shouldn't IMHO be used to hold chunks of information or tiddler-
specific information. So you might tag a tiddler with something to
indicate that it holds a type of information (e.g. "Biblio") you
shouldn't use it to hold that information (e.g. "Mark Twain") And
although you can add tags with spaces, it doesn't seem like a natural
fit.

Fields are obscure in the current TW set up, so I've tended to avoid
them.

I'm guessing that the <data> plugin was introduced before sections &
slices were added to the TW world. I would fault the lack of TW
documentation for not introducing any of these features to the new
user.

Slices and sections are a convenient, natural way to enter tiddler-
specific data. You don't need to modify your tiddler template (though
you can) or get extra plugins for manipulating them (though you can).
Slices are single lines of information. Sections can be whole
paragraphs or documents. They can be accessed using the <<tiddler>>
transclusion if you get Eric Shulman's WikifyPlugin. (I've added a
patch to the plugin I use to access sections as well) Sections and
fields can be hidden by /%...%/ if you don't want information
cluttering up the tiddler display.

Mark

Saverio

unread,
Mar 3, 2010, 8:52:19 AM3/3/10
to TiddlyWiki
On Mar 3, 8:15 am, "Mark S." <throa...@yahoo.com> wrote:
> Slices and sections are a convenient, natural way to enter tiddler-
> specific data. You don't need to modify your tiddler template (though
> you can) or get extra plugins for manipulating them (though you can).
> Slices are single lines of information. Sections can be whole
> paragraphs or documents. They can be accessed using the <<tiddler>>
> transclusion if you get Eric Shulman's WikifyPlugin. (I've added a
> patch to the plugin I use to access sections as well) Sections and
> fields can be hidden by /%...%/ if you don't want information
> cluttering up the tiddler display.

The idea of keeping the project a task belongs to and its dependencies
on other tasks in two different slices. But how then can one modify
the values of the slices in a *controlled* way, ie. a dropdown of
available projects with an option to create a new project, or a
dropdown of other tasks, without just editing the tiddler and free
texting everything?

Saverio

unread,
Mar 3, 2010, 9:40:42 AM3/3/10
to TiddlyWiki
On Mar 3, 8:15 am, "Mark S." <throa...@yahoo.com> wrote:
> Tags are useful to show relationships (parent-child) between tiddlers,

I think tags are ideal for "attributes" of tiddlers. To use them for
relationships, other than the simplest and most generic of
relationships, is stretching their functionality, unless you
supplement with your own code to disambiguate the type of
relationship. I think what is missing from TW is semantic tagging. Are
there any plans for a "semantic TiddlyWiki", just as Semantic
Mediawiki (http://semantic-mediawiki.org) extended vanilla Mediawiki?

Måns

unread,
Mar 3, 2010, 9:54:57 AM3/3/10
to TiddlyWiki
> But how then can one modify
> the values of the slices in a *controlled* way, ie. a dropdown of
> available projects with an option to create a new project, or a
> dropdown of other tasks, without just editing the tiddler and free
> texting everything?

As I mentioned - Eric's GridPlugin is very good - Chrck it out..

Regards Måns Mårtensson

Mark S.

unread,
Mar 3, 2010, 10:36:56 AM3/3/10
to TiddlyWiki
Relationships *are* a type of attribute. Various projects (TW Notes,
Treeview) already use them to construct parent-child trees of
information. Technically speaking, whether you use fields, tags, or
slices probably makes little difference to performance. No part of
TiddlyWiki creates a real indexed database structure. So its all
string manipulation, no matter how you get at it. So mostly what
matters is how easy it is to think about your usage of the data, and
the existing tools to get at and manipulate that data. In the case of
tags, there is already good user (tag field), internal (api), and
external (plugin) supporting code, making it a natural for this kind
of application.

Mark

Saverio

unread,
Mar 3, 2010, 11:11:19 AM3/3/10
to TiddlyWiki

Thank you. If I am interpreting correctly, GridPlugin is a good way to
display and *free-text* edit slices of *multiple* tiddlers at a time.
I would like to display and *dropdown* edit slices of a *single* (ex.
the current) tiddler. I think I will have to create a unique
EditTemplate for taska that utilizes ListBoxPlugin.

Saverio

unread,
Mar 3, 2010, 11:37:30 AM3/3/10
to TiddlyWiki
On Mar 3, 10:36 am, "Mark S." <throa...@yahoo.com> wrote:
> Relationships *are* a type of attribute.

Very interesting! I see it from the other end - attributes are one
type of relationship, which I define as triads of ["source",
"relationship type", "target"] - ex. ["George H Bush" "isTheFatherOf",
"George W Bush"]. Tags are really dyads, or at least triads where the
relationship type is fixed and implied, "hasAttribute". To bring it
back to my original problem of task management, if I have a tiddler
"A" with tags "task", "B", and "C", the only way to infer that "A"
belongs to project "B" and depends on task "C" and not vice versa is
to note that "B" is tagged with "project" and "C" is tagged with
"task". You are right,

> So its all string manipulation, no matter how you get at it.

or at least tiddler manipulation. But what if I could enhance tags to
explicitly define the relationship type. Then I could have tiddler
"A" tagged with "isA(task)", "belongsTo(B)", "dependsOn(C)". These,
in essence, are extended fields, but extended fields are more hidden
and obscured than tags. I hope that a future version of TW combines
the best of both tags and extended fields to make it a truly semantic
product.

FrD

unread,
Mar 3, 2010, 2:05:38 PM3/3/10
to TiddlyWiki
Hello,

Just an information that might be useful sometimes :
It seems that when you put your data in extended fields, a search on
this data (using the search macro) returns no tiddler.
So if you want to be able to retrieve some tiddlers by a search, you'd
better put your data in slices, sections ou use the DataTiddlerPlugin.

FrD

Eric Shulman

unread,
Mar 3, 2010, 3:08:31 PM3/3/10
to TiddlyWiki
> Just an information that might be useful sometimes :
> It seems that when you put your data in extended fields, a search on
> this data (using the search macro) returns no tiddler.
> So if you want to be able to retrieve some tiddlers by a search, you'd
> better put your data in slices, sections ou use the DataTiddlerPlugin.

The basic, built-in search only looks at tiddler titles, text, and
tags. As you noted, it does not search custom fields. However, there
are several 'search enhancement' plugins that add extra search
features, including the ability to search in custom fields. Here's
one that I wrote:
http://www.TiddlyTools.com/#SearchOptionsPlugin

and here's another, written by Udo Borkowski:
http://tiddlywiki.abego-software.de/#YourSearchPlugin

enjoy,
-e
Eric Shulman
Tiddlytools / ELS Design Studios

AlanBCohen

unread,
Mar 5, 2010, 10:07:31 AM3/5/10
to TiddlyWiki
what do you mean by 'sections'? Is this the same as 'part' from
PartTiddlerPlugin or a different construct? How do you name and
delimit a section if it isn't the same as a 'part'? What is the syntax
to reference them via <<tiddler>>?
Alan

Mike

unread,
Mar 5, 2010, 1:36:21 PM3/5/10
to TiddlyWiki
Alan,
for the most part, part tiddler has been replaced by the core use of
sections and slices

in a tiddler myStuff
slice::myslice
!!section
my
data
section
!!end
reference via <<tiddler myStuf##section>>
or <<tiddler myStuff::slice>>

hope that helps,

Mike (from my phone)

Reply all
Reply to author
Forward
0 new messages