All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexander G. M. Smith" <agmsmith@rogers.com>
To: Leo Comerford <leocomerford@gmail.com>
Cc: reiserfs-list@namesys.com
Subject: File as a directory - Ordered Relations
Date: Fri, 27 May 2005 20:46:46 -0400 EDT	[thread overview]
Message-ID: <6708893568-BeMail@cr593174-a> (raw)

Leo Comerford wrote on Wed, 18 May 2005 12:50:38 +0100:
> But if you have relation-directories and the ability to find the
> pathnames of a given file, you can do everything you can do with
> subfiles, just as nicely, and more besides. And if subfiles are
> completely redundant and bad news anyway, we shouldn't have them.

I prefer subfiles (or fildirutes) as being easier to understand.  But
maybe that's just due to lots of experience with using file hierarchies.
I can see having a relational system, but I'd always want to also have
a directory hierarchy namespace, so that all files can be named.

Having those relationship directories seems kind of clunky - since
they're not located near the object being investigated.  Though
that's a GUI matter of making the system file browser pop up a
"Show Relationships..." menu item as contrasted with drilling down
to a subfile directory listing by clicking on an item.

> The idea is that if you want to assert a single-place predicate of a
> file, like "file x is important", you just use give the file an
> approprate full path"name" ('~/important' or whatever). If you want to
> assert a multi-place predicate - a relation - like "file x is more
> important than file y" then you use a relation-directory. That goes
> for every kind of multi-way relation/association you might want to
> assert between files - one to one, one to many, many to many.

Good point about sorted relationships.  Reminds me a bit about
attributes in BeOS and using them to sort file listings.  There may
be a duality between relation directories and a file system with
indexed attributes, like BeOS's BFS or a true file-is-a-directory
system.

One system has a relations directory stuffed with property values of
a similar kind (such as short text descriptions for photos).  The
directory implies the contents type (short text description), while
the items also link to the thing they are expressing a relationship
about (the photos).

The other system treats the object (the photo file) both as readable
data and as a directory with attribute-ish sub-things, like a sub-file
containing the text description of the photo.  File types are done as
meta-data (a couple of bytes attached to the object nodes), marking
the photo as JPEG data and the description subfile as text.  For bonus
points, the file type can also appear as a virtual child object to make
accessing the file type the same as accessing other data (no new APIs
needed).  Another advantage is that doing a directory listing of an
object gives you all its relations too (multiple parent objects listed).


Ordered Relations?

Now how to do an ordered relation?  For example, say you have the
shooting date for each photo as a property and you want to find
all photos shot on a given day, or range of days.  Either system
can be used to find them.

With relations, look in the relation directory that stores shooting
dates and sort by name (assuming that the naming of the items reflects
the date).  Say, just how do you name the relation items?  You had
aardvark and other animal names in your examples.  Should the actual
value be used (like the whole photo description text) as a name?
Or is the directory magically sorted by property value somehow?
Or is the relation directory just a concept, not actually browsable?

In the file/directory/attribute system, one of the file types would
be "shooting date" and all files with that type would be automatically
indexed, if you had created an index for "shooting date" earlier.  The
index merely stores the relevant value (a date) and a link (inode number?)
to the file.  To find the actual photo with a given date you'd have to
find the parent of the attribute-ish subfile thing the index gives you.

Come to think of it, if you display the index as a directory, you
kind of have your relation directory.  I had that as a feature in
AGMSRAMFileSystem, using the attribute values as the name of a
symbolic link pointing to the related item.  But it didn't occur to
me that it was like your relation directories until now.  Here's an
example - the last modified index for all files.  The date is in
microseconds for better sorting, and lack of time zone printing
functions in the BeOS kernel:

Fri May 27 20:12:36 24 /RAMDisk/.Indices>ls -l last_modified
total 1497
lrwxrwxrwx   0 agmsmith agmsmith        2 Sep 10  2001 1000158923000000 #604f52f8 -> /RAMDisk/PineappleData/news/Servers/NLZ/music.in_fidelity
lrwxrwxrwx   0 agmsmith agmsmith        2 Sep 10  2001 1000159028000000 #6094a790 -> /RAMDisk/PineappleData/saved/Keepsakes/PM999697.pmf
lrwxrwxrwx   0 agmsmith agmsmith        2 Sep 10  2001 1000172295000000 #608fb640 -> /RAMDisk/PineappleData/saved/Keepsakes/PM999685.pmf
lrwxrwxrwx   0 agmsmith agmsmith        2 Sep 18  2001 1000849618000000 #60bd8278 -> /RAMDisk/mozilla/res/samples/toolbarTest1.xul
lrwxrwxrwx   0 agmsmith agmsmith        2 Sep 18  2001 1000849618000000 #60edc108 -> /RAMDisk/mozilla/res/samples/scrollbarTest1.xul
lrwxrwxrwx   0 agmsmith agmsmith        2 Sep 18  2001 1000849627000000 #608eb2e0 -> /RAMDisk/mozilla/res/samples/tab.xul
...

