Category: gnome

Hello planet GNOME, glad to be in this planet after so many years reading it. Probably you were able to skip my Tracker presentations in different conferences… so now I try via blog. And my first post brings good news.

From now on (it has just landed in master), Tracker libraries are accessible via gobject-introspection. You can manipulate the information via libtracker-sparql or write new miners using libtracker-miner in any language with gobject-introspection support (E.G. python). A snipped of code is worth a thousand words:

#!/usr/bin/env python
import gi
from gi.repository import Tracker

conn = Tracker.SparqlConnection.get (None)
cursor = conn.query ("SELECT ?u WHERE { ?u a nie:InformationElement. }", None)

while ( (None)):
      print cursor.get_string (0)

This is a synchronous query to the store. Note that you have a cursor to access the results: they will be retrieved from the DB only when needed. Using this while building a model for the UI should show quite a performance improvement compared with the old DBus API. And if you fancy more the asynchronous way of coding, the code looks like this. You can open the connection, run the query and retrieve the results all asynchronously.

When it comes to miners (processes retrieving information), here is a skeleton of an implementation: a subclass of Miner overriding few methods. Install with the usual dbus files and you have a miner that can be started/stoped/monitored with the Tracker tools.

libtracker-sparql is our recommended way to use tracker, the DBus API can be considered internal, and now with gobject-introspection it is available from different languages than C or vala. Combine this with libpeas (also using GI) and then we can easily write plugins showing information from Tracker into applications like EOG or totem… Interesting!


A couple of weeks ago, we updated Tracker to load its configuration using GSettings instead of its own old-fashioned .cfg files. GSettings is an API to manipulate key=value pairs that abstracts the backend (keyfiles, gconf, dconf…) where they are actually stored.

This was a good change in a lot of senses, but it was breaking our functional tests. We have a suite of tests that we like to run once Tracker is installed in the system. They check if the basic functionality is working fine: the store starts, the miner starts, basic Sparql is processed fine, crawling/monitoring a directory is ok… Some of those tests rely on booting tracker with an specific configuration and with gsettings that isn’t as easy as defining a new XDG_CONFIG_DIR anymore. Well, lets fix the tests then.

My first idea was to hack our GSettings object to load data from the system or from a keyfile, depending on an environment variable: very portable, but is an ugly hack and the code paths start to differ a lot. Then i discovered the DConf profiles. Only works when gsettings is using dconf and needs to install a system-wide profile, but otherwise (in code and test setup) is nice.

It took me more time than expected due some stupid mistakes here and there using dconf:

  • Profile names can only use alphanumeric and underscore characters. A profile like “tracker-test” won’t work (because is not a valid dbus name), but “trackertest” is fine. (Wiki updated now)
  • Do NOT set XDG_CONFIG_DIR in the environment (Bug reported). I guess that the client is using the variable to look for the DB but the writing daemon is not, so the results are not the expected
  • If at the same time you are changing the dconf schemas, make sure to remove old files from /usr/share/glib-2.0/schemas, run /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas and remove any old dconf database (in ~/.config/dconf) including “user”. Otherwise if some code is using the old schema, it won’t complain but the values will be wrong.
  • DConf uses the GVariant serialization, so be careful when setting lists.

I hope this saves some time to the next person trying to test something that uses dconf for its settings.

I guess neither Tomboy nor Tracker need much introduction. If you have both of them on your computer, you have probably wondered “why Tracker doesn’t index my Tomboy notes?”. Good point. You are not the only one thinking that;  somebody even opened a bug about it and here comes a solution.

It is a plugin for Tomboy (a NoteAddin in their terminology) that writes the information of the note into Tracker making it searchable on the desktop (E.G. using tracker-needle). The code is available in gitorious. Checkout, compile and install (you can use make install-data-local in src/ to install it on your $HOME). Well, you also need the latest tracker from GIT until we release 0.10.2 (soon) because i needed to add a “Note” class there.

The current status is “It works on my computer” but is safe to try because this plugin only exports data and never touches the original notes, so there is no risk of losing any information. Feedback is very welcome!

Tracker, RDF y un concurso

