<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 5, 2012 at 8:47 PM, Kristian Rink <span dir="ltr"><<a href="mailto:kr@zimmer428.net" target="_blank">kr@zimmer428.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Folks;<br></blockquote><div><br>Hey Kristian<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
am about to play with PyKDE4/Nepomuk bindings and pyexiv2, trying to come up<br>
with some script to take image metadata (mostly keywords and comments) stored<br>
in Nepomuk and write this back to the image headers (EXIF, IPTC, XMP, ...) in<br>
case the file in question does support that. It generally works and doesn't<br>
seem rocket science as Nepomuk API seems rather straightforward about that,<br>
leaving figuring out which images should be treated like that as the only real<br>
problem, as running such a script across a larger digital photography<br>
collection doesn't seem a good idea.<br>
<br>
Two approaches I had in mind:<br>
<br>
(a) check Nepomuk service to get a list of image resources which have recently<br>
(since last checked?) seen a metadata update,  or<br>
<br>
(b) hook some handler / extension into Nepomuk Storage Service to<br>
automatically do this sync whenever some kind of image resource is being<br>
updated.<br></blockquote><div><br>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.<br>
<br>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.<br>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So to ask: Is any of these approaches doable with Nepomuk? Is there some way<br>
to query for (file) resources that have seen a metadata update, say, in the<br>
last n hours? Is there some way to add extensions to Nepomuk services to<br>
trigger external actions whenever some resource of some sort is about to be<br>
updated, preferrably using PyKDE4?<br></blockquote><div><br>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.<br>
<br>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.<br>
<br>I can add a dbus call for that, if you want.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks in advance and all the best,<br>
Kristian<br>
_______________________________________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><span style="color:rgb(192,192,192)">Vishesh Handa</span><br><br>
</div>