Re: [Tracker] chm mime type



On 21/03/11 16:55, Rustom Mody wrote:


On Mon, Mar 21, 2011 at 3:30 PM, Martyn Russell <martyn lanedo com
<mailto:martyn lanedo com>> wrote:

    On 21/03/11 08:26, ivan frade nokia com
    <mailto:ivan frade nokia com> wrote:

        Hi Rusi,


    Hi,

        Fairly easy. You need to implement a extractor module for that
        mimetype. It means to implement a couple of mandatory functions,
        build it and install it in the right location.

    <<snipped>>

    Great advise from Ivan there. I just wanted to warn you, these APIs
    and examples have changed in master recently. So depending on where
    you're targeting, you might want to look at the source.


Thanks both for the answers.
I had a first look and see that it needs to be in glib/gdk etc.  I must
admit this will be a bit of a learning curve.
On the other hand what needs to be done is (seems) quite trivial
1. Run extract_chmLib on the chm file (opening into /tmp/newdirname )
2. Run the tracker on the dir
3. Integrate the results of 2 back into the database

1 and 2 seem trivial and would likely be literally 1-liners in something
like python

Make use of other extractors, they use functions available to make things easier (like tracker_open()). Note the APIs in libtracker-extract too.

About 3 I dont know...

There are a few things you can do here.

1. Look at the ontology to see what properties you can export and what's not supported. The tracker-sparql command comes in handy for this, e.g.:

$ tracker-sparql -s document
Classes:
  http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document
  http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#TextDocument

http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PlainTextDocument
  http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HtmlDocument

http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PaginatedTextDocument
  http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HelpDocument

Properties:
  None

--

You can use tracker-sparql to get properties and other information about classes to know what to use.

Anyhow I think its still too premature for me to talk before I can find
my way around.
For example I have a man page for tracker-extract but
$ tracker-extract
gives command not found

Commands instantiated by d-bus are installed into $prefix/libexec, this includes tracker-store, tracker-miner-fs, tracker-miner-rss, tracker-miner-flickr, tracker-writeback and of course tracker-extract.

--
Regards,
Martyn



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