aboutsummaryrefslogtreecommitdiffstats
path: root/devel-docs/query/virtual-folder-in-depth.txt
diff options
context:
space:
mode:
Diffstat (limited to 'devel-docs/query/virtual-folder-in-depth.txt')
-rw-r--r--devel-docs/query/virtual-folder-in-depth.txt306
1 files changed, 306 insertions, 0 deletions
diff --git a/devel-docs/query/virtual-folder-in-depth.txt b/devel-docs/query/virtual-folder-in-depth.txt
new file mode 100644
index 0000000000..fc7b80ca07
--- /dev/null
+++ b/devel-docs/query/virtual-folder-in-depth.txt
@@ -0,0 +1,306 @@
+* introduction
+
+This document describes a different way of approaching mail
+organization and how all things are possible in this brave new
+world. This document does not describe physical storage issues nor
+interface issues.
+
+Historically mail has been organized into folders. These folders
+usually mapped to a single storage medium. The relationship between
+mail organization and storage medium was one to one. There was one
+mail organization for every storage medium. This scheme had its
+limitations.
+
+Efforts at categorizations are only meaningful at the instance that
+one categorized. To find any piece of data, regardless of how well
+it was categorized, required some amount of searching. Therefore, any
+attempts to nullify searching is doomed to fail. It's time to embrace
+searching as a way of life.
+
+These are the terms and their definitions. The example rules used are
+based on the syntax for VM (http://www.wonderworks.com/vm/) by Kyle
+Jones whose ideas form the basis for this. I'm only adding the
+existence of summary files to aid in scaling. I currently use VM and
+it's virtual-folder rules for my daily mail purposes. To date, my only
+complaints are speed (it has no caches) and for the unitiated, it's
+not very user-friendly.
+
+Comments, questions, rants, etc. should be directed at Giao Nguyen
+<grail@cafebabe.org> who will try to address issues in a timely
+manner.
+
+* Definitions
+
+** store
+
+A location where mail can be found. This may be a file (Berkeley
+mbox), directory (MH), IMAP server, POP3 server, Exchange server,
+Lotus Notes server, a stack of Post-Its by your monitor fed through
+some OCR system.
+
+** message
+
+An individual mail message.
+
+** vfolder
+
+A group of messages sharing some commonality. This is the result of a
+query. The vfolder maybe contained in a store, but it is not necessary
+that a store holds only one vfolder. There is always an implicit
+vfolder rule which matches all messages. A store contains the vfolder
+which is the result of the query (any). It's short for virtual folder
+or maybe view folder. I dunno.
+
+** default-vfolder
+
+The vfolder defined by (any) applied to the store. This is not the
+inbox. The inbox could easily be defined by a query. A default rule
+for the inbox could be (new) but it doesn't have to be. Mine happens
+to be (or (unread) (new)).
+
+** folder
+
+The classical mail folder approach: one message organization per
+store.
+
+** query
+
+A search for messages. The result of this is a vfolder. There are two
+kinds of queries: named queries and lambda queries. More on this
+later.
+
+** summary file
+
+An external file that contains pointers to messages which are matches
+for a named query. In addition to pointers, the summary file should
+also contain signatures of the store for sanity checks. When the term
+"index" is used as a verb, it means to build a summary file for a
+given name-value pair.
+
+* Queries
+
+Named queries are analogous to classical mail folders. Because named
+queries maybe reused, summary files are kept as caches to reduce
+the overall cost of viewing a vfolder. Summary files are superior to
+folders in that they allow for the same messages to appear in multiple
+vfolders without message duplications. Duplications of messages
+defeats attempts at tagging a message with additional user information
+like annotations. Named queries will define folders.
+
+Lambda queries are similar to named queries except that they have no
+name. These are created on the fly by the user to filter out or
+include certain messages.
+
+All queries can be layered on top of each other. A lambda query can be
+layered on a named query and a named query can be layered on a lambda
+query. The possibilities are endless.
+
+The layerings can be done as boolean operations (and, or, not). Short
+circuiting should be used.
+
+Examples:
+
+(and (author "Giao")
+ (unread))
+
+The (unread) query should only be evaluated on the results of (author
+"Giao").
+
+(or (author "Giao")
+ (unread))
+
+Both of these queries should be evaluated. Any matches are added to the
+resulting vfolder.
+
+* Summary files
+
+Summary files are only meaningful when applied to the context of the
+default-vfolder of a store.
+
+Summary files should be generated for queries of the form:
+
+(function "constant value")
+
+Summary files should never be generated for queries of the form:
+
+(function (function1))
+
+(and (function "value")
+ (another-function "another value"))
+
+Given a query of the form:
+
+(and (function "value")
+ (another-function "another value"))
+
+The system should use one summary file for (function "value") and
+another summary file for (another-function "another value"). I will
+call the prior form the "plain form".
+
+It should be noted that the signature of the store should be based on
+the assumption that new data may have been added to the store since
+the application generated the summary file. Signatures generated on
+the entirety of the store will most likely be meaningless for things
+like POP/IMAP servers.
+
+* Incremental indexing
+
+When new messages are detected, all known queries should be evaluated
+on the new messages. vfolders should be notified of new messages that
+are positive matches for their queries. The indexes generated by this
+process should be merged into the current indexes for the vfolder.
+
+* Can I have multiple stores?
+
+I don't see why not. Again, the inbox is a vfolder so you can get a
+unified inbox consisting of all new mail sent to all your stores or
+your can get inboxes for each store or any combination your heart
+desire. You get your cake, eat it, and someone else cleans the dishes!
+
+* Why all this?
+
+Consider the dynamic nature of the following query:
+
+(and (author "Giao")
+ (sent-after (today-midnight)))
+
+today-midnight would be a function that is evaluated at run-time to
+calculate the appropriate object.
+
+* Scenarios of usage and their solutions
+
+** Mesage alterations
+
+This is a fuzzy area that should be left to the UI to handle. Messages
+are altered. Read status are altered when a new message is read for
+example. How do we handle this if our query is for unread messages?
+Upon viewing the state would change.
+
+One idea is to not evaluate the queries unless we're changing between
+vfolder views. This assumes that one can only view a particular
+vfolder at a time. For multi-vfolder viewing, a message change should
+propagate through the vfolder system. Certain effects (as in our
+example) would not be intuitive.
+
+It would not be a clean solution to make special cases but they may be
+necessary where certain defined fields are ignored when they are
+changed. Some combination of the above rules can be used. I don't
+think it's an easy solution.
+
+** Message inclusion and exclusion
+
+Messages are included and excluded also with queries. The final query
+will have the form of:
+
+(and (author "Giao")
+ (criteria value)
+ (not (criteria other-value)))
+
+Userland criterias may be a label of some sort. These may be userland
+labels or Message-IDs. What are the performance issues involved in
+this? With short circuiting, it's not a major problem.
+
+The criterias and values are determined by the UI. The vfolder
+mechanism isn't concerned with such issues.
+
+Messages can be included and excluded at will. The idea is often
+called "arbitrary inclusion/exclusion". This can be done by
+Message-IDs or other fields. It's been noted that Message-IDs are not
+unique.
+
+I propose that any given vfolder is allocated an inclusion label and an
+exclusion label. These should be randomly generated. This should be
+part of the vfolder description. It should be noted that the vfolder
+description has not been drafted yet.
+
+The result is such that the rules for a given named query is:
+
+(and (user-query)
+ (label inclusion-label)
+ (not exclusion-label))
+
+** Query scheduling
+
+Consider the following extremely dynamic queries:
+
+A:
+(and (author "Giao")
+ (sent-after (today-midnight)))
+
+B:
+(and (sent-after (today-midnight))
+ (author "Giao"))
+
+C:
+(or (author "Giao")
+ (sent-after (today-midnight)))
+
+Query A would be significantly faster because (author "Giao") is not
+dynamic. A summary file could be generated for this query. Query B is
+slow and can be optimized if there was a query compiler of some
+sort. Query C demonstrates a query in which there is no good
+optimization which can be applied. These come with a certain amount of
+baggage.
+
+It seems then that for boolean 'and' operations, plain forms should be
+moved forward and other queries should be moved such that they are
+evaluated later. I would expect that the majority of queries would be
+of the plain form.
+
+First is that the summary file is tied to the query and the store
+where the query originates from. Second, a hashing function for
+strings needs to be calculated for the query so that the query and the
+summary file can be associated. This hashing function could be similar
+to the hashing function described in Rob Pike's "The Practice of
+Programming". (FIXME: Stick page number here)
+
+** Archives
+
+Many people are concerned that archives won't be preserved, archives
+aren't supported, and many other archive related issues. This is the
+short version.
+
+Archives are just that, archives. Archives are stores. Take your
+vfolder, export it to a store. You are done. If you load up the store
+again, then the default-vfolder of that store is the view of the
+vfolder, except the query is different.
+
+The point to vfolder is not to do away with classical folder
+representation but to move the queries to the front where it would
+make data management easier for people who don't think in terms of
+files but in terms of queries because ordinary people don't think in
+terms of files.
+
+* Miscellany
+
+** Annotations
+
+There should be a scheme to add annotations to messages. Common mail
+user agents have used a tag in the message header to mark messages as
+read/unread for example. Extending on this we have the ability to add
+our own data to a message to add meaning to it. If we have a good
+scheme for doing this, new possibilities are opened.
+
+*** Keywords
+
+When sending a message, a message could have certain keywords attached
+to it. While this can be done with the subject line, the subject line
+has a tendency to be munged by other mail applications. One popular
+example is the "[rR]e:" prefix. Using the subject line also breaks the
+"contract" with other mail user agents. Using keywords in another
+field in the message header allows the sender to assist the recipient
+in organizing data automatically. Note that the sender can only
+provide hints as the sender is unlikely to know the organization
+schemes of the recipient.
+
+** Scope
+
+Let us assume that we have multiple stores. Does a query work on a
+given store? Or does it work on all stores? Or is it configurable such
+that a query can work on a user-selected list of stores?
+
+* Alternatives to the above
+
+Jim Meyer <purp@selequa.com> is putting some notes on where
+annotations needs to be located. They'll be located here as well as
+any contributions I may have to them. \ No newline at end of file
/electron6/files/ini-1.3.8&id=9e792f944d80e2e1f0db26fcfbc98daa0b40dcb0'>This port may not be needed anymore. The maintainer is checking this. Innetchild2006-06-141-2/+2 * Register conflicts with the FC linux base ports (fixes experimental portsnetchild2006-06-101-2/+4 * Update to KDE 3.5.3lofi2006-06-064-20/+18 * - Remove single-locale firefox l10n ports, please use www/firefox-i18n nowsat2006-06-015-77/+0 * Bump PORTREVISION to reflect the fact that the .desktop file is nojylefort2006-05-211-1/+1 * Bump PORTREVISION to reflect the fact that these ports may nowjylefort2006-05-191-1/+1 * Remove USE_REINPLACE from categories starting with a Kedwin2006-05-094-4/+0 * Update to 7.3perky2006-04-222-4/+4 * Reset hollywar@mail.holywar.net due to no response to email about maintainerlinimon2006-04-053-3/+3 * Update to KDE 3.5.2lofi2006-03-314-126/+20 * Update to 7.1perky2006-03-193-6/+8 * Downgrade to 7.0.1 temporarily mainly because the printing featurehrs2006-03-082-4/+5 * Bump PORTREVISION on glib12/gtk12 consumer ports to ease the upgrade path.ade2006-03-074-4/+4 * - Fix build breakage due to print/adobe-cmaps updating.hrs2006-02-273-21/+23 * Fix devel/libytnef[1] and others[2] after libtool commit.ade2006-02-241-1/+1 * Conversion to a single libtool environment.ade2006-02-235-3/+7 * Fix pkg-plist.hrs2006-02-221-0/+1 * - Use a distfile in tarball instead of one in rpm.hrs2006-02-223-23/+7 * - Remove ak12.tar.Z and use print/adobe-cmaps instead.hrs2006-02-213-50/+19 * Bump PORTREVISION because of print/ghostscript-gnu-commfont update.hrs2006-02-211-0/+1 * * Remove print/acroread - it has expired on 2006-01-03vd2006-02-104-24/+0 * Upgrade to 1.5a.vanilla2006-02-083-14/+9 * - Remove USE_REINPLACEbarner2006-02-061-4/+2 * - Fix bug(updater.ini).vanilla2006-02-042-4/+2 * - Unbreakvanilla2006-02-024-35/+30 * Update to KDE 3.5.1.lofi2006-02-012-6/+6 * Update to 6.5perky2006-02-013-6/+5 * SHA256ifyedwin2006-01-305-2/+24 * SHA256ify, and remove file from filesdiredwin2006-01-301-1/+2 * BROKEN when WITHOUT_X11: Broken dependencykris2006-01-261-0/+4 * SHA256ifyedwin2006-01-2239-0/+59 * eplace ugly "@unexec rmdir %D... 2>/dev/null || true" with @dirrmtryedwin2006-01-221-1/+1 * Replace ugly "@unexec rmdir %D... 2>/dev/null || true" with @dirrmtryedwin2006-01-226-11/+11 * BROKEN: Unfetchablekris2006-01-201-0/+2 * Update to KDE 3.5.0lofi2006-01-096-76/+98 * Hash with SHA-256.trevor2006-01-081-0/+1 * Add firefox-ko 1.5, Firefox Korean(ko) Language Pack.lawrance2005-12-196-0/+87 * Update to 6.2perky2005-12-173-11/+12 * Update to 0.2.1.cjh2005-12-082-4/+5 * - Update to 1.1.1-a021.hrs2005-12-072-4/+4 * - Add SHA256pav2005-11-252-0/+2 * Mass-conversion to the USE_AUTOTOOLS New World Order. The code presentade2005-11-154-6/+4 * Update to KDE 3.4.3 / KOffice 1.4.2lofi2005-11-052-10/+0 * Bump PORTREVISION to chase the glib20 shared library update.marcus2005-11-055-4/+5 * Fix pkg-plistedwin2005-11-032-5/+2 * Update to 0.5.4.nork2005-11-036-24/+55 * Drop maintainership.jkim2005-10-171-1/+1 * SCIM updated to 1.4.2.nork2005-10-152-2/+2 * Enable Korean support for xpdf.jkim2005-10-151-0/+1 * Enable korean support for xpdf.jkim2005-10-156-0/+85 * activate scim-hangul, Korean imengine for scim.cjh2005-10-136-0/+75 * Update to 5.4perky2005-10-103-7/+8 * localized versions of Adobe Reader (formerly Acrobat Reader)trevor2005-10-084-0/+36 * Canonicalize name of null maintainer.linimon2005-10-041-1/+1 * Update to 0.9.13perky2005-09-112-4/+4 * BROKEN: Broken dependencykris2005-08-312-0/+4 * - Unbreak on 5.X and 6.Xpav2005-08-063-4/+40 * - Fix broken behavior that overwrites some files from x11/xterm.perky2005-08-044-14/+27 * - Fix plistperky2005-08-013-10/+5 * Update to KDE 3.4.2 / KOffice 1.4.1lofi2005-08-016-6/+36 * o Update to 1.4.0.nork2005-07-301-1/+1 * Fix fetch problem. Oops!cjh2005-07-281-6/+2 * This port is scheduled for deletion on 2005-09-22 if it is still brokenkris2005-07-234-0/+8 * BROKEN: Unfetchablekris2005-07-181-0/+2 * Remove port for korean/mplayer-fonts. It's not so useful now becauseperky2005-07-146-234/+0 * Chase master site URL change.perky2005-07-142-5/+4 * Update to 4.5perky2005-07-143-5/+5 * Update to 1.0.1 and follow teTeX-3.0 scheme.cjh2005-07-084-4325/+4363 * Remove openoffice.org localized ports as I announced:maho2005-06-293-34/+0 * Update to KDE 3.4.1lofi2005-06-262-2/+0 * Mega-patch to cleanup the ports infrastructure regarding our linux bits:netchild2005-06-181-5/+3 * fix pkg-plistoliver2005-06-031-1/+0 * - Change last few occurences of USE_GTK=yes to USE_GNOME=gtk12pav2005-05-311-1/+1 * IIIMF-related ports: fix build faildaichi2005-05-272-2/+30 * IIIMF-related ports:daichi2005-05-246-102/+95 * Added slave port of lang/php_doc for the Korean languageedwin2005-05-232-0/+14 * * add CONFLICTSskv2005-05-141-2/+5 * o Updatenork2005-05-101-1/+1 * At Kris's request, back out the MACHINE_ARCH spelling correction untilobrien2005-04-123-3/+3 * Assist getting more ports working on AMD64 by obeying theobrien2005-04-113-3/+3 * Replace "%" in patch filenames with "_".tobez2005-04-072-0/+0 * BROKEN: Does not buildkris2005-03-271-0/+2 * Fixed iiimf-related ports build faildaichi2005-03-254-117/+55 * Update to KDE 3.4lofi2005-03-212-0/+2 * Bump PORTREVISION to chase the glib20 shared lib version change.marcus2005-03-124-1/+4 * - update to 0.5.1, use scim-table-imengine nowclsung2005-03-076-25/+43 * IIIMF-related portdaichi2005-03-058-0/+226 * Name is not correct. iiimf-le-hanbul must be iiimf-le-hangul.daichi2005-03-058-226/+0 * IIIMF-related ports:daichi2005-03-048-0/+226 * Respect the user's USE_LINUX setting.trevor2005-03-021-1/+1 * BROKEN: Removes files installed by another portkris2005-02-281-0/+2 * BROKEN: Incomplete pkg-plistkris2005-02-282-0/+4 * - Update distinfo because some font files on site are updated.perky2005-02-202-8/+5 * As previously announced, remove ports that have reached their expiry date,kris2005-02-1923-1062/+0 * Update to 4.1perky2005-01-263-5/+6 * Remove dead master site and update WWW.vanilla2005-01-202-3/+2 * Removed the insecure elvrec and elvprsv binaries to disable theniels2005-01-115-294/+51 * Say hello to the linux mega patch, it consolidates our linux bits anetchild2005-01-011-3/+4 * Add i18nized doc subdirs to kdehier and adjust i18n port plists accordingly.lofi2004-12-232-2/+2 * Change one use of BROKEN to IGNORE and make all uses of IGNORE renderlinimon2004-12-201-2/+2 * As previously announced, retire these old warhorses due to securitylinimon2004-12-1911-338/+0 * This port is scheduled to be removed on 2005-02-18 if it is stillkris2004-12-193-0/+6 * Tweak IGNORE string to give a better-worded error message.kris2004-12-192-2/+2 * Canonicalize definition of BROKEN.linimon2004-12-171-1/+1 * Update to KDE 3.3.2lofi2004-12-142-2/+2 * Update to 0.15.cjh2004-12-053-13/+21 * Update to 0.9.11.cjh2004-12-052-5/+5 * Fix omitted dot. Oops.cjh2004-12-051-1/+1 * Fix build in amd64.cjh2004-12-052-4/+4 * - Standardize an EXPIRATION_DATE format.sem2004-11-241-1/+1 * farewell to libxpg4.sf2004-11-153-4/+1 * Bump PORTREVISIONS for all ports that depend on atk or pango to ease in themarcus2004-11-085-3/+5 * Give each of these FORBIDDEN ports an expiration date.linimon2004-11-071-0/+2 * Mark FORBIDDEN: I have no doubt that many of the vulnerabilities thatnectar2004-10-221-0/+2 * Upgrade textproc/scim and related ports:thierry2004-10-193-6/+6 * Unbroke and update to 3.1.cjh2004-10-122-5/+3 * BROKEN on 5.x: Does not compilekris2004-09-192-1/+11 * BROKEN: Unfetchablekris2004-09-191-0/+2 * Set PORTEPOCH to 1 because the last update bumped portversionperky2004-09-011-0/+1 * Update to 1.0perky2004-09-013-31/+20 * Update to 0.14perky2004-09-013-8/+9 * Update to KDE 3.3lofi2004-08-314-6/+2 * Update to 2.7 and unbreak fetch.perky2004-08-243-7/+6 * Fix build with gcc-3.4krion2004-08-231-0/+14 * Mark BROKEN: Unfetchablekrion2004-08-231-0/+2 * Add a forgotten PLIST_SUB in last update to textproc/scim to support 4-STABLE.arved2004-08-222-3/+3 * As previously announced, remove these broken/insecure/obsolete ports.kris2004-08-1619-4873/+0 * 1: Make scim buildable on 4-X.vanilla2004-08-121-2/+10 * - Update WWWpav2004-07-301-1/+1 * - Add the X_WINDOW_SYSTEM={xorg,xfree86-4,xfree86-3} variable to bsd.port.mk,anholt2004-07-246-46/+22 * Add new port for aleefonts-ttf 0.3,perky2004-07-235-0/+45 * Pet portlint.lofi2004-07-114-2/+6 * BROKEN: Does not buildkris2004-07-111-0/+2 * Apply a big libtool patch to allow porters to use the libtool installed bymarcus2004-07-101-1/+1 * Add scim-tables 0.4.0, SCIM table based Korean input methods.vanilla2004-07-038-0/+99 * Remove expired port, superseded by sysutils/cdrtools-cjk.netchild2004-07-0212-294/+0 * - Unify print/gsfonts dependency checkpav2004-06-171-1/+1 * BROKEN: Does not buildkris2004-06-151-0/+2 * BROKEN: Size mismatchkris2004-06-091-0/+2 * sysutils/cdrtools-cjk supersedes korean/mkisofs. Since this port has anetchild2004-06-071-0/+4