Tracker ya no es un buscador “pasivo” que descubre e intenta reconstruir lo que otras aplicaciones guardan. Desde la versión 0.7 es lo que llamamos un “triplet store”, que es capaz de guardar tripletas (la base de RDF) y resolver consultas en un lenguaje de consulta específico (llamado SparQL, y a mi entender mucho mas facil que SQL).

Las aplicaciones alimentan directamente Tracker (en lugar del modelo “tracker reacciona cuando la aplicacion guarda algo”), y todo este cambio tiene dos objetivos: compartir información entre aplicaciones (no importa que programa… un correo es un correo), y enlazar información desde distintas fuentes: IM, Email, SMS, entradas de blog de un contacto son generadas por distintas aplicaciones pero todas hablan de la misma persona.

Ahora tracker esta casi listo y estamos haciendo un esfuerzo por a) explicar bien lo anterior b) hacer que las aplicaciones metan datos en Tracker y c) hacer que las aplicaciones usen Tracker para ofrecer nuevos casos de uso. Este último es el paso mas divertido: algunas ideas estan muy vistas (pero no implementadas) como poner tags en el Visor de Imagenes (EOG) y navegarlas en Nautilus… o (mi preferido) matar el dialogo de abrir fichero y hacerlo basado en Tags o tiempo o categorias de documentos. Pero también, se abre la puerta a nuevas ideas, Tracker es solo un ingrediente, ahora hay que hacer los platos!

Todo esto viene a cuento, porque Rob acaba de publicar un video explicando lo básico de RDF, y su compañia, Codethink, abre un concurso de aplicaciones. Elige tu toolkit/lenguage preferido (mientras corra en linux y puedas usar DBus), haz una aplicación usando Tracker (no hace falta que sea 100% perfecta, prototipo vale), y gana un Nexus One.

Si solo un telefono no te motiva lo suficiente (eso de que lleve Android…), aquí van un puñado de razones más para participar: te ayuda a involucrarte en Tracker que es uno de los proyectos mas activos e innovadores que tenemos por aqui (y donde trabajan algunos de los super heroes de GNOME); te da experiencia en un proyecto real, que hace muy buen curriculum, y esto del RDF, SparQL y conectar información tiene bastante futuro (y no hay tanta gente disponible que sepa de ello) asi que no es desperdiciar tu tiempo!

P.D. Si necesitas ayuda o sugerencias para perfilar tu idea, puedes escribirme o preguntar en el canal de IRC #tracker en GimpNet.

Zeitgeist hackfest

Zeitgeist is an “event logger”. It registers the activity of the user on the desktop, what documents uses, when, while talking with who, combined with what… and then different UIs can consume this data to show a Journal of activity, a better relevance in the searches, related documents to the one you are working on and [write your own cool idea here].

Tracker and Zeitgeist are complementary projects: Tracker knows the documents, Zeitgeist knows the activities. We (tracker developers) have been talking with Zeitgeist developers before and have a common understanding about the big picture. Now is time to start fixing details, and I’ll be next week in the Zeitgeist hackfest to work on that.

By the way, with some patience and fixing few details, Zeitgeist and Tracker 0.7 can be installed in maemo5. Catching few events here and there, zeitgeist can grab some basic informacion, and somebody could write a Journal home-screen applet, like the call log, but about all kind of activities/documents… Quite an interesting project.

Travel sponsored by GNOME FoundationBack in Helsinki after attending last week, sponsored by GNOME Foundation, to the Encuentro Linux 2009 in Valparaiso, Chile. My original plan was to talk about Tracker in the dedicated GNOME Day; but from the very first day it was clear that the people was very curious about maemo5 and specially the n900, so i decided to talk more about this. I recognize that makes me feel very proud to show an N900 and hear a WOW and see amazed faces.

So, the first talk (in an informal event between organizers and speakers) was about the N900 and some Q&A about it and maemo5. The people were mainly linux enthusiast, so lots of good questions about how to develop on it and the technology involved.

The first of the official talks (during the GNOME day) was about maemo5, what is it, relation with the desktop and how to contribute. I explained also one of the coolest things in maemo (IMHO): all the extras-devel/extras-testing/extras process. Your pet-application (or not so pet when you spend hours and hours on it) can easily reach a lot of users in few clicks. Well, few clicks on your side, and few more on the community side.

