By Vishesh Handa - 21 March 2013Nepomuk - Simplifying the debugging process
When something goes wrong in Nepomuk, its easy for us Nepomuk developers to track it down, but for other developers and users it can be quite hard. Even simple things like reporting which component is malfunctioning isn’t completely obvious.
Over the last month, we have simplified some of the external details and added tools which will help us debug your problems so that we can fix things more easily. These all will be shipped with nepomuk-core in 4.11Nepomuk2::Service2
Nepomuk, like most modular architectures, has a number of different plugins or as we like to call them “services”. Traditionally each service would be installed as a library that would be loaded by the nepomukservicestub process. When most users would try to provide debugging information they mostly just provide the process name - nepomukservicestub. This doesn’t tell us much, since all the heavy lifting is done by the nepomuk services. The client libraries are mostly just light wrappers.With the 4.10 release we have 3 major services
File Watch Service
File Indexing Service
Each can be started by calling the nepomukservicestub along with the service name. Eg - nepomukservicestub nepomukfilewatch.
Currently in master, we have moved away from this approach and each service now installs its own process. So you should no longer see any nepomukservicestubs. Instead you’ll see a nepomukstorage, nepomukfilewatch and nepomukfileindexer process.
This greatly simplifies the debugging process as the users can easily report which process is problematic, and starting a service is just a matter of running the correct executable.Tools
Restarting Nepomuk and looking into the database has traditionally required some dbus commands. These commands were always apparent to us developers, but it’s good to have some standard ways of managing Nepomuk.NepomukCtl
Thanks to Gabriel, we now have nepomukctl
which acts very similar to the akonadictl
. It can be easily used to start, stop and restart Nepomuk
or any individual service.$ nepomukctl start
$ nepomukctl restart
$ nepomukctl restart fileindexer
This is a great tool to check if Nepomuk is actually running.Nepomuk Show
In order to view the data inside the Nepomuk database one typically needs to issue a query. This requires the developers to know SPARQL. Typically users do not want to go into so much effort when they are debugging simple stuff.
can be used to easily view the resource information.
$ nepomukshow Politik.mp3
<nepomuk:/res/94e816c8-2466-4172-9bcd-0b9129cd17f8> rdf:type nmm:MusicPiece rdf:type nfo:FileDataObject rdf:type nfo:Audio rdf:type nie:InformationElement nao:created 2013-03-21T18:06:54Z nao:lastModified 2013-03-21T18:06:57Z nie:url file:///home/vishesh/Music/Coldplay/Politik.mp3 nie:mimeType audio/mpeg nie:title Politik nie:lastModified 2009-08-20T11:58:04Z nie:contentCreated 2002-03-21T18:06:54Z nie:created 2011-11-21T15:32:52Z nfo:averageBitrate 1.2800000000e+05 nfo:sampleRate 4.4100000000e+04 nfo:fileSize 5088374 nfo:fileName Politik.mp3 nfo:channels 2 nfo:duration 318 nmm:performer nepomuk:/res/8ffe10cc-c375-485f-
This is a great tool to use to see what all information has been indexed about a file or if a file has been indexed at all. It can even be used to check if an email has been indexed, though the syntax is a little different.
$ nepomukshow 'akonadi:?item=39618'
nmo:messageSubject Re: proposals marked as to be accepted in Melange now
Most developers already know of nepomukcmd which was an alias on top of sopranocmd. It could be used to query Nepomuk and contained many more soprano specific features which are now no longer applicable.
We are now shipping our own nepomukcmd tool, which currently only supports sparql queries. It does however support a neat --inference option which can be used to selectively enable and disable inferencing.
These tools right now are in a very early, simple but working state and could use some polishing, and extra features in the future. Contributing to these would be a great way to get involved in Nepomuk. Message me for more details.http://vhanda.in/blog/2013/03/nepomuk-simplifying-the-debug-process/