本文整理汇总了C++中soprano::QueryResultIterator::close方法的典型用法代码示例。如果您正苦于以下问题:C++ QueryResultIterator::close方法的具体用法?C++ QueryResultIterator::close怎么用?C++ QueryResultIterator::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类soprano::QueryResultIterator
的用法示例。
在下文中一共展示了QueryResultIterator::close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: job
//
// We don't really care if the indexing level is in the incorrect graph
//
void Nepomuk2::updateIndexingLevel(const QUrl& uri, int level)
{
QString uriN3 = Soprano::Node::resourceToN3( uri );
QString query = QString::fromLatin1("select ?g ?l where { graph ?g { %1 kext:indexingLevel ?l . } }")
.arg ( uriN3 );
Soprano::Model* model = ResourceManager::instance()->mainModel();
Soprano::QueryResultIterator it = model->executeQuery( query, Soprano::Query::QueryLanguageSparqlNoInference );
QUrl graph;
Soprano::Node prevLevel;
if( it.next() ) {
graph = it[0].uri();
prevLevel = it[1];
it.close();
}
if( !graph.isEmpty() ) {
QString graphN3 = Soprano::Node::resourceToN3( graph );
QString removeCommand = QString::fromLatin1("sparql delete { graph %1 { %2 kext:indexingLevel %3 . } }")
.arg( graphN3, uriN3, prevLevel.toN3() );
model->executeQuery( removeCommand, Soprano::Query::QueryLanguageUser, QLatin1String("sql") );
QString insertCommand = QString::fromLatin1("sparql insert { graph %1 { %2 kext:indexingLevel %3 . } }")
.arg( graphN3, uriN3, Soprano::Node::literalToN3(level) );
model->executeQuery( insertCommand, Soprano::Query::QueryLanguageUser, QLatin1String("sql") );
}
// Practically, this should never happen, but still
else {
QScopedPointer<KJob> job( Nepomuk2::setProperty( QList<QUrl>() << uri, KExt::indexingLevel(),
QVariantList() << QVariant(level) ) );
job->setAutoDelete(false);
job->exec();
}
}