Re: [Tracker] Notification and ontology questions


On Tue, Mar 9, 2010 at 11:36 AM, Martyn Russell <martyn lanedo com> wrote:
On 09/03/10 04:10, Spivak, Max wrote:
Hi folks,


A few notification and custom ontology questions

Notification questions:
- Does libtracker-client support receiving
org.freedesktop.Tracker1.Resources.Class signals? It doesn't appear to

Good question, according to our online documentation it does work for classes. You can see which classes using:

 tracker-sparql -q "select ?c where { ?c a rdfs:Class . ?c tracker:notify true }"

I don't think this applies to properties.

libtracker-client is a very thin wrapper to the tracker API, hiding away mostly the dbus connection and doesn't have any helper to connect to signals. I guess we could implement a method like tracker_client_connect_signal (classname, add|remove|change, callback) to make the life of application developers easier.

-- is there a plan for this in the future? (Does anyone have any sample
glib-dbus signal listening code?)

We know we need a higher level abstraction library for tracker, but no concrete plans on it at the moment. John Carr did some very interesting work about it in python some time ago and wrote a report in the mailing list: gnome org/msg05348.html

Maybe this could be a good idea for a GSOC (Google summer of code) project.

- I need to define custom ontology that describes books, periodicals,
etc. While some of the data is fairly generic, other is sufficiently
specific to our projects that it wouldn't make sense to push it outside
of our use. What's the best way to do that? Do I add my own file,
something like <tracker>/data/ontologies/95_book.ontology?

Yes, you can do that. If you are packaging your own version of Tracker. Otherwise, you can add it to the $prefix/share/tracker/ontologies/ location where they get installed and a reindex should work here. I would advise you test your ontology thoroughly and check the logs for any errors/warnings. The ontology defines the database schema and it is easy to create problems for yourself here.

You have also a small tool under utils/services called "ontology-validator" that can help you to detect some usual mistakes in the ontologies. It is not a complete/heavy validation but can save you some time.

If your ontology (or a part of it) is interesting for general purpouse, please send us a patch and we can include it in the default set. It is good for everybody (more coverage in the ontology) and you get some review and the documentation in for free :)

- Is there a way to define or extend ontology at runtime?

Not exactly. We recently added some level of support here but it is not meant to be used for 3rd parties yet. That needs a bit more work. Philip also did the work here.

We did plan to do this before 0.8 IIRC, but I don't know if it will get done now since we want to release before the end of this month.

At the moment there is a very limited ontology extension support at runtime. Basically you can add classes and properties, but not remove or modify. The problem is far from trivial, and we plan to work on it eventually (after 0.8). Input help here, as usual, is welcome.



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