However, that brings up the extra power of queries.  In BeOS you can build
a query string something like "ShootingDate=May 27 2005 & Location=*Home*"
for all photos shot on May 27th at locations that contain the word "Home".
It's a combination of relations.  Internally the simple query processor
just finds the files matching one of the indices (Shooting Date would be
the better choice since it is more constrained) then checks the resulting
set of files against the rest of the query.

If it's a duality, I suspect you'd be able to do something similar with
your relation directories.  For that matter, I was planning to add a
feature for showing query results as a virtual directory, so that queries
would be available to ordinary file namespace programs, like "ls".
Unfortunately the real world intervened and I had to end my sabbatical.
Lots of nifty topics still waiting there for someone to research and
implement!

- Alex

             reply	other threads:[~2005-05-28  0:46 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-28  0:46 Alexander G. M. Smith [this message]
2005-05-28  4:56 ` File as a directory - Ordered Relations David Masover
2005-05-28 19:42   ` Valdis.Kletnieks
2005-05-29 17:58     ` File as a directory - VFS Changes Alexander G. M. Smith
2005-05-30  8:25       ` Hans Reiser
2005-05-30 11:00       ` Nikita Danilov
2005-05-31  0:20         ` Alexander G. M. Smith
2005-05-31  9:34           ` Nikita Danilov
2005-05-31 15:04             ` Hans Reiser
2005-05-31 16:00               ` Nikita Danilov
2005-05-31 16:30               ` Valdis.Kletnieks
2005-05-31 16:55                 ` Jonathan Briggs
2005-05-31 16:59                   ` Hans Reiser
2005-05-31 17:13                     ` Jonathan Briggs
2005-05-31 18:27                       ` Hans Reiser
2005-05-31 21:01                         ` Jonathan Briggs
2005-05-31 21:08                           ` Jonathan Briggs
2005-05-31 22:36                             ` Nikita Danilov
2005-05-31 23:01                               ` Jonathan Briggs
2005-06-01 10:39                                 ` Nikita Danilov
2005-06-01 10:43                                   ` Nikita Danilov
2005-06-01 14:06                                     ` Jonathan Briggs
2005-06-01 14:42                                       ` Nikita Danilov
2005-06-01 15:40                                         ` Jonathan Briggs
2005-06-01 17:27                                           ` Nikita Danilov
2005-06-01 19:03                                             ` Jonathan Briggs
2005-06-02 10:38                                               ` Nikita Danilov
2005-06-02 18:35                                                 ` Jonathan Briggs
2005-06-02 23:54                                                   ` Nikita Danilov
2005-06-03 17:57                                                     ` Hans Reiser
2005-06-04 19:45                                                       ` Nikita Danilov
2005-06-04 20:13                                                         ` David Masover
2005-06-07  5:08                                                         ` Hans Reiser
2005-06-03  6:44                                                   ` Faraz Ahmed
2005-05-31 18:23                   ` Nikita Danilov
2005-05-31 18:32                     ` Hans Reiser
2005-06-02  1:27                       ` Alexander G. M. Smith
2005-06-02  7:46                         ` Hans Reiser
2005-06-02  9:11                       ` Nikita Danilov
2005-06-02 17:23                         ` Hubert Chan
2005-06-01  2:11             ` Alexander G. M. Smith
2005-06-01 10:58               ` Nikita Danilov
2005-06-02  1:58                 ` Alexander G. M. Smith
2005-06-02 10:03                   ` Nikita Danilov
2005-06-03  3:35                     ` Performance Impacts of Graph Cycles due to Multiple Parents Alexander G. M. Smith
2005-06-03 11:15                       ` Nikita Danilov
2005-06-07  2:04                         ` Alexander G. M. Smith
2005-05-30  8:19     ` File as a directory - Ordered Relations Hans Reiser
2005-05-31 16:46       ` Jonathan Briggs
2005-05-31 17:07         ` Hans Reiser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6708893568-BeMail@cr593174-a \
    --to=agmsmith@rogers.com \
    --cc=leocomerford@gmail.com \
    --cc=reiserfs-list@namesys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.