[Nautilus-list] Metadata model



Hi,

I'm trying to get my head around Nautilus' requirements in terms of metadata
management. I really want to bring the metadata stuff in gnome-vfs up to
speed so that Nautilus can use it. As far as I can tell (by reading code and
email and talking to people on #nautilus) we need the following classes of
metadata:
 o Shared metadata, readable and writable by all users
 o Shared metadata, readable by all users and writable by the owner
 o Unshared metadata, private to each user

Additionally, metadata has to be optimised for access on a directory
basis. WebDAV approaches this problem in an interesting way - when you do
a PROPFIND (the HTTP method to retrieve metadata) you supply a "Depth:"
header whose value is either "0", "1" or "infinity", where "0" requests
the metadata for just that resource, "1" requests the metadata for that
resource and its immediate children, and "infinity" requests the metadata
for the resource and all of its children (to an infinite depth). I don't
feel we need (or want) to have infinite depth requests, but the depth
concept could be very useful.

An API could go something like this:

typedef enum {
  METADATA_TYPE_PRIVATE /* $HOME/.gnome-metadata/... (mode 600/700) */
  METADATA_TYPE_OWNER,  /* method://path/.gnome-metafile (mode 644) */
  METADATA_TYPE_SHARED, /* method://path/.gnome-shared-metafile (mode 666) */
} GnomeVFSMetadataType;

typedef enum {
  METADATA_DEPTH_ZERO = 0, /* get the metadata for just this URI */
  METADATA_DEPTH_ONE = 1   /* get the metadata for this URI and its children */
} GnomeVFSMetadataDepth;

void gnome_vfs_metadata_attach(GnomeVFSURI uri, gchar *namespace,
  GnomeVFSMetadataType type, xmlDocPtr metadata);

xmlDocPtr gnome_vfs_metadata_query(GnomeVFSURI uri, gchar *namespace, 
  GnomeVFSMetadataDepth depth);

void gnome_vfs_metadata_detach(GnomeVFSURI uri, gchar *namespace);

Of course the issues lie in building an efficient implementation. The
major issue I see is implementing query(depth=1) efficiently. I've been
playing with a little CORBA server I wrote to deal with private metadata,
and I'll look at extending that to understand depth requests and then the
other two types of metadata.

What am I missing from this model? Can you see anything that needs to be
here for either Nautilus or some other application?

Ian

-- 
Ian  McKellar |    Email: yakk(a)yakk.net |    Web: http://www.yakk.net/
Area: +61 (8) | Home: 9389 9152 | Fax/Voice: 9260 2903 | Work: 9384 4700

Attachment: pgpk21bRyq9yU.pgp
Description: PGP signature



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