The second and last talk was about Tracker. The usual introduction to the basic concepts, and a couple of demos. I was happy to show that using tracker you can get “The last blog post of the user who sent me this song”. Sounds like a lab example, but it mixes RSS, contacts, files and activity, and you can easily see a plugin in totem using this.

About the event itself, the audience was more on the university side of life and people using free software in their companies/work; so a lot of curiosity for new projects and general conversation about open source. There were some people looking for a place to contribute in GNOME; I gave them few hints how to do it via tracker (e.g. writing plugins to Eye of GNOME), so let see if we get fresh blood in the community.

Finally, i want to say thanks to the organizers there, from Encuentro Linux and GNOME Day. They made everything easy, treated me really great, showed me a little bit of Chile and made me feel really warmly welcome. Thanks, guys!

Back from GCDS

Back in Helsinki, after a week in Gran Canaria Desktop Summit. This year it was great, and i enjoyed it a lot probably because i am more involved in the community.

It was a pretty active week, starting with my talk on Sunday in the cross-desktop track (slides). I explained there what did we do in tracker 0.6 , and what do we plan for tracker 0.7. This can be interesting for maemo-fans, as far as tracker 0.6.9x is the version available in Fremantle, and 0.7 is in the roadmap for Harmattan.

During the week, i was talking with some of the Zeitgeist project people. In few words, Zeitgeist will monitor and store the activity of the user, analyze it and extract relations between documents, applications, tags, etc. (E.G. “every time i edit doc1, i read webpage2”). Tracker has already the information about documents and applications, so instead of building their own database, they can set the “relations” directly into it. Zeitgeist is one of the hype projects now in GNOME and i am very happy to see Tracker participating in such an ambitious idea. [Note for hackers: if the things work fine, be ready to write a maemo UI for it!]

Taking advantage of the Akademy-GUADEC co-location, we (tracker team) also had an informal meeting with Sebastian Trueg, from the Nepomuk-KDE project. We are sharing ontologies and we agreed on how to distribute them and organize the documentation. The idea is to have a shared-desktop-ontologies package for all desktops and platforms with the nepomuk core ontologies, allowing applications to install extensions.

And finally after some parties and more talk with developers, i had another presentation in the Spanish GUADEC, explaining again tracker (slides in spanish), but this time showing the tools, code and examples.

I expect to see some results (i.e. more information into tracker from different apps) sooner than later. Stay tuned!

Vacaciones (o algo así)

Al final no se como me arreglo que “los dias para descansar” acaban siendo mas estresantes que los de oficina.

Mañana vuelo a Madrid, estare por alli una semana y luego el sabado salto a canarias al desktop summit. Allí doy dos charlas, una el domingo en el track de cross-desktop (sobre tracker en ingles), y otra el jueves en el track de GNOME hispano (sobre… !sorpresa! tracker en español).

Totem playlist parser

Para implementar el soporte de playlist en tracker, me encuentré con dos opciones: escribir todos los extractores para los n-mil formatos de playlist que hay ahi fuera o usar alguna libreria que lo hiciese por mi.

La candidata evidente era totem-pl-parser, pero las dependencias metian miedo: libcamel (una lib de correo para leer listas?), liborbit… ¡y al final eran solo para parsear las fechas en los RSS o podcast!  (que no necesitamos en tracker).

Asi que para usar esa libreria en tracker y maemo, solo habia que hacer opcionales esas dependencias. Ya habia un bug abierto sobre esto y después de 3 intentos, el mantainer del programa aceptó mi parche y cerró el bug.

Sienta bien poner un granito de arena para todos en general resolviendo un problema particular.


Cuando después de horas y horas y horas, las cosas empiezan a funcionar. Hoy tracker-search-tool vuelve a mostrar resultados, y tracker-indexer indexa el contenido de los ficheros de texto y tiene en cuenta las stop words. Cada cosa fueron 10 lineas de codigo, pero que satisfacción!

En los últimos meses hemos reescrito (como quien dice) casi todo tracker en una rama del svn (indexer-split). Ahora queremos que pase a ser la versión principal de tracker (en trunk, en el svn) pero claro, para eso tiene que funcionar todo lo que funcionaba antes. Ya estamos cerca.