[Nepomuk] syncing nepomuk <-> exif metadata: recent changes, storage service hooks?

Vishesh Handa me at vhanda.in
Thu Dec 6 08:19:35 UTC 2012


On Wed, Dec 5, 2012 at 8:47 PM, Kristian Rink <kr at zimmer428.net> wrote:

> Folks;
>

Hey Kristian


>
> am about to play with PyKDE4/Nepomuk bindings and pyexiv2, trying to come
> up
> with some script to take image metadata (mostly keywords and comments)
> stored
> in Nepomuk and write this back to the image headers (EXIF, IPTC, XMP, ...)
> in
> case the file in question does support that. It generally works and doesn't
> seem rocket science as Nepomuk API seems rather straightforward about that,
> leaving figuring out which images should be treated like that as the only
> real
> problem, as running such a script across a larger digital photography
> collection doesn't seem a good idea.
>
> Two approaches I had in mind:
>
> (a) check Nepomuk service to get a list of image resources which have
> recently
> (since last checked?) seen a metadata update,  or
>
> (b) hook some handler / extension into Nepomuk Storage Service to
> automatically do this sync whenever some kind of image resource is being
> updated.
>

Right, the fundamental difference between the two approaches in polling vs
reacting to changes. (b) can easily be done with the ResourceWatcher, which
was introduced in KDE 4.9. It is part of the nepomuk-core package.

We have a gsoc project in 2011 called Metadata writeback. The main aim was
to write plugins which would register the rdf:type, they were interested
in, and the service, using the resource watcher would inform them when they
should write-back the changes for that particular file. It is still in a
branch, and should be merged. It requires some polishing, but nothing that
should take too long.

So to ask: Is any of these approaches doable with Nepomuk? Is there some way
> to query for (file) resources that have seen a metadata update, say, in the
> last n hours? Is there some way to add extensions to Nepomuk services to
> trigger external actions whenever some resource of some sort is about to be
> updated, preferrably using PyKDE4?
>

The problematic part is using "PyKDE4". As far as I know python bindings
for nepomuk-core still have not been generated. I'll write an email to the
binding folk after this reminding them.

If you don't want to wait for a proper solution, you can write a simple app
using the ResourceWatcher. The only slightly problematic part is that once
the resource is changed, and you writeback to the file, the file indexer
will pick it up again, and this will lead to an infinite cycle. We will
need some way to inform the file indexer to temporary ignore change to this
file.

I can add a dbus call for that, if you want.


>
> Thanks in advance and all the best,
> Kristian
> _______________________________________________
> Nepomuk mailing list
> Nepomuk at kde.org
> https://mail.kde.org/mailman/listinfo/nepomuk
>



-- 
Vishesh Handa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20121206/81a96b50/attachment.html>


More information about the Nepomuk mailing list