The method Laura described is the correct one as of now. Though, we would prefer it if you didn&#39;t use it. The reason is that you get notified for all the statements that have been added/removed - and those can be quite a lot.<div>
<br></div><div>Especially if files or emails are being indexed. That causes the entire system to slow down. I had to monitor everything for Nepomuk synchronization, and it caused Nepomuk to slow down so much that in 4.6 RC1, I finally had to disable it!</div>
<div><br></div><div>We are working on a better way for you to watch changes in the Nepomuk Repository. The current API that I have planned is something like this -</div><div><br></div><div>ResourceWatcher * watcher = SomeObject-&gt;watchType( Nepomuk::Vocabulary::NAO::Tag() );</div>
<div><br></div><div>watcher would have its own statementAdded() and statementRemoved() signals which would only give you those statements. I was even thinking of watching by property.</div><div><br></div><div>Would this solve your use case? Any comments on the API? None of this has been implemented so feel free to comment - we can change anything at this point.</div>
<div><br></div><div><br><div class="gmail_quote">On Fri, Feb 18, 2011 at 5:25 PM, Laura Dragan <span dir="ltr">&lt;<a href="mailto:aprilush@gmail.com">aprilush@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Thursday 17 February 2011 16:32:45 Christian Mollekopf wrote:<br>
&gt; Hey Laura,<br>
&gt;<br>
&gt; On Thursday 17 February 2011 14:10:58 Laura Dragan wrote:<br>
&gt; &gt; Hi Chris,<br>
&gt; &gt;<br>
&gt; &gt; On Thursday 17 February 2011 01:14:02 Christian Mollekopf wrote:<br>
&gt; &gt; &gt; hi,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Does anybody know how I can detect when a new Tag was added/removed<br>
&gt; &gt; &gt; to/from Nepomuk? I.e. to update a Tag Cloud.<br>
&gt; &gt;<br>
&gt; &gt; do you need to update the tag cloud if any resource is tagged outside your<br>
&gt; &gt; app, or just inside your app?<br>
&gt; &gt;<br>
&gt; I&#39;d like to update it whenever new tags are available, not only from within my<br>
&gt; app.<br>
&gt;<br>
&gt; &gt; In SemNotes for instance the tag cloud is built only with the tags used on<br>
&gt; &gt; the notes - you can find that code on gitorious.<br>
&gt; &gt;<br>
&gt; &gt; A long time ago I wrote a plasmoid that built the tagcloud for the entire<br>
&gt; &gt; desktop (not sure if it&#39;s in playground or not), and that one was<br>
&gt; &gt; listening to statementsAdded and statementsRemoved from the model, but I<br>
&gt; &gt; took the easy path and rebuilt the cloud every time instead of just<br>
&gt; &gt; updating it. It worked ok with up to 30 tags, without visible delays from<br>
&gt; &gt; all the repository querying.<br>
&gt; &gt;<br>
&gt; &gt; &gt; Currently I listen to the statementAdded/statementRemoved signals of the<br>
&gt; &gt; &gt; Soprano::Model, and I can also detect if an Item gets a new Tag, but I<br>
&gt; &gt; &gt; don&#39;t know how I can see from the Statement when a new Tag was created<br>
&gt; &gt; &gt; or a Tag was deleted.<br>
&gt; &gt;<br>
&gt; &gt; I think you can use the signals<br>
&gt; &gt;<br>
&gt; &gt; void statementAdded( const Soprano::Statement &amp;statement)<br>
&gt; &gt; void statementRemoved( const Soprano::Statement &amp;statement)<br>
&gt; &gt;<br>
&gt; &gt; to look into the statements that are affected with the functions:<br>
&gt; &gt; subject(), predicate() and object().<br>
&gt; &gt;<br>
&gt; Thats what I&#39;m trying to do, but I don&#39;t get what indicates that a tag is new<br>
&gt; to the Nepomuk system (or that a tag was removed).<br>
<br>
</div></div>I&#39;d do that by checking if the statement added or removed has the predicate &quot;rdf:type&quot; and the object &quot;nao:Tag&quot;. The subject of the statement is then the uri of the tag that was created or deleted.<br>

<font color="#888888"><br>
Laura<br>
</font><div><div></div><div class="h5"><br>
&gt;<br>
&gt; Thanks for your help,<br>
&gt;<br>
&gt; Chris<br>
&gt; &gt;<br>
&gt; &gt; Hope this helps<br>
&gt; &gt; Laura<br>
&gt; &gt;<br>
&gt; &gt; &gt; Cheers,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Chris<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; Nepomuk mailing list<br>
&gt; &gt; &gt; <a href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a><br>
&gt; &gt; &gt; <a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Nepomuk mailing list<br>
&gt; &gt; <a href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a><br>
&gt; &gt; <a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
&gt; _______________________________________________<br>
&gt; Nepomuk mailing list<br>
&gt; <a href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a><br>
&gt; <a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
&gt;<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><font color="#999999">Vishesh Handa</font><br>
</div>