|
- class Mind:
-
A Mind is a collection of Ideas. This is a base class, from which classes
will be derived to support loading minds from XML files, databases, etc.
Methods (this is not exhaustive; e.g. get_* methods generally have matching
set_* methods which are not listed here):
- idea=mind.get(id)
- Returns the Idea with the specified id.
[__getitem__ may also be used.]
- idea=mind.new_idea()
- Returns a newly-created Idea
- idea=mind.default_idea()
- Returns the default Idea
- idea=mind.get_idea_by_title(title)
- Returns an Idea with the
specified title. [If there are several, should it pick one or return
a list?]
- mind.delete(idea)
- Removes an Idea from the Mind
- mind.commit()
- Ensure that changes are written to permanent
storage. [some types of Minds (e.g. those stored in a database) may
have changes committed automatically; this method is necessary for
e.g. Minds stored in a file on the hard drive.]
- data=mind.export(format)
- Dump the contents of the mind to e.g.
XTM format
- class Idea:
-
In the new model, Ideas are more fine-grained than they were before.
Previously, an Idea had a title and could contain any number of Content
objects. Now, each Content object would be a separate (title-less) Idea,
leaving only the title in the original Idea. These Ideas would be connected by
links which would have some attribute distinguishing them from links to
separate Ideas [or would they? is it sufficient to treat untitled Ideas
specially?], causing them to be displayed inline.
Methods:
- string=idea.get_title()
- Returns the title of the Idea or None.
[is there any value to allowing different content-types for titles
(as in topic maps), or should they be restricted to text/plain?]
- (content_type, encoding, string)=idea.get_data()
- Returns
the data contained in an Idea. [if there is a title, should this
return None, (None, None, None), or ('text/plain', '',
idea.get_title())?]
- link=idea.get_link(index)
- [perhaps use __getitem__ here as
well? Derive from UserList?]
- [other functions for manipulating the link list]
- class Link:
-
A Link can point to:
- An Idea in the same Mind
- An Idea in a different Mind
- An arbitrary URL
The first and third cases are trivial - the link needs only to store the
ID or href, respectively. The second is problematic - a web-based client
would just want to present a clickable link to the user to the other Mind,
but a native app would want to use XML-RPC (or whatever; I say this because
Zope provides an XML-RPC server for free) to get the Idea and display it
locally instead of firing up a browser. It must be possible to store more
than one reference to a Mind. A Link to an Idea in a different Mind should
store two ids - one of the target Idea in the remote Mind, and one of an
Idea in this mind, which contains among its list of links references to
various access methods for this mind. The client could then choose whichever
method it prefers. [if the two ids are stored as a single string, separated
by some delimiter, it becomes possible to chain multiple references together -
i.e. the first id is in this mind, which points to a mind containing the
second id, which points to a mind containing the third... This would allow
linking thru a third party, perhaps to track a moving destination. Is this
useful?]
Methods:
- type=link.get_target_type()
- Returns one of
- 'idea' - an Idea in this Mind [perhaps distinguish
between links to ideas with titles and to ideas with data?]
- 'remote-idea' - an Idea in another Mind
- 'mind' - a reference to a Mind for use by 'remote-idea's
- 'href' - a URL
- dir=link.get_direction()
- One of 'parent', 'child', 'peer'
- string=link.get_label()
- User-specified text. For
target_type='mind', the label specifies the protocol to use.
- string=link.get_target()
- Returns a string specifying the target.
For 'idea's, this string may be passed to mind.get() to return the idea
For 'remote-idea's, the client must split the string, get the local
idea, choose an access method, open the remote mind, and pass it the
second idea.
The following notes were made 6 April 2000. Where they conflict, the
preceding notes take precedence
An Idea consists of:
- a title
- zero or more Associations with other Ideas
- zero or more references (URIs) to external resources
- zero or more Content objects
An Idea may have attributes. I have identified two attributes which I think
would be useful for this standard:
- order=unordered, sequence, or cycle -- specifies the significance of the
order of objects within the idea
- type=node or link -- nodes are the Ideas that the author intended to
create; links are ideas which are created by the application to create the
intended structure. For example, if there is an Association between Ideas
A and B, and the author decides to add a note to the Association, then a
new Idea of type "link" would be inserted to contain the note.
An Association is a part of one Idea, and points to a second Idea. There is
typically (but not necessarily) a second Association which points in the
other direction. An Association has a role, either "parent", "child", or
"peer". If an Association exists in both directions, then the two
Association objects should be either one parent and one child, or two peers.
An Association may optionally contain a title, which is a brief indication
of the nature of the relationship (which need not be the same for the other
side of the Association), and a target description, which may be shown to
the user instead of the title of the target Idea (this is useful if the
target Idea is stored on another site which may not be accessible).
A URI is similar to the HTML <a> element - it contains a reference to an
external resource and a description of that resource which is shown to the
user.
A Content object is used to store information in the Idea itself, rather
than linking to external data. The types of data which can be stored in a
Content object will vary depending on the implementation of an idea. For
example, an Idea stored in XML could contain Content in plain text, HTML, or
even SVG images, but not JPEG or PNG images.
As far as the user is concerned, it makes no difference whether Content
objects are used or whether all data is stored in separate files and
referenced with URIs. However, Content objects are preferable when
possible, as they reduce the number of transactions which must be made to
transfer a collection of Ideas.
The DTD currently used by ThoughtStream is
available here. You may have to save it to disk and view it with a text
editor; the server is misconfigured and therefore some browsers do not
display the DTD properly.
|