本文整理汇总了C++中soprano::QueryResultIterator::lastError方法的典型用法代码示例。如果您正苦于以下问题:C++ QueryResultIterator::lastError方法的具体用法?C++ QueryResultIterator::lastError怎么用?C++ QueryResultIterator::lastError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类soprano::QueryResultIterator
的用法示例。
在下文中一共展示了QueryResultIterator::lastError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool Nepomuk::Types::EntityPrivate::load()
{
const QString query = QString::fromLatin1( "select ?p ?o where { "
"graph ?g { <%1> ?p ?o . } . "
"{ ?g a %2 . } UNION { ?g a %3 . } . }" )
.arg( QString::fromAscii( uri.toEncoded() ),
Soprano::Node::resourceToN3( Soprano::Vocabulary::NRL::Ontology() ),
Soprano::Node::resourceToN3( Soprano::Vocabulary::NRL::KnowledgeBase() ) );
Soprano::QueryResultIterator it
= ResourceManager::instance()->mainModel()->executeQuery( query, Soprano::Query::QueryLanguageSparql );
while ( it.next() ) {
QUrl property = it.binding( "p" ).uri();
Soprano::Node value = it.binding( "o" );
if ( property == Soprano::Vocabulary::RDFS::label() ) {
if ( value.language().isEmpty() ) {
label = value.toString();
}
else if( value.language() == KGlobal::locale()->language() ) {
l10nLabel = value.toString();
}
}
else if ( property == Soprano::Vocabulary::RDFS::comment() ) {
if ( value.language().isEmpty() ) {
comment = value.toString();
}
else if( value.language() == KGlobal::locale()->language() ) {
l10nComment = value.toString();
}
}
else if ( property == Soprano::Vocabulary::NAO::hasSymbol() ) {
icon = KIcon( value.toString() );
}
else if ( property == Soprano::Vocabulary::NAO::userVisible() ) {
userVisible = value.literal().toBool();
}
else {
addProperty( property, value );
}
}
return !it.lastError();
}
示例2: while
bool Nepomuk::Types::EntityPrivate::loadAncestors()
{
const QString query = QString::fromLatin1( "select ?s ?p where { "
"graph ?g { ?s ?p <%1> . } . "
"{ ?g a %2 . } UNION { ?g a %3 . } . }" )
.arg( QString::fromAscii( uri.toEncoded() ),
Soprano::Node::resourceToN3( Soprano::Vocabulary::NRL::Ontology() ),
Soprano::Node::resourceToN3( Soprano::Vocabulary::NRL::KnowledgeBase() ) );
Soprano::QueryResultIterator it
= ResourceManager::instance()->mainModel()->executeQuery( query, Soprano::Query::QueryLanguageSparql );
while ( it.next() ) {
addAncestorProperty( it.binding( "s" ).uri(), it.binding( "p" ).uri() );
}
return !it.lastError();
}