All of lore.kernel.org
 help / color / mirror / Atom feed
* File as a directory - Ordered Relations
@ 2005-05-28  0:46 Alexander G. M. Smith
  2005-05-28  4:56 ` David Masover
  0 siblings, 1 reply; 51+ messages in thread
From: Alexander G. M. Smith @ 2005-05-28  0:46 UTC (permalink / raw)
  To: Leo Comerford; +Cc: reiserfs-list

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

^ permalink raw reply	[flat|nested] 51+ messages in thread
* RE: File as a directory - VFS Changes
@ 2005-06-02 14:46 Faraz Ahmed
  0 siblings, 0 replies; 51+ messages in thread
From: Faraz Ahmed @ 2005-06-02 14:46 UTC (permalink / raw)
  To: reiserfs-list

 Hi Nikita;


     The problems of files not fitting in the query of the smart folder is a
 serious one. We had implemented this same thing for our semantic
filesystem.

For ex we create a MP3 file is a JPEG folder things it wont ever get
listed.
This will fundamentally change the way users see your filesytem, the users
expect to see the files in the folder they created. This it self should be a
default search criteria.
We almost solved this by having the "parentdirectory" as a attribute of the
file. All the smart folders have thier query transparently modified as
"where type=jpg Or parentdirectory=thisdirectory". This make the virtual
folder stuff work as EXTENSION to standard file/directory relationship
rather than work as RELPLACEMENT.

    Personal experience says that user dont digest any change to UNIX
filesystem mode. Anything extra is OK but replacements are BAD. Think of it
you created a C file in a virtual folder for "h" files the files wont get
listed(althoug they will exist). THEN WHAT??? the user has to search it BAD,
your whole fancy virtual directory USECASE itself is lost and eventually we
endup solving nothing.



    Other issues include this display name stuff etc. They are bad. what if
two files with same display name get listed in the same virtual directory.
No point in creating a problem and then solving it. Good Work though we dont
want to get booged down once WinFS is released.
Regards
Faraz.



^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2005-06-07  5:08 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-28  0:46 File as a directory - Ordered Relations Alexander G. M. Smith
2005-05-28  4:56 ` 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
  -- strict thread matches above, loose matches on Subject: below --
2005-06-02 14:46 File as a directory - VFS Changes Faraz Ahmed

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.