<div class="gmail_quote">On Tue, Mar 1, 2011 at 9:17 AM, Sebastian Trüg <span dir="ltr">&lt;<a href="mailto:trueg@kde.org" target="_blank">trueg@kde.org</a>&gt;</span> wrote:</div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>&gt; query = Nepomuk.Query.Query(term)</div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
&gt; sparqlQuery = query.toSparqlQuery().replace(&#39;distinct ?r&#39;, &#39;distinct ?r<br>
&gt; ?r*&gt;nie:url AS ?url ?r*&gt;nao:prefLabel AS ?prefLabel&#39;)<br>
<br>
</div>oh no, please don&#39;t!<br>
If you want additional variables use Query::addRequestProperty or<br>
ComparisonTerm::setVariableName.<br></blockquote><div><br></div><div>This is the method I looking for but I don&#39;t found it, thank you :). If I have time this night I will do a try.</div>

<span style="color:rgb(83, 83, 83);font-family:&#39;Bitstream Vera Sans&#39;, &#39;Lucida Grande&#39;, &#39;Trebuchet MS&#39;, sans-serif;font-size:11px"><table style="border-collapse:collapse;font-size:1em">
<tbody><tr><td colspan="2"></td></tr></tbody></table></span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>&gt; function and the columns problem was solved with a simple replace, in<br>
&gt; previous example I added columns ?url and ?prefLabel. I&#39;m not sure if I<br>
&gt; missed something an there is other method to do this stuff.<br>
<br>
</div>Replacing like that is ugly ugly hacking. You either use the approaches<br>
I mention above or you use Nepomuk::Resource which you get from the<br>
Nepomuk::Query::Result::resource().<br></blockquote><div><br></div><div>For sure that is an ugly one ;).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




The reason that it is a bit slower are additional tests that are done.<br>
Your query will also return &quot;hidden&quot; resources like ontololy properties<br>
and classes.<br></blockquote><div><br></div><div>Well yes, a &quot;bit&quot; :), I see API generated queries and I need to study them to learn because my approach is not the same yours. I need to improve my queries because I have a barely knowledge about how data is stored and this is bad, know things like nao#userVisible are mandatory. I look for a document about Nepomuk db structure but I don&#39;t found it. Is there one?. Db has stored procedures that can be used?</div>


<div><br></div><div>My primal goal was, with the sources of data I&#39;m using: custom data, strigi and bangarang, obtain accurate result sets in a weekend or reinstall KDE 4.5, so I was not worried about doing things well or fast. This goal is achieved so I must look for new goals, like doing things well and fast.</div>




<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is another reason to stick with the query API. If performance could<br>
be improved it should be done in the query API instead of rewriting<br>
something new. That way all applications can benefit from the optimizations.<br></blockquote><div><br></div><div>There is no discussion about this, any query improvement must be added to API obviously. Are you using  a specific db to test?. Use the same data will be a great help to writing test cases, compare result sets, performances and found methods to optimize queries.</div>




<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
BTW: which version of KDE are you using here?<br></blockquote><div><br></div><div>openSUSE with Upstream release aka. KR46 (KDE SC 4.6) packages, but three weeks ago I was using KDE 4.5 Upstream version.</div><div><br></div>




<div><a href="http://en.opensuse.org/KDE_repositories#Upstream_release_aka._KR46_.28KDE_SC_4.6.29" target="_blank">http://en.opensuse.org/KDE_repositories#Upstream_release_aka._KR46_.28KDE_SC_4.6.29</a></div>
<div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br>
Cheers,<br>
Sebastian<br>
_______________________________________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org" target="_blank">Nepomuk@kde.org</a><br>
</div><div><div></div><div><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>Cheers,<div>Ignacio</div><div><br></div><br>