[Kde-pim] Akonadi in a commandline tool

Michael Schuerig michael.lists at schuerig.de
Fri Apr 29 00:08:33 BST 2011


I'm trying to access Akonadi in a commandline tool, however there are 
still some crucial tasks I haven't found a way to achieve:

* Getting a list of the user-visible names of all (top level) 
collections.
* Instantiating a Collection given its user-visible name.
* Restricting a SPARQL query to a single collection.
* Providing useful error messages for malformed SPARQL queries.

In GUI apps, the first two tasks are apparently handled by 
Akonadi::EntityTreeModel, but as that class is tied rather intimately to 
GUI functionality, I'm not sure if it is the right thing for my purpose.

Searching is done with Akonadi::ItemSearchJob. However, its docs warn 
explicitly that it might search the entire Nepomuk store. Unfortunately, 
the docs don't say how to restrict the search to a given collection.

Looking at the Akonadi Console code for Item Search, I got the 
impression that the errorString of a failed ItemSearchJob is displayed. 
When I enter a malformed query, I don't get any such message, although 
error messages do appear in ~/.xsession-errors.

I appreciate any help and particulary pointers to apps that already 
implement similar functionality.

Michael

-- 
Michael Schuerig
mailto:michael at schuerig.de
http://www.schuerig.de/michael/
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list