<br><br><div class="gmail_quote">On Sat, May 5, 2012 at 3:22 PM, Christian Mollekopf <span dir="ltr"><<a href="mailto:chrigi_1@fastmail.fm" target="_blank">chrigi_1@fastmail.fm</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey,<br>
I'm trying to write a little helper application to check the status of the<br>
akonadi indexing, but ran into a problem:<br>
<br>
If I'm running this query:<br>
<br>
Soprano::QueryResultIterator result = Nepomuk::ResourceManager::instance()-<br>
>mainModel()->executeQuery(QString::fromLatin1("select ?compatLevel where { ?r<br>
nie:url <akonadi:?item=191> . ?r aneo:akonadiIndexCompatLevel ?compatLevel .<br>
}"), Soprano::Query::QueryLanguageSparql);<br>
<br>
I get back a binding for compatLevel, but the node is always empty<br>
(result.binding(0).isEmpty() == true).<br></blockquote><div><br> QString query("select ?compatLevel where { ?r aneo:akonadiIndexCompatLevel ?compatLevel .}");<br> Soprano::Model* model = Nepomuk::ResourceManager::instance()->mainModel();<br>
<br> Soprano::QueryResultIterator it = model->executeQuery( query, Soprano::Query::QueryLanguageSparql );<br> if( it.next() ) {<br> kDebug() << it.binding(0).isEmpty();<br> kDebug() << it[0].literal().toInt();<br>
}<br><br><br>Soprano Iterators behave similar to java style iterators. You'll need to call it.next() for it to iterate over the first element.<br><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>
On the server-side I can see this:<br>
chrigi ~ $[/usr/bin/nepomukservicestub] virtual void<br>
Soprano::Server::LocalServer::incomingConnection(quintptr)<br>
[/usr/bin/nepomukservicestub] void<br>
Soprano::Server::ServerCorePrivate::addConnection(Soprano::Server::ServerConnection*)<br>
New connection. New count: 12<br>
[/usr/bin/nepomukservicestub] Soprano::ODBC::Connection::Connection()<br>
Soprano::Server::ServerConnection(0x863190)<br>
[/usr/bin/nepomukservicestub] "/usr/bin/nepomukservicestub(25707)" Soprano:<br>
"SQLGetData for data length failed (iODBC Error: [iODBC][Driver<br>
Manager]Invalid cursor state)"<br>
"/usr/bin/nepomukservicestub(25707)" Soprano: "SQLGetData for data length<br>
failed (iODBC Error: [iODBC][Driver Manager]Invalid cursor state)"<br>
[/usr/bin/nepomukservicestub] "/usr/bin/nepomukservicestub(25707)" Soprano:<br>
"SQLGetData for data length failed (iODBC Error: [iODBC][Driver<br>
Manager]Invalid cursor state)"<br>
[/usr/bin/nepomukservicestub] "/usr/bin/nepomukservicestub(25707)" Soprano:<br>
"SQLGetData for data length failed (iODBC Error: [iODBC][Driver<br>
Manager]Invalid cursor state)"<br>
<br>
I have no clue how to debug that as there are no error messages at all on the<br>
client-side. Note that the exact same query works in nepomukshell and returns<br>
the correct result of "3".<br>
Any ideas?<br>
<br>
Cheers,<br>
Christian<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><br clear="all"><br>-- <br><span style="color:rgb(192,192,192)">Vishesh Handa</span><br><br>