Hi!<div><br><div><div>As Sebastian suggested I tried the search API without my dirty hack and I finally learn how to use it. This is my first successful code:</div></div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

term = Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;música&quot;, &#39;UTF-8&#39;)))<br>query = Nepomuk.Query.Query(term)<br>[code #1]<br>query.addRequestProperty(Nepomuk.Query.Query.RequestProperty(Nepomuk.Types.Property(NEO(&#39;nie#url&#39;, True))))<br>

query.addRequestProperty(Nepomuk.Query.Query.RequestProperty(Nepomuk.Types.Property(NEO(&#39;nao#prefLabel&#39;, True))))<br>sparqlQuery = query.toSparqlQuery()<br>model = Nepomuk.ResourceManager.instance().mainModel()<br>

data = model.executeQuery(sparqlQuery, Soprano.Query.QueryLanguageSparql)<div>... &lt; code to display result set &gt; ...</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">[code #1]</div></blockquote>

<div><br></div><div>The query is slow but works and columns url and prefLabel are available. Great!</div><div><div>896 results found in 7.69615888596 seconds</div></div><div><br></div><div>I have a common query I used often when I&#39;m developing &quot;ha ji won kim sa rang&quot; because result set has one row (this is equivalent to write &quot;&#39;ha&#39; and &#39;ji&#39; and &#39;won&#39; and &#39;kim&#39; and &#39;sa&#39; and &#39;rang&#39;) and this is the result set with a query generated by my builder nsSparqlBuilder.</div>

<div><br></div><div>file:///media/HD1.5TB-01/video/corea/doramas/Secret Garden, [FileDataObject]<meta http-equiv="content-type" content="text/html; charset=utf-8"></div><div><div>1 results found in 1.21383500099 seconds.</div>

</div><div><br></div><div>So I wrote the next code to test the API expecting same results:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>andTerm = Nepomuk.Query.AndTerm()</div>

<div><div><div>andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;ha&quot;, &#39;UTF-8&#39;))))</div></div></div><div><div><div>andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;ji&quot;, &#39;UTF-8&#39;))))</div>

</div></div><div><div><div>andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;won&quot;, &#39;UTF-8&#39;))))</div></div></div><div><div><div>andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;kim&quot;, &#39;UTF-8&#39;))))</div>

</div></div><div><div><div>andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;sa&quot;, &#39;UTF-8&#39;))))</div></div></div><div><div><div>andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;rang&quot;, &#39;UTF-8&#39;))))</div>

</div></div><div><div><div>query = Nepomuk.Query.Query(andTerm)</div></div></div><div>[code #1]<meta http-equiv="content-type" content="text/html; charset=utf-8"></div><div><div><div><br></div></div></div></blockquote><div>

<div>and this is the result set I obtained:</div><div><br></div><div><div><div>(iODBC Error: [OpenLink][Virtuoso iODBC Driver][Virtuoso Server]SQ200: The memory pool size 400005656 reached the limit 400000000 bytes, try to increase the MaxMemPoolSize ini setting)&quot;</div>

<div>0 results found in 85.3466908932 seconds</div></div></div><div><br></div><div>Them I deleted two terms, the second and the five and there is no error but result set is the next one:</div><div><div><div>0 results found in 600.101149082 seconds</div>

</div></div><div><br></div><div>Finally I discover that generated API queries works with two terms and fails with more. For example, the next test is very slow but works:</div></div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div><div><div><div>andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;ha&quot;, &#39;UTF-8&#39;))))</div></div></div></div><div><div><div><div>andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;ji&quot;, &#39;UTF-8&#39;))))</div>

</div></div></div></blockquote><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><div></div></div></div><div><br></div><div><div><div>nepomuk:/res/c894d8fa-cb6a-4ab3-ab26-37a6abbe206e, , ha ji won</div>

<div>nepomuk:/res/c0642c10-6501-448c-a8ed-4992f45c232e, file:///media/HD1.5TB-01/video/corea/doramas/Secret Garden, </div><div>2 results found in 25.7656869888 seconds</div></div></div><div><br></div><div>but the next one not:</div>

<div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">

<div><div><div><div>andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;ha&quot;, &#39;UTF-8&#39;))))</div></div></div></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;ji&quot;, &#39;UTF-8&#39;))))</div>

<div><div><div><div>andTerm.addSubTerm(Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;won&quot;, &#39;UTF-8&#39;))))</div></div></div></div></blockquote><div><div><div></div></div></div></div><div><br></div>

<div>and result is:</div><div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div><div>

local socket error: QLocalSocket::SocketTimeoutError </div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div>

<div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div>

<div>0 results found in 1201.46248913 seconds</div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div><div>&quot;&quot; Soprano: &quot;Command timed out.&quot;</div></div><div><br></div><div><div>In documentation there is no limit to the number of terms you can add and even there is a constructor where you can add 6 terms. I tried it but results are the same, the first term works but the second one not. </div>

<div><br></div><div><div>        term = Nepomuk.Query.AndTerm( \</div><div>            Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;ha&quot;, &#39;UTF-8&#39;))), \</div><div>            Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;ji&quot;, &#39;UTF-8&#39;))), \</div>

<div>            Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;won&quot;, &#39;UTF-8&#39;))) \</div><div>            )</div><div><br></div><div>        term = Nepomuk.Query.AndTerm( \</div><div>            Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;ha&quot;, &#39;UTF-8&#39;))), \</div>

<div>            Nepomuk.Query.LiteralTerm(Soprano.LiteralValue(unicode(&quot;won&quot;, &#39;UTF-8&#39;))) \</div><div>            )</div></div><div><br></div><div>On the other side using API if external hard drive is not mounted result sets are empty. This behavior can be disabled?</div>

<div><br></div><div>I only tried AndTerm but tomorrow I will try OrTerm if I have free time.</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br>-- <br>Cheers,<div>Ignacio</div><div><br></div>

<br>
</div></div></div>