Re: Metadata, a complete, WELL DOCUMENTED, idea, and responce.




Crazy idea: It's becoming fairly obvious that any metadata system that 
tries to store data with every file on the system is going to have
problems, and will be nearly impossible to make Do The Right Thing in
all cases.

So, let's look to a system that generally does the right thing (and
when it doesn't, it's usually just cos you're not trying hard enough
:) The system I am referring to is the emacs auto-mode list.

For those of you who don't know howit works, it's basically a list
whose elements are all made up of 2 objects - a regular expression,
and a mode name. When emacs opens a file, it scans the list until it
finds a RE match for the file name, and uses the associated mode to
open it.

Now, say we extend the specifier so it can be a RE, a file type (as
determined by "file"), or a logical combination of the 2. The second
part becomes a list of "data objects" (like edit_spec, view_spec,
etc), and a value for each data object. When a program wants to apply
a specific data object to a specific file (for example: gmc wants to
preform a "view_spec" on a file), it goes through the list, trying to
match the file spec. When it finds a file spec that matches that has
an associated data object that it wants, it returns that data object.

This can be very simple (to view a JPEG file, use ee), but still allow 
complex usage (any file which looks like a list of data points and
lives in a directory named project_.*_data should be viewed with
make_fancy_graph). New data objects can be added for new functions
(view and edit are the two that immediately come to mind), and the
file spec can be extended to do even more complex things, if needed.

This allows for system wide defaults (prepend the user's list to the
system list so the user's preferences override the system, of
course!), and for user preferences. You could even potentially allow a 
group of people (say a specific UNIX group) to share specs by storing
them in, say /usr/share/gnome/prefs/<gid>.filespec.

It does not requre synchronization, since the spec may be made
arbitrarily complex to catch a wide variety of potential cases. It
does not require a special library of filesystem, since it's a
preference, not true metadata. It should be possible to work this so
that it's powerful enough for the real power users, but still easy
enough for newbies to use easily.

Then again, I could just be on something really good :)

-Larry
-- 
  Larry Daffner        |  Linux: Unleash the workstation in your PC!
  vizzie@airmail.net / http://web2.airmail.net/vizzie/
Never underestimate the bandwidth of a station wagon full of tapes
hurtling down the highway.  -- Andrew Tanenbaum



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]