concept of Task (as in "I have done one item from my todo list") in zeitgeist

Asked by Luca Invernizzi on 2010-06-07

Hello there,
I'm one of the "Getting Things GNOME!" developers, and I'm working on making GTG a data source for Zeitgeist. For that, I'm using the python API (which works just fine).

In particular, being GTG a TODO list manager, I'd like to add to Zeitgeist the tasks that have been marked as completed in GTG.
It seems easy so far, but I'm having a bit of trouble fitting the concept of "Task" in your categories.
This is what I came up with for defining such an event:

subject = Subject.new_for_values(
                uri="gtg://task1", #We don't have URIs for tasks
                text="my task title",
                interpretation=unicode(Interpretation.OPEN_EVENT), #or CLOSE_EVENT?
                manifestation=unicode(Manifestation.USER_ACTIVITY),
                origin="????", #No idea. GTG?
                mimetype="text/plain", #Again, no idea
            )
event = Event.new_for_values(
                timestamp=int(time.time()*1000),
                interpretation=unicode(Interpretation.OPEN_EVENT), #or CLOSE_EVENT, as before
                manifestation=unicode(Manifestation.USER_ACTIVITY),
                actor="application://gtg.desktop",
                subjects=[subject,]
            )

Any suggestions or ideas will be much appreciated. Thanks for reading.

Question information

Language:
English Edit question
Status:
Solved
For:
Zeitgeist Data-Sources Edit question
Assignee:
No assignee Edit question
Solved by:
Luca Invernizzi
Solved:
2010-06-27
Last query:
2010-06-27
Last reply:
2010-06-27
Launchpad Janitor (janitor) said : #1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Siegfried Gevatter (rainct) said : #2

Hi,

I'm sorry I didn't notice this question before.

Subject:

>> uri="gtg://task1", #We don't have URIs for tasks
Looks reasonable, as long as there is some way to start up GTG to show the details for "task1" (maybe by running "gtg gtg://task1"/"gtg task1", or whatever). GNOME Activity Journal could then get some hook to handle this.

>> interpretation=unicode(Interpretation.OPEN_EVENT), #or CLOSE_EVENT?
Note that interpretations and manifestations have changed in the latest release (0.4.0; http://zeitgeist-project.com/docs/0.4/datamodel.html). Also, there are are two sorts of interpretations and manifestations, one for events and one for subjects; for the subject those from http://www.semanticdesktop.org/ are the relevant ones. You probably want Interpretation.TODO.

>> manifestation=unicode(Manifestation.USER_ACTIVITY),
Same here, USER_ACTIVITY is an "event manifestation", not a "subject manifestation". Manifestation.CALENDAR_DATA_OBJECT looks like the best candidate here: "A DataObject found in a calendar. It is usually interpreted as one of the calendar entity types (e.g. Event, Journal, Todo etc.).".

>> origin="????", #No idea. GTG?
Just leave it empty.

>> mimetype="text/plain", #Again, no idea
No, just leave it empty.
Another option would be for GTG to export the task to a file in iCalendar (VTODO) format and have the "uri" pointing to it, this way both values would make more sense (and be usable by other apps); GNOME Activity Journal could still have a hook to prefer launching those events in GTG. Not sure if filling the disk with such files is the right way though :).

Event:

>> interpretation=unicode(Interpretation.OPEN_EVENT), #or CLOSE_EVENT, as before
I suppose CLOSE_EVENT (now LEAVE_EVENT) is what fits the best: "Event triggered by closing, leaving, or stopping a resource. Most zg:LeaveEvents will be following a zg:Access event, but this need not always be the case".

>> manifestation=unicode(Manifestation.USER_ACTIVITY),
Yup.

Thank you for your interest in using the Zeitgeist framework. Please let us know once you have something that's working (or if you need any more help)!

Luca Invernizzi (invernizzi) said : #3

That's great! I thing I'll have this ready in two or three weeks.