I have a method named toN3 with next code:<div><br></div><div><div><b><font face="courier new, monospace">def toN3(url = ''):</font></b></div><div><b><font face="courier new, monospace"> if url[0] == '^':</font></b></div>
<div><b><font face="courier new, monospace"> result = '^' + QUrl(url[1:]).toEncoded()</font></b></div><div><b><font face="courier new, monospace"><br></font></b></div><div><b><font face="courier new, monospace"> else:</font></b></div>
<div><b><font face="courier new, monospace"> result = QUrl(url).toEncoded()</font></b></div><div><b><font face="courier new, monospace"><br></font></b></div><div><b><font face="courier new, monospace"> return result</font></b></div>
<div><br></div><div>but is not working with "?" and the next change is required to query for files like "test?.txt"</div><div><br></div><div><div><font face="courier new, monospace"><b> return result.replace('?', '%3f')</b></font></div>
</div><div><br></div><div>Any other know exception?</div><div><br></div><div><br></div><div class="gmail_quote">On Wed, May 30, 2012 at 3:54 PM, Ignacio Serantes <span dir="ltr"><<a href="mailto:kde@aynoa.net" target="_blank">kde@aynoa.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Maybe there are other character with issues, like "?" or "+".<div class="HOEnZb"><div class="h5"><br>
<br><div class="gmail_quote">On Wed, May 30, 2012 at 2:55 PM, Sebastian Trüg <span dir="ltr"><<a href="mailto:sebastian@trueg.de" target="_blank">sebastian@trueg.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Indeed, the translation to filex URLs in queries is pretty dumb. It only<br>
looks for the file:// prefix and continues from there.<br>
<br>
However, query 3 should always work and I found the bug. The parenthesis<br>
get percent-encoded. :(<br>
I will try to fix that.<br>
<div><br>
On 05/24/2012 03:56 PM, Ignacio Serantes wrote:<br>
> Hi,<br>
><br>
> There is a bug handling filex files when there are parenthesis in the<br>
> url and you are doing a query using the fullpath.<br>
><br>
> This are steps to reproduce the bug.<br>
><br>
> 1) Create a file named "test_(fail).txt" in an external HD, I created<br>
> the file "/media/OneTouch4/test_(fail).txt".<br>
> 2) If the location is not indexed you must use nepomukindexer to index<br>
> the file.<br>
> 3) Open NepSak and execute next queries:<br>
><br>
> Query 1:<br>
><br>
</div>> *SELECT* *DISTINCT* *<br>
><br>
> *WHERE* {<br>
><br>
> ?uri nie:url ?url . *FILTER*(*REGEX*(?url,<br>
<div>> "test_\\(fail\\).txt"^^xsd:string, 'i'))<br>
><br>
> }<br>
><br>
><br>
> Query 2:<br>
><br>
</div>> *SELECT* *DISTINCT* *<br>
><br>
> *WHERE* {<br>
><br>
> ?uri nie:url ?url . *FILTER*(*REGEX*(?url,<br>
<div>> "/media/OneTouch4/test_\\(fail\\).txt"^^xsd:string, 'i'))<br>
><br>
> }<br>
><br>
><br>
> Query 3:<br>
><br>
</div>> *SELECT* *DISTINCT* *<br>
><br>
> *WHERE* {<br>
><br>
> ?uri nie:url ?url . *FILTER*(*REGEX*(?url,<br>
<div>> "file:///media/OneTouch4/test_\\(fail\\).txt"^^xsd:string, 'i'))<br>
><br>
> }<br>
><br>
><br>
</div>> *Notes:*<br>
<div>><br>
> 1) I'm using KDE 4.8.3, Soprano 2.7.5 and Virtuoso 6.1.5 openSUSE<br>
> official packages.<br>
><br>
><br>
</div>> *Results:*<br>
<div>> 1) Query 1 works but queries 2 and 3 don't.<br>
> 2) If url has not parenthesis, and is a filex file, queries 1 and 3<br>
> works but query 2 fails. So, seems like with filex files "file:///"<br>
> prefix is mandatory but with normal files don't. This is not a problem<br>
> when you know this behavior but could be a serious problem if you don't<br>
> know.<br>
> 3) If url is not a filex file all queries works.<br>
><br>
> --<br>
> Best wishes,<br>
> Ignacio<br>
><br>
><br>
><br>
><br>
</div>> _______________________________________________<br>
> Nepomuk mailing list<br>
> <a href="mailto:Nepomuk@kde.org" target="_blank">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>
_______________________________________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org" target="_blank">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"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>Best wishes,<div>Ignacio</div><div><br></div><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best wishes,<div>Ignacio</div><div><br></div><br>
</div>