On Saturday, January 10, 2015 at 4:38:47 PM UTC, Jeremy Ruston wrote:
>
> On Sat, Jan 10, 2015 at 4:16 PM, Astrid Elocson <[email protected] 
> <javascript:>> wrote:
>
>> Incidentally, why does "_canonical_uri" start with an underscore when 
>> none of the other core field names do?
>>
>
> The name "_canonical_uri" was established by TiddlyWeb, and adopted by TW5 
> for compatibility. I agree that it's unfortunate that it belongs to a 
> different naming style than we usually use.
>

Just for historical reference the name chosen was up for discussion for a 
long time (on tiddlyspace, in the tiddlyweb google group, on github, etc). 
There's various links from here: http://cdent.tiddlyspace.com/20121221

Here's a canonical_uri tiddler as JSON, for 
reference: https://tank.peermore.com/bags/cdent/tiddlers/purplechurch2.png.json

The reason for not using 'uri' is because that was already being used for 
the uri of the tiddler itself. The reason for the leading _ is because in 
TiddlyWeb there are core attributes on the tiddlers (bag, type, text etc) 
and then there is another attribute called fields which contains a custom 
dictionary of additional fields on the tiddlers. Canonical uri was  made a 
field (rather than core attribute) because it is optional (that is, not 
critical to TiddlyWeb's definition of a tiddler) and the leading '_' was 
used to indicate that it was system-oriented rather than user-oriented (a 
 convention borrowed from private variable indications in Python).

The existence of _canonical_uri was expressly for the purpose of allowing a 
single tiddler to act as what amounts to a proxy for a resource that exists 
elsewhere on the web. Thus, in the context of tiddlers you could refer to 
that other resource by its TiddlerTitle while still using it from its 
original place. A side effect was that you could keep tags and other 
metadata about the remote resource in the tiddler that points to the remote 
thing.

The feature is used quite a bit in Tank for handling images and other 
content that can be dragged and dropped into a wiki. The actual binary 
content is saved in S3 and a _canonical_uri tiddler created to point to it. 
I mostly did it to save on disk space, but it also means that bags that 
appear to contain binary tiddlers are not slowed down by the binary 
tiddlers.

If the name is unsightly within TW5, why not change it, and just do a 
translation in tiddlywebadaptor.js? It already has to do that to deal with 
TW5's non-nested handling of attributes+fields.

I hope that bit of info is of some use for people who might be curious.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to