[Evolution] Beagle and Tracker, letting Evolution feed those beasts RDF triples instead

All metadata engines are nowadays working on a method to let them get
their metadata fed by external applications.

For example the Xesam team at Freedesktop are putting together an API
like this: http://xesam.org/main/XesamMetadataAPI

Such APIs come down to storing RDF triples. A RDF triple comes down to a
URI, a property and a value.

For example (in Turtle format, which is SparQL's inline format and the
typical w3's RDF storage format):

<imap://user server/INBOX/001> <nmo:to> <some dude com> ;
        <nmo:messageSubject> "RE: Hello World" ;
        ... ;
        <nmo:from> <somebody somewhere com> .

Usually the API goes like this:

InsertRDFTriples (const char *subject, 
                 const char **predicates, 
                 const char **values);

For example:

static void
my_code (void) {
        char **predicates = malloc0 (sizeof (char*) * 4);
        char **values = malloc0 (sizeof (char*) * 4);
        char *subject = "imap://user server/INBOX/001";

        predicates[0] = "<nmo:to>";
        values[0] = "<some dude com>";

        predicates[1] = "<nmo:messageSubject>";
        values[1] = "\"RE: Hello World\"";

        predicates[2] = "<nmo:from>";
        values[2] = "<somebody somewhere com>";

        dbus_g_proxy_begin_call (prox,
                                 G_TYPE_STRING, subject,
                                 G_TYPE_STRV, predicates,
                                 G_TYPE_STRV, values,

        free (predicates);
        free (values);

We'd like to make an Evolution plugin that does this for Tracker. 

Obviously would it be as easy as letting software like Beagle become an
implementer of "prox"'s InsertRDFTriples to start supporting Beagle with
the same code and Evolution plugin, this way.

I just don't know which EPlugin hooks I should use. Iterating all
accounts and foreach account all folders and foreach folder all
CamelMessageInfo instances is trivial and I know how to do this.

What I don't know is what reliable hooks are for:

  * Application started
  * Account added
  * Account removed
  * Folder created
  * Folder deleted
  * Folder moved
  * Message deleted (expunged)
  * Message flagged for removal 
  * Message flagged as Read and as Unread
  * Message flagged (generic)
  * Message moved (ie. deleted + created)
  * New message received
    * Full message 
    * Just the ENVELOPE

Note that the EPlugin documentation is by far not detailed enough to
distill these hooks out of that. 

Who can help me with this? Where can I find a list? What source code
files do I have to crunch to know this? Will I have to read all of
the .c files in mail/ ?

Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 

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