Posts Tagged ‘Hacking’

What We Talk About When We Talk About Zeitgeist

Monday, November 16th, 2009

There is a tangible confusion around as to what Zeitgeist is and what it isn’t; what it can do and what it can’t do. This is partly our own fault because we could have communicated this whole thing better, for instance we have some very outdated wiki pages lying around that you should probably stay away from until we updated them. In this post I aim to give a semi technical run down of the core Zeitgeist functionality and how we expose it for you to work with. This should hopefully clear out some confusion.

Events

The Zeitgeist daemon (also known as the engine) is a process that exposes an event logging framework as a DBus API. The structure of these events is that they have a block of metadata that describe the event itself (this is known simply as the event metadata) and another block of metadata that describes the subject, or subjects, that this event happened to (this part is known as the subject metadata). The metadata for the event looks like:

  • Timestamp – When did this happen. Milliseconds since the Unix Epoch. Note that we see events as single points in time, meaning that events don’t have a duration
  • Interpretation – Abstract interpretation of this event; what happened. Fx. “opened”, “saved”, “closed”, “send”, etc.
  • Manifestation – How the event happened. Fx. “user activity”, “notification”, or “scheduled activity”.
  • Actor – Who triggered it. This will typically point to the .desktop file of the acting application. It will most likely be an application, but it is not required to be so.
  • Payload – A free-form binary blob that you may attach to the event. This is specifically application specific and mainly intended to be a “back door” for people to do all sorts of funky hacks.

Each event has one or more subjects associated. For each subject we store:

  • URI – You guessed it! The URI of the subject
  • Interpretation – Abstract interpretation of the subject. This could be “Document”, “Image”, “Video”, “Email”, “Instant message”, “Contact”, anything.
  • Manifestation – How the subject is stored. This could be something like “File”, “Mailbox”, “Web page”.
  • Origin – A URI pointing to the origin or “patron” of the subject. For files this would be the parent folder. For YouTube videos it would be http://youtube.com
  • Mimetype – The format of the datastream representing the subject. Fx. text/plain, application/xml.
  • Text – Textual information added to the subject. This is not applicable for for types of subjects.
  • Storage – Identifier for the storage medium this subject resides on. We use this to make it possible for queries that return only events for subjects that are “available now”. Fx. some clients don’t want to show events for files that are stored on you USB pen drive when it is not connected.

Ontology – Or Data Description

In reality the metadata fields we store don’t contain simple strings like “Document” for the subject interpretation. It’s a bit more complex than that – sorry! We store a URI pointing to a formal definition of something categorized as a Document. This formal categorization is called an ontology if you want a word to confuse your friends with. We are fortunate enough that someone already wrote such a spec, namely the Nepomuk Ontology. So instead of just “Document” we store the string”http://www.semanticdesktop.org/ontologies/2007/03/22/nfo/#Document“.

Since Tracker also uses the Nepomuk ontologies you may take these formal classification strings and plug them directly into Tracker to find everything that Tracker considers a document.

We will also have an ontology for the event metadata as this is not covered by Nepomuk. We are actively working on this.

Getting Data Out – Querying the Event Log

We employ a template based query API for searching our log data. You send us a list of event templates you want to look for and how you want it sorted and we give you the results. So if you want to find all “open” events on subjects of type “Document” simply create an Event object, set the interpretaion to “open”-event and add a subject to the event template with the interpretation set to “document”. All other fields should be left blank. Send this template to us and we will give you the matches.

The list of event templates is collected into a big OR-query to imbue the consumers with more power.

Getting Data Into Zeitgeist

There are really no limits to what kind of events we could store. If you have a spare mobile with a in-built accelerometer and glue it to your front door then you could send an event over bluetooth to your desktop each time your front door opens. Probably there are better use cases?

The point is that the usefulness of Zeitgeist stands and falls with the events that you push into us. We can store anything that you can model using the structures I outlined above. I am pretty certain that people will not agree on the kinds of data they want logged, but we are ready for anything :-)

Normal users would of course not need to think about getting their data into Zeitgeist. What developers need to know is that we have a simple DBus API to insert events (surprisingly called InsertEvents). It is called InsertEvents and not AppendEvents or something like that for a reason. Namely that you are allowed to insert events that are in the past. This is useful if you want to import your Firefox history or what ever. If you try to log an event twice the engine will throw an error at you, so no need to worry about dupes.

Ok. I think that about wraps up what I intended to say for now. Hope it’s useful to at least one person out there! :-)

All My Bags Are Packed, I’m Ready to Go

Saturday, November 7th, 2009

I’ve prepped up for the upcoming Zeitgeist hackfest in Bolzano, bags packed, laptop charged, and kissed the kids goodnight and extra time. I have to get up at 3.40 this night in order to catch my plane.

It’s going to be great to catch up with the other developers and finally meet them face to face. It’s always an odd feeling meeting people in real life for the first time when you talked so much with them on various online mediums.

My personal aim for the hackfest is to do a lot of coding and really push Zeitgeist closer to production readiness. We done a lot of drafting and discussion lately, so we are really set to get the actual coding done now. I have a lot of travelling time before I get there so I expect to get a head start on the hacking :-)

Huge props to the sponsors and organizers!

Xesam GLib 0.4.1

Monday, August 11th, 2008

Boring new release of Xesam GLib. NEWS:

 * Fix a bug in the UserSearchParser where search where a family of strings

mixing selectors and boolean operations caused parser errors (Kamstrup) * Fix a memory leak in the UserSearchParser, when internally resetting

the parser. (Kamstrup)

Download:xesam-glib-0.4.1.tar.gz

API docs: the usual place

Forget About the Darn Ol’ Pony!

Saturday, July 5th, 2008

I swear my wife did not read my whineful-pony-post from last night, but today she gave me my birthday present a few days early:

This baby can drive in dirt, water (sailing), and snow. Screw you guys and GUADEC. Who wants to hack anyway. I’m out!

Who wants a friggen pony anyway. I hope the kids wont get too jealous… *wroooom*

Secrecy. Bwahaha!

Thursday, June 26th, 2008

Ok. I admit it. I have been updating my PGO-feed far too many times in the hope that Vincent or Lucas posted some news about their mysterious Gnome3-document (or maybe I am not allowed to say Gnome 3?).

So to avenge this I’ll do a bit of secrecy and foggy clue dropping myself…

I am indeed working on something big. I am not gonna tell you what it is. And in fact if the stars align in a certain way you will never have to hear about it. So, to the foggy clues

  • It is way cool
  • Crazy cool features
  • Involves a lot of coding that I have very little spare time to do
  • Does not involve any “rewrite from scratch” of anything (yet)
  • Very long term goal
  • Announced at the very earliest in 6 months, probably later, if ever
  • A yellow submarine stranded on an empty beach
  • Gnome-related
  • Cases upon cases of beer
  • You may be able to gather enough information around the dusty corners of the web to figure out what I am up to. At least if you have crazy Matrix-like skills and a lot of spare time
  • The gauntlet have been thrown, and I’ve picked it up
  • Charged by a hither to unknown combination of a micro wave oven and baby formula
  • Will involve some cool patches targeting upstream libs
  • Profit! Insane profit!
  • Xesam is part of the greater puzzle

(I had to drop a few red herrings in there to make it trickier for all you wise-guys)