Re: [Tracker] Tracker plugin for Calibre dev question



Hi Vincent,

 So you want to develop a plugin inside calibre that inserts the book
information into tracker. The same that the plugin in evolution writes
emails into Tracker. That is ok and shouldn't be too difficult.

 Calibre is written in python and qt... Either you use
libtracker-sparql from python using gobject-introspection or you use
directly the dbus API.

 All the functional tests of Tracker are written in python using the
dbus API. You can use them as example [1]

 After that, you will have some code in python to connect to tracker
and send an update query. That query will look like this:

INSERT {
   <urn:ebook:some-unique-id-from-calibre> a nfo:TextDocument;
           nie:url "file:///home/ivan/Calibre%20Library/a/b/c.epub";
           nie:mimeType "application/epub+zip";
           nie:contentCreated "2012-02-20T01:01:00Z";
           nie:title "Here the title of the book";
           nie:description "Here some more useful information";
           nie:plainTextContent "here some content of the book, like
the first paragraph";
           nco:publisher [ a nco:Contact; nco:fullname "author name"].
}

 Note that there are more fields available and none of them is
mandatory. Use the previous example as inspiration to browse the
documentation of our properties [2]

 This representation of books is too simple (E.G. Calibre supports
multiple versions of the same book) but try to get this working first.
Then we can talk about updating the tracker model to represent better
the books.

 Good luck and do not hesitate to ask if you need help,

Ivan

[1] http://git.gnome.org/browse/tracker/tree/tests/functional-tests/common/utils/helpers.py
[2] http://developer.gnome.org/ontology/unstable/

On Mon, Feb 20, 2012 at 4:45 PM,  <gnome spraynpray spamgourmet org> wrote:
Dear developers of tracker,

I’m thinking of developing a tracker plugin for Calibre.

Calibre is an ebook managing application. It manage ebook in a similar
way Banshee or Rythmbox manage music. It has a database where ebook
metadata is stored that have far more information on ebook that the file
themselves. This is the reason why I think that a plugin would be more
helpful than just an extractor.

I searched a bit on how to do that in the documentation of tracker and
I’m honestly lost in all of it. If I get it correctly, some data about
the book need to be inserted in the sparql base, and it can be done with
some INSERT/UPDATE/REPLACE query using tracker-sparql. I’ve tried to
search for which format is used to store Document (as opposed to music
or contact), and I didn’t find anything. Apparently there is also Author
information. It seems to me there is a format used for those but I can’t
find where this information is described. I thought of trying to look up
extracted information but it seems a bit tiresome to do.
I’d appreciate if you could point me in the right direction.

Regards,
--
Vincent

_______________________________________________
tracker-list mailing list
tracker-list gnome org
http://mail.gnome.org/mailman/listinfo/tracker-list



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