Hey Sebastian.<br><br><div class="gmail_quote">On Tue, May 18, 2010 at 3:19 PM, Sebastian Trüg <span dir="ltr">&lt;<a href="mailto:trueg@kde.org">trueg@kde.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Vishesh,<br>
<br>
the minor patch is of course no problem.<br>
<br>
So I understand correctly: the issue is that the same url is returned<br>
twice, once for the correct resource and once for another one.<br>
And you are sure this does not happen if you cache the results?<br>
<br></blockquote><div> It works fine if I cache the results. I checked!  <br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Also be aware that the number of results can be very high. Thus, caching<br>
them all at once might not be a good idea. We would have to do it in<br>
batches.<br>
<br></blockquote><div> How do I cache some of them? Should I perform the query with a limit multiple times?<br></div><div><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

However, normally Virtuoso should not no problem with performing changes<br>
while iterating results.<br></blockquote><div><br>I know, but this has been happening to me for some time now. I actually run the same query twice, once just normally printing the results, and once running it through the updateMetadata loop. The results aren&#39;t the same. This is probably because of the modifications being made.<br>
<br>A simple way to check if this is happening on your system is to perform a sparql query &quot;select ?url where { ?r nie:url ?url. FILTER(regex(str(?url), &#39;foo&#39;) . }&quot; and then rename the folder &quot;foo&quot; and perform the query again to see if some of files haven&#39;t been transfered. Do it on a folder which has at least 20+ files. On my system it&#39;s usually the 19th or 20th file that is skipped.  <br>
<br>- Vishesh Handa<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Cheers,<br>
Sebastian<br>
<div><div></div><div class="h5"><br>
On 05/14/2010 03:12 PM, Vishesh Handa wrote:<br>
&gt; If you rename a folder with loads of data (it should have metadata), the<br>
&gt; MetadataMover::updateMetadata function would sometimes skip a resource<br>
&gt; or two. This doesn&#39;t always happen. Just occasionally. Look at the output -<br>
&gt;<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata: r -&gt; * QUrl(<br>
&gt; &quot;nepomuk:/res/0887efd7-b6ab-4acf-8f0a-74ed7106c6ed&quot; )*<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata: url -&gt;<br>
&gt; *KUrl(&quot;file:///home/vishesh/Index_LOO/Phonemusic/19.mp3&quot;)*<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata:<br>
&gt; KUrl(&quot;file:///home/vishesh/Index_LOO/Phonemusic/19.mp3&quot;) -&gt;<br>
&gt; KUrl(&quot;file:///home/vishesh/Index_L/Phonemusic/19.mp3&quot;)<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata: Old Resource Exists<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata: r -&gt;  *QUrl(<br>
&gt; &quot;nepomuk:/res/b9f11a5b-cbe3-4797-9fe0-0f293a215a9e&quot; )*<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata: url -&gt;<br>
&gt; *KUrl(&quot;file:///home/vishesh/Index_LOO/Phonemusic/19.mp3&quot;)*<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata:<br>
&gt; KUrl(&quot;file:///home/vishesh/Index_LOO/Phonemusic/19.mp3&quot;) -&gt;<br>
&gt; KUrl(&quot;file:///home/vishesh/Index_L/Phonemusic/19.mp3&quot;)<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata: Old Resource Exists<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata: r -&gt;  QUrl(<br>
&gt; &quot;nepomuk:/res/38616b7c-9540-46de-aa5c-e12971cac64d&quot; )<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata: url -&gt;<br>
&gt; KUrl(&quot;file:///home/vishesh/Index_LOO/Phonemusic/22.mp3&quot;)<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata:<br>
&gt; KUrl(&quot;file:///home/vishesh/Index_LOO/Phonemusic/22.mp3&quot;) -&gt;<br>
&gt; KUrl(&quot;file:///home/vishesh/Index_L/Phonemusic/22.mp3&quot;)<br>
&gt; nepomukfilewatch(10425)/nepomuk (filewatch service)<br>
&gt; Nepomuk::MetadataMover::updateMetadata: Old Resource Exists<br>
&gt;<br>
&gt; In the second case. The resource<br>
&gt; *nepomuk:/res/b9f11a5b-cbe3-4797-9fe0-0f293a215a9e *actaully has a<br>
&gt; nie:url of *file:///home/vishesh/Index_L/Phonemusic/20.mp3*. This was<br>
&gt; kinda difficult to track down, but the solution is fairly simple, and<br>
&gt; was mentioned in the Soprano::QueryResultIterator documentation.<br>
&gt;<br>
&gt; Many backends do lock the underlying Model during iteration. Thus,<br>
&gt; it is always a good idea to cache the results if they are to be used<br>
&gt; to modify the model to prevent a deadlock:<br>
&gt;<br>
&gt; I really should read the documentation more thoroughly.<br>
&gt; *<br>
&gt; Other things :*<br>
&gt;<br>
&gt; 1. The kinotify currently tracks hidden files as well. Why is that?<br>
&gt; Tracking hidden files means you track all kind of temporary files and<br>
&gt; are alerted when they are altered. It makes debugging a million times<br>
&gt; harder. It&#39;s just a matter of changing<br>
&gt; *KInotify::Private::watchHiddenFolders* to false. If you don&#39;t agree<br>
&gt; with me, then can we please make it configurable?<br>
&gt;<br>
&gt; 2. Minor optimization on *MetadataMover::updateMetadata* -&gt; Patch!<br>
&gt;<br>
&gt; - Vishesh Handa<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&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>
_______________________________________________<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>