http://tiddlywiki.abego-software.de/metadata/
that supports MetaData.
Based on discussions with ClintChecketts and JeremyRuston I implemented
some kind of "minimal" interface to cover most of the ideas of "meta
data" that were discussed in this forum. It may serve as the starting
point for the MetaData feature planned for TiddlyWiki 2.1.
Feedback is highly appreciated.
Udo
P.S.: this is not a "supported extension" or so, but just an
"experiment". It will be dropped as soon as the TiddlyWiki supports
MetaData (i.e with the release of 2.1).
P.P.S.: A unified diff of the JavaScript changes can be found here:
http://tiddlywiki.abego-software.de/patch/metadata1.diff.txt
Find an experimental adaption of the TiddlyWiki 2.0.8 at
http://tiddlywiki.abego-software.de/metadata/
that supports MetaData.
I'd definitely like to see nesting, or we'll have terrible namespace clashes;
<div tiddler="JoeBrown" modifier="UdoBorkowski" modified="200604172252" created="200604172244" tags="">the tiddler text
<div class="data">
<p class="address">
<p name="street">Washington St</p>
<p name="zip">12345</p>
</div>
<p name="phone">555-1234</p>
</div>
</div>but I also reckon it'd be cool to just start treating a tiddler as "just" a data object, and put literally everything into metadata -- modified dates, titles, tags, content.
and you could have smart tiddler objects:
tiddler.getValue("core.tags") returns the tags string, and
tiddler.getValue("core.tagslist") returns an array of individual tags
... so you would need to be able to maintain a list of datapoints that you don't save. You could even have a rule like "nothing under "cache.*" gets saved to store"
Very nice concepts Udo and Daniel.
I really like this idea. It is simple but very powerful and keeps
things nice and standard. I think that the nested data should be kept
as xhtml to make it future compatible with XML processing.
For me, backwards compatibility with existing plugins would not be an
issue. I think that we need to accept some disruption over time as TW
is still finding its way forwards and is a very "young" idea. And in
this case, it looks like the idea is so powerful and useful that it
would be worth the disruption.
--
Jules
www.knightnet.org.uk
http://knighjm.googlepages.com/knightnet-default-tw.html
I'd definitely like to see nesting, or we'll have terrible namespace clashes;
Me too. That's what I mean when I am talking about "nested" MetaData (like an address object that contains "street", "city" etc. sub-fields) in the "Possible Extensions" section [...]
but I also reckon it'd be cool to just start treating a tiddler as "just" a data object, and put literally everything into metadata -- modified dates, titles, tags, content.Absolutely yes. If foreward compatibility is not an issue (i.e. old TiddlyWiki core code must be able to work on the new format) the implementation is very straight forward: just move all attributes into subelements of the data DIV.
This would also make the store XHTML compliant, I think.
and you could have smart tiddler objects:
tiddler.getValue("core.tags") returns the tags string, and
tiddler.getValue("core.tagslist") returns an array of individual tags
... so you would need to be able to maintain a list of datapoints that you don't save. You could even have a rule like "nothing under "cache.*" gets saved to store"
These are interesting ideas. I tried to come up with an "as small as possible" solution for the MetaData [..snip..] For me nested meta data (/namespaces) is definitely a core feature, for smart tiddlers I am not sure, but the "cache" feature should also be in the core.
There's a couple of points to pull out of the discussion:
First backwards compatibility: if we're going to pursue XHTML
compliance for 2.1.0 then I think that pretty likely means that we'll
have broken backwards compatiblity (meaning that a plugin written
pre-2.1.0 won't be able to understand the format of a post-2.1.0
tiddlywiki file). So, I'd be happy to see the suggested integration of
old-style and new style metadata. I agree that it's going to require
some way of handling different data types.
Secondly, nesting. I don't think that any code is actually needed to
do this; can't we just adopt a convention to use 'dot' as a separator
in metadata field names? I don't see much advantage in nesting the
underlying DIV storage.
Thirdly, the cache idea. I can see where this idea is coming from, but
I wonder whether it isn't introducing unnecessary complexity. Surely,
if a plugin wants to cache some information related to the tiddler
"HelloThere", a reasonable way to do it is for the plugin itself to
own a cache object that's private:
myCache["HelloThere"].["my field name"] = "blah blah blah";
Fourthly, there's another a related feature to consider. As I've
mentioned in previous threads, I favour the idea of what I'm calling
EmbeddedFields for tiddlers that contain structured data. There was
some discussion towards the end of this thread (see my post at Apr 12
2006 3:33 pm):
Now, I know that about 99% of the people reading this are going to go
"ugh?" surely that's solving exactly the same as the custom metadata
we're discussing here... I'm not so sure; I think it's analogous to
the difference between file metadata (like it's created date) and the
file content. Anyway, I'd welcome any thoughts on this.
Cheers
Jeremy
--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com
So, I'd be happy to see the suggested integration of old-style and new style metadata. I agree that it's going to require some way of handling different data types.
<div tiddler="JoeBrown" modifier="UdoBorkowski" modified="200604172252" created="200604172244" tags="">the tiddler text
<div class="data">
<p name="street">Washington St</p>
<p name="zip">12345</p>
<p name="phone">555-1234</p>
</div>
</div>
we could write
<div name="JoeBrown">the tiddler text
<div class="data">
<p name="modifier">UdoBorkowski</p>
<p name="modified">200604172252</p>
<p name="created">200604172244</p>
<p name="tags"></p>
<p name="street">Washington St</p>
<p name="zip">12345</p>
<p name="phone">555-1234</p>
</div>
</div>
(added whitespaces for clarity)Secondly, nesting. I don't think that any code is actually needed to do this; can't we just adopt a convention to use 'dot' as a separator in metadata field names? I don't see much advantage in nesting the underlying DIV storage.
Thirdly, the cache idea. I can see where this idea is coming from, but I wonder whether it isn't introducing unnecessary complexity.
Fourthly, there's another a related feature to consider. As I've mentioned in previous threads, I favour the idea of what I'm calling EmbeddedFields for tiddlers that contain structured data.
I'm really no expert in XML styling, but might it be more useful to
put the tiddler text in it's own sub-DIV? That way it could be more
simply independently addressed with an XPATH-type query, wouldn't it?
Actually, picking up another common request, it could even be a <PRE>
so that we can finally handle whitespace properly?
> When reading the DIV we first look for the legacy metadata (modifier,
> created,...) in the data DIV (and the "name" attribute). Only if this is not
> found the old attributes are checked and used. This way we can read the old
> format, and save with the new format.
Makes sense, but how would the code know that, say, "modified" and
"created" are dates and not strings? The current approach of having
special knowledge baked into the core seems a tad primitive.
> Eg. assume we define that all fields starting with "temp." are temporary
> fields that are not stored this just requires an extra test against the
> regular expression /^temp\./ for the field names before their values are
> stored.
OK, I'm happy with that. and "temp." seems like a good prefix.
> Since both features are independent I would prefer to first get the
> metadata stuff into TiddlyWiki. In a second step embedded fields may be
> added.
I'm actually advocating doing embedded fields for 2.1.0 as well. The
motivation is to support more robust handling of plugins as part of
the new ImportTiddlers code.
Cheers
Jeremy.
Secondly, nesting. I don't think that any code is actually needed to
do this; can't we just adopt a convention to use 'dot' as a separator
in metadata field names? I don't see much advantage in nesting the
underlying DIV storage.You " 'dot' as a separator " convention approach will definitely work.
Not at all, these are sound observations.The behaviour you describe is
indeed desirable. You could imagine something similar being done with
wildcards (tiddler.removeValue("AddressBook.*").
Your comments made me think also that it might be useful to
incorporate a means of enumerating through all the items of metadata
attachments on a particular tiddler.
Cheers
Jeremy
I'm really no expert in XML styling, but might it be more useful to put the tiddler text in it's own sub-DIV? That way it could be more simply independently addressed with an XPATH-type query, wouldn't it?
Actually, picking up another common request, it could even be a <PRE> so that we can finally handle whitespace properly?
Makes sense, but how would the code know that, say, "modified" and "created" are dates and not strings? The current approach of having special knowledge baked into the core seems a tad primitive.
<p name="modifier" class="String">UdoBorkowski</p> <p name="modified" class="Date">200604172252</p> <p name="created" class="Date">200604172244</p> <p name="tags" class="StringList"></p>If you look into the code you will see that I currently only check for "String". Since I assume "String" is the most frequently used type I made this default, i.e. it does not need to appear in the store (i.e. a missing "class" indicates a String field).
I'm actually advocating doing embedded fields for 2.1.0 as well. The motivation is to support more robust handling of plugins as part of the new ImportTiddlers code.
> Just some thoughts, as I said before I'm new at this, so if I'm completely
> wrong here, just pretend you never read this. :)
Not at all, these are sound observations.The behaviour you describe is
indeed desirable.
You could imagine something similar being done with
wildcards (tiddler.removeValue("AddressBook.*").
Your comments made me think also that it might be useful to
incorporate a means of enumerating through all the items of metadata
attachments on a particular tiddler.
Your comments made me think also that it might be useful to incorporate a means of enumerating through all the items of metadata attachments on a particular tiddler.
With reference to the <PRE> tag, earlier discussions arrived at the
conclusion that it's only <PRE> that does whitespace preservation and
works across all browsers. I wouldn't use it for the metadata, just
for the text, hence the suggestion of further wrapping the text.
For type indicators, yet another possibility is to use prefixes on the
names like 'txt' and 'dat', as with the option handling....
Cheers
Jeremy
On 18/04/06, Udo Borkowski <Udo.Bo...@gmx.de> wrote:
>
Isn't the PRE issue an IE bug, where IE wrongly compresses whitespace
in the text nodes of non-PRE elements? If that is true, then I don't
think CSS will likely solve the problem.
Luke
Udo Borkowski wrote:
I assume that the "<pre>-like" whitespace handling could
> also be done through a proper CSS definition of the subelements of the
> store. We should ask our CSS guru.
Isn't the PRE issue an IE bug, where IE wrongly compresses whitespace
in the text nodes of non-PRE elements? If that is true, then I don't
think CSS will likely solve the problem.
Luke
This would not allow the plugin to save cached data to the tiddly.html
file.
For Plugin:jsMath I would like to cache rendered math. Right now I have
tiddlers that take upwards of 10 seconds to render. It turns out the
biggest bottleneck in jsMath is putting things into a hidden <span>,
measuring its size using offsetWidth and offsetHeight, and using that
info to set CSS sizes. (This is jsMath.BBoxFor if any CSS guru's want
to take a stab at speeding it up) So, caching an already-rendered
equation would be a big boon. Since the rendered text is a unique
function of the input string "$x$" this would be quite efficient.
People also often repeat $x$ in their discussion of $f(x)$ where $x$ is
an integer... no need to render it twice.
How would you suggest to do the above cache? This particular cache is
independent of the tiddler, since $x$ can appear in multiple tiddlers,
but you only need one cached value. I suppose I could always create a
tiddler jsMathCache and put everything in there. For example (sorry the
jsMath output is rather verbose):
<div class="jsMathCache">
<div name="$x$">
<SPAN class="typeset">
<NOBR>
<SPAN class="scale">
<SPAN style="position: relative; width: 0.687em; height: 1.062em;">
<SPAN style="position: absolute; top: 0em; left: 0em;">
<SPAN class="cmmi10"> x </SPAN>
</SPAN>
<SPAN style="width: 0.687em; height: 1.062em; vertical-align: 1.062em;" class="blank"/>
</SPAN>
<SPAN style="margin-right: -1px;" class="spacer"/>
<SPAN style="width: 1px; height: 0.581em; vertical-align: 0.531em;" class="blank"/>
</SPAN>
</NOBR>
</SPAN>
</div>
<div name="\[\int_a^b x~dx\]">
etc....
</div>
</div>
But going farther, I'd like to cache the entire rendered tiddler as
HTML. Also I see no reason not to save this to the file. With a
last-rendered and last-modified attribute, it would be easy to keep the
two in sync, and you could create a tiddlywiki that only has to do the
heavy lifting of parsing and rendering right after an edit. Your
tiddlywiki file would be much larger -- but for local applications this
wouldn't be a problem. It could be enabled with a simple switch in the
OptionsPanel: "save rendered tiddlers".
--
Cheers,
Bob McElrath [Univ. of California at Davis, Department of Physics]
"It is almost universally felt that when we call a country
democratic we are praising it; consequently, the defenders of every
kind of regime claim that it is a democracy, and fear that they
might have to stop using the word if it were tied down to any one
meaning." -- George Orwell
The discussion here has been about a *volatile* cache that doesn't get
saved to tiddly.html. For your purposes, Udo's extended metadata will
do what you need out of the tin, I think.
Cheers
Jeremy
Sorry for the confusion, I'll look at that.
For a volatile cache though, I think I agree with you, individual plugin
authors can do this willy nilly, I don't think the store or TW core
needs to know about it.
And in the current prototype the name $x$ is not a valid field name.
Is there a need to make $ a valid (meta) data field name? Just let me
know and I will add it.
Udo
I'm sorry I deleted some relevant pieces of this thread. Could you send
a URL for the plugin under discussion?
And it is a plugin, not part of the core?
I'll look at it more closely. Tex math can in general contain lots of
complicated punctuation $\alpha^{+}$ etc. that would probably have to be
escaped, but that can be dealt with.
Thanks,
Does this mean that one wouldn't be able to have tiddlers with Unicode
characters in their titles?
With my new knowledge of the IE whitspace handling: isn't there a
problem if we keep the "field data" in non-PRE tags?
This would mean that client code that set a value "A B" (i.e. A and B
separated by three spaces) would read an "A B" the next time the
TiddlyWiki is loaded in IE. Currently I write the string value as
htmlEncoded, but htmlEncode does not escape spaces, ie IE would merge
subsequent spaces. Or am I missing something?
Udo
Aaah excellent thanks.
> Regarding the identifier syntax I would like to restrict it first to
> have more option for extensions later and to avoid possible problems
> with XML etc. that may have restriction on "their identifiers" (e.g. the
> possible values of the "name" attribute in an HTML element).
>
> Currently the "classic" identifier syntax
> [a-zA-Z_][a-zA-Z_0-9]*
>
> is assumed (and a "." as a separator for namespaces/nested fields).
Why not just escape the 'fieldName' argument all the time? Then you
don't care what kind of line noise names the user tries to store things
with. I would replace the logic in isValidMetaDataFieldName,
isValidMetaDataValue, checkMetaDataFieldName, and
checkMetaDataFieldValue with a pair of escape/unescape functions.
I don't understand where the restrictions on the "name" attribute come
from, but one could also consider a slightly different structure:
<div tiddler...>
blah blah
<div name="data">
<div name="fieldName1">$x$
<div name="value">...</div>
</div>
<div name="fieldName2">$y$
<div name="value">...</div>
</div>
</div>
</div>
e.g. putting the fieldName as XML text rather than an attribute. Then
you can use the same escaping functions as are already present in
javascript and tiddlywiki since only <>& need to be escaped.
Of course, getting things out then requires a loop on all fields...but
actually you're doing that anyway...I would have thought in your current
code you could have used getElementById in some way to avoid the loop.
--
Cheers,
Does this mean that one wouldn't be able to have tiddlers with Unicode characters in their titles?
Ouch. It looks like the name attribute is deprecated in XHTML:
http://www.w3.org/TR/xhtml1/#h-4.10
> Regarding the syntax for the meta data field names I would still like keep
> some restrictions. E.g. the name should not contain chars like "[" "]" (we
> may introduce arrays later) and quotes should also be avoided. In general,
> starting with a restricted syntax gives us more options in the future
> without getting into compatibility issues. Nevertheless adding a "$" seems
> to be OK (this is typically also part of a "classic" identifier).
Quite agree, we should restrict the metadata field names tightly for the moment.
This would not be nearly enough. Tex needs the full ASCII set,
including nasty things like <>&\{}. See my other message on escaping.
--
Cheers,
Why not just escape the 'fieldName' argument all the time? Then you don't care what kind of line noise names the user tries to store things with.
I don't understand where the restrictions on the "name" attribute come from,
What's the motivation here?
I'd like to think of the metadata as a persistent associative array.
One is usually not restricted in the contents of a string used as a key
into e.g. a python dictionary or perl hash.
--
Cheers,
It seems you're trying to simulate a more complex data type with a
simpler one.
Using the idea that I'm going to store a persistant associative array,
one could in principle have (prototype):
metadata["address"]["street"] = "Evergreen Terrace";
or
metadata["3.14159"] = "\pi";
metadata["\pi"] = "3.14159";
metadata["$x$"] = ...xml...
An arbitrarily complex tree structure could be accomplished by nesting
div's, allowing XML to be your tree structure rather than simulating it
with the syntax of the field name (e.g. "address.street"):
<div class="data">
<div name="fieldName1">\pi</div>
<div name="fieldValue1">3.14159</div>
<div name="fieldName2">3.14159</div>
<div name="fieldValue2">\pi</div>
<div name="fieldName3">address</div>
<div name="fieldValue3">
<div name="fieldName1">street</div>
<div name="fieldValue1">Evergreen Terrace</div>
</div
</div>
Values could be retrieved with
getValue(key1, key2, ...)
getValue("address", "street");
or even return arrays, which would allow:
getValue("address")["street"]
That makes XHMTL an even more verbose language than I thought.
But "class" is still a valid attribute in XHTML elements?
Udo
Both of which could handle arbitrary strings as keys (with proper
escaping).
Udo
if we have meta as inner divs (or pre or whatever) how does the newbie copy a plugin into their TW? Previously you could just view the raw text, copy and paste, but that won't work unless we're happy to show our entire tiddler div in the textbox, where Joe Newbie might type over it.
Re the pre tag:I think if we use pre for some data, we should use it for all data, and have consistent whitespace handling. I'm not too concerned about the two extra bytes per field.
Re the name attribute, and also type indicators:the class attribute is a space-separated list, so one option is to put everything in there -- first class is the field name, second is the type:<pre class="core.title txt">MainMenu</pre>
I'm proposing that we don't use the extended metadata mechanism for
the plugin properties, but rather a separate mechanism I'm calling
embedded fields which basically interprets the first table in a
tiddler as a name-value list.
The distinction between the two is that EMD is for data about the
content of a tiddler, while EF is for accessing structured content
within a tiddler.
The EF mechanism is intended to work well with the copy-paste use case.
What is wrong with using ID instead of name? Damn, must actually think
before typing - of course, ID's are supposed to be unique (though I
don't know of any problems at all when they aren't apart I suppose from
making DOM traversal harder).
CLASS? That would work though it may increase name clashes.
Ah, what about TITLE? I think that would be better.
--
Jules
www.knightnet.org.uk
http://knighjm.googlepages.com/knightnet-default-tw.html
Would it be possible for the wikifier to give that table a slightly
different format (by applying an CSS class) so that it is obvious when
it is looked at?
Thanks.
Just to be sure: do you know if it is valid wrt XHTML to put any Unicode
string into the title attribute? In that case I would also use the title
attribute to hold the Tiddler title (sounds somehow logical ;-)
Udo
I feel a copy/paste macro coming on!
>
> *Re fieldNames:*
> It's just the name of the field we're talking about, not it's content.. is
> it that much of a problem to only allow [a-zA-Z_] [a-zA-Z_0-9] * and
> special meaning for [.]? Non-developer users should never see a field name,
> it doesn't need to carry that much meaning.
>
> *Re the name attribute, and also type indicators:*
> the class attribute is a space-separated list, so one option is to put
> everything in there -- first class is the field name, second is the type:
> <pre class="core.title txt">MainMenu</pre>
I think I'd have to agree here. I suspect that the way to cope with the
Math issue is to have TWO attributes per math "attribute" one for the
extended title and one for the data, that would certainly get around
the problem.
>
> An added bonus to this is that the "no javascript" css could target
> core.title as a class name (assuming you can have a dot in a class name?)
> and make it look a bit nicer.
I'm pretty certain that you cannot have a . in a classname.
As I thought, you cannot have a . in either a classname nor an id.
I'm proposing that we don't use the extended metadata mechanism for
the plugin properties, but rather a separate mechanism I'm calling
embedded fields which basically interprets the first table in a
tiddler as a name-value list.
[...]
The EF mechanism is intended to work well with the copy-paste use case.
Yes you can. See:
http://www.opentag.com/xfaq_charrep.htm
Under the question:
"Can element and attribute names use non-ASCII characters?"
Though it looks like you should set the encoding attribute in the xml
declaration. In fact, that site seems to have quite a lot of good stuff
about XML and language encodings.
Of course, TW is HTML 4.01 at the moment and so doesn't have an xml
declaration. For HTML, you can use either the META tag with charset,
e.g.:
<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
or the charset attribute can be used. It is rather easier if the page
is delivered from a server as that can set the encoding in the HTTP
headers.
Not sure how that helps really, I suspect we will have to experiment to
find the right combination.
I'm pretty certain that you cannot have a . in a classname.
As I thought, you cannot have a . in either a classname nor an id.
I think there's a useful analogy with filesystems here. Most file
systems support standard metadata like creation date, modified date
etc. Some file systems (like NTFS and Mac OS X) support extended
metadata so that applications can add extra attributes to files that
don't disturb their contents. For example, OS X's Spotlight uses
extended metadata to control some of it's indexing activities, and XP
SP2 uses extended metadata to track the origin of files downloaded
from the internet.
In that context, the analogy with our extended metadata is clear. I
think that a CSV file is analogous to the proposed embedded fields
mechanism: it's a format for storing structured data in the content of
a file.
Early versions of TiddlyWiki did use the 'id' attribute to hold the
title of a tiddler. I changed it because it turns out that there's
some very nasty subtle rules about the semantics of ids.
First, case sensitivity is weird. Search for "The Special Case of id"
on this page:
http://www.ericmeyeroncss.com/bonus/render-mode.html
You'll also see the comment that it's illegal to create an ID that
starts with a digit.
These rules are subtle, as I say and inevitably are actually
implemented differently in different browsers, hence why I made the
change originally.
I simply tried it out using FF (latest version) and it no work. Didn't
try IE though.
I think I'm missing something here.
Daniel Baird [danie...@gmail.com] wrote:
> Hmm.. oh well. I'm sure there's some kludge-around. At worst, we might
> have to put the field type first, and all subsequent classes can be the
> path. eg instead of
> <pre class="core.tags strList">
> we could have:
> <pre class="strList core tags">
> ..that's not exactly ideal though.
>
> ;D
>
> On 20/04/06, Jules <kni...@googlemail.com> wrote:
> >
> >
> > Daniel,
> >
> > I simply tried it out using FF (latest version) and it no work. Didn't
> > try IE though.
--
> That way we'd at least have a consistent way to get at data from the two
> places. Wotcha think?
I think there's a useful analogy with filesystems here [...] I
think that a CSV file is analogous to the proposed embedded fields
mechanism: it's a format for storing structured data in the content of
a file.
This is a lot of restrictions...what's wrong with using embedded div's
again?
I think I'm missing something here.
Secondly, nesting. I don't think that any code is actually needed to
do this; can't we just adopt a convention to use 'dot' as a separator
in metadata field names? I don't see much advantage in nesting the
underlying DIV storage.
Why would anyone ever type the relevant HTML by hand?
I'm thinking some kind of programmatic interface
saveValue("minesweeper", "highscores", "score01", "name", "Bob");
or
saveValue("minesweeper.highscores.score01.name", "Bob");
where the core doesn't know or care about any hierarchy. See for
example about:config in mozilla -- those values are one big list -- the
hierarchy with '.' is not an actual hierarchy.
Is it cut and paste for plugins that's hard then?
On loading your plugin could set some variables:
metadata = {
author: "Bob McElrath",
version: "1.2.2"
};
The core could then examine the variable 'metadata' to see if the plugin
put something there. This is easy to cut and paste.
Do I understand the intended use correctly?
Do people want other metadata on non-plugin tiddlers? I don't see any
not-hideously-ugly way to cut & paste that, nor any reason to restrict
key/values to [a-zA-Z] or some such. Cut and paste for such tiddlers
seems to scream for a kind of serialization of the content. What kind
of HTML that is is pretty much irrelevant, but I sure don't want to see
it in the editor as HTML, and it should be accessed programatically.
Perhaps a new toolbar button for cutting, pasting, & serialization?
For reference, the metadata that I would save for math would never need
to be copied/pasted.
> The main reason I can think of is that it's annoying to translate
> minesweeper.highscores.score01.name into a DOM node.. but that's not exactly
> a big deal. Maybe if we can't get a separator like dot or whatever, we
> should go to nested <pre>s after all.
Why would anyone ever type the relevant HTML by hand?
On loading your plugin could set some variables:
metadata = {
author: "Bob McElrath",
version: "1.2.2"
};
The core could then examine the variable 'metadata' to see if the plugin
put something there. This is easy to cut and paste.
Do I understand the intended use correctly?
Do people want other metadata on non-plugin tiddlers? I don't see any
not-hideously-ugly way to cut & paste that, nor any reason to restrict
key/values to [a-zA-Z] or some such. Cut and paste for such tiddlers
seems to scream for a kind of serialization of the content. What kind
of HTML that is is pretty much irrelevant, but I sure don't want to see
it in the editor as HTML, and it should be accessed programatically.
Perhaps a new toolbar button for cutting, pasting, & serialization?
Of course, I may be missing the real issue as I'm only just getting a
glimmer of how TW works under the hood.
So a copy/paste function is already needed (which would be easier than
the export/import that is currently the only alternative to three
copies and pastes). That being the case, having the metadata on a
seperate field such as tagbert suggests may well be the most elegent
solution.
That being the case, having the metadata on a
seperate field such as tagbert suggests may well be the most elegent
solution.
Yup, that's a good use case for EMD.
> I guess that's the main thing that's bugging me -- we're talking about a
> great, powerful, structured data model, but it seems to be crippled in
> certain situations.
How so? I guess I thought we were dealing with *two* great, powerful,
structured data models, and the issue is that they're confusingly
similar... :)
Cheers
Jeremy.
I was kind of thinking about an expandable field of some kind tucked
away at the bottom of the edit template.
> However, I'd also assumed that EMD would be useful for stuff like giving a
> tiddler a reminder date, so that tiddler could pop up somehow on that date.
> If I found a tiddler called "Mr T's Birthday" I'd want the reminder to still
> be working after I copy it into my own TW.
Yup, that's a good use case for EMD.
> I guess that's the main thing that's bugging me -- we're talking about a
> great, powerful, structured data model, but it seems to be crippled in
> certain situations.
How so? I guess I thought we were dealing with *two* great, powerful,
structured data models, and the issue is that they're confusingly
similar... :)
Indeed one would have to either use ImportTiddlers or a variant of the
MS LiveClipboard thingy to safely transfer a tiddler complete with
metadata. Just as you would if you wanted to preserve the existing
metadata.
> I really want to have a unified interface for these two data stores. Are
> you planning on making data in the ED table code-writable, just like EMD?
> Without the plugin author fiddling around in the tiddler content themselves,
> I mean. This whole time I've iimagined that the ED was read only, but if it
> wasn't then I think that'd be much happier..
The mechanisms are differently implemented, and serve different
purposes. I'd be concerned that unifying the interfaces would tend to
blur the distinction, and make it more likely that people will choose
to the wrong one for a particular application.
I do also see embedded fields as being readonly from a code perspective.
Having said all of that, I quite like the suggestion parsing the EF
into the EMD store...
I wasn't really thinking it would be hard, or at least only hard in a
subtle sense. The issue is whether it's desirable - I'm arguing that
despite the superficial similarities of them both being name-value
mechanisms, they are nonetheless different and shouldn't be unified.
The subtle aspect is that it might be very constraining to keep the
semantics the same, in terms of, for instance, the character set that
can be used in names. In EF users will be typing the field names
themselves, and it seems much less reasonable to restrict them, as
well as harder to enforce the restriction.
Udo
For my math cache concerns, why don't I *actually* use JSON?
I can create a tiddler jsMathCache that is written by my plugin. The
JSON code is available and small: http://www.json.org/json.js . When my
plugin is loaded it can read jsMathCache and populate it's cached data
structure.
So, plugin authors could persistantly store any data structure they
want this way. Copy/paste is simple because JSON is just text. (but
for jsMath I would never want to copy/paste this)
It isn't necessary for this to be part of the core though. Who else
would use it besides me? I can do this independent of what goes on with
Extended Attributes...
It would be nice to make the jsMathCache tiddler hidden from the user.
Otherwise it will always be on the top of the Timeline...
For that matter if hiden tiddlers are possible, why not make a
metadata.MyTiddler tiddler for each tiddler 'MyTiddler'? JSON could
load the contents of the metadata tiddler and make it available as a
javascript data structure. Likewise the metadata could be serialized on
output.
GetMetaDataForTiddler("Minesweeper").highscores[0].name = "Bob";
Plugins could simply create their own *javascript* data structure with
metadata.
metadata = {
author : "Bob",
needsTag : "systemConfig",
...
}
easy to cut/paste.
I still feel like I'm not understanding this discussion though. ;)
Jeremy Ruston [jeremy...@gmail.com] wrote:
> > I guess that's the main thing that's bugging me -- we're talking about a
> > great, powerful, structured data model, but it seems to be crippled in
> > certain situations.
>
> How so? I guess I thought we were dealing with *two* great, powerful,
> structured data models, and the issue is that they're confusingly
> similar... :)
For my math cache concerns, why don't I *actually* use JSON?
I can create a tiddler jsMathCache that is written by my plugin. The
JSON code is available and small: http://www.json.org/json.js . When my
plugin is loaded it can read jsMathCache and populate it's cached data
structure.
So, plugin authors could persistantly store any data structure they
want this way. Copy/paste is simple because JSON is just text. (but
for jsMath I would never want to copy/paste this)
It would be nice to make the jsMathCache tiddler hidden from the user.
Otherwise it will always be on the top of the Timeline...
For that matter if hiden tiddlers are possible, why not make a
metadata.MyTiddler tiddler for each tiddler 'MyTiddler'? JSON could
load the contents of the metadata tiddler and make it available as a
javascript data structure. Likewise the metadata could be serialized on
output.