[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/runtime/nepomuk/strigibackend
From: Sebastian Trueg <sebastian () trueg ! de>
Date: 2009-08-23 18:04:20
Message-ID: 1251050660.433269.30144.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1014750 by trueg:
Fixed deleteEntries query. This fixes deletion of metadata.
It also fixes and issue with re-indexing files over and over again even though they \
did not change.
M +2 -1 sopranoindexreader.cpp
M +13 -7 sopranoindexwriter.cpp
--- trunk/KDE/kdebase/runtime/nepomuk/strigibackend/sopranoindexreader.cpp \
#1014749:1014750 @@ -375,7 +375,8 @@
std::map<std::string, time_t>& \
children ) {
//
- // We are compatible with old Xesam data, thus the weird query
+ // We are compatible with old Xesam data where the url was encoded as a string \
instead of a url, + // thus the weird query
//
QString query = QString( "select distinct ?path ?mtime where { "
"{ ?r <http://strigi.sf.net/ontologies/0.9#parentUrl> \
%1 . } "
--- trunk/KDE/kdebase/runtime/nepomuk/strigibackend/sopranoindexwriter.cpp \
#1014749:1014750 @@ -24,6 +24,7 @@
#include <Soprano/Soprano>
#include <Soprano/Vocabulary/RDF>
+#include <Soprano/Vocabulary/Xesam>
#include <Soprano/LiteralValue>
#include <Soprano/Node>
#include <Soprano/QueryResultIterator>
@@ -256,22 +257,27 @@
void Strigi::Soprano::IndexWriter::deleteEntries( const std::vector<std::string>& \
entries ) {
for ( unsigned int i = 0; i < entries.size(); ++i ) {
+ //
+ // We are compatible with old Xesam data where the url was encoded as a \
string instead of a url, + // thus the weird query
+ //
QString path = QString::fromUtf8( entries[i].c_str() );
QString query = QString( "select ?g ?mg where { "
- "{ ?r \
<http://strigi.sf.net/ontologies/0.9#parentUrl> %1 . } " + \
"{ ?r %3 %1 . } " "UNION "
- "{ ?r \
<http://strigi.sf.net/ontologies/0.9#parentUrl> %2 . } " + \
"{ ?r %3 %2 . } " "UNION "
- "{ ?r %3 %2 . } . "
- "?g %4 ?r . "
- "OPTIONAL { ?mg %5 ?g . } }" )
+ "{ ?r %4 %2 . } . "
+ "?g %5 ?r . "
+ "OPTIONAL { ?mg %6 ?g . } }" )
.arg( Node::literalToN3( path ),
Node::resourceToN3( QUrl::fromLocalFile( path ) ),
- Node::resourceToN3( \
Nepomuk::Vocabulary::NIE::isPartOf() ), + \
Node::resourceToN3( Vocabulary::Xesam::url() ), + \
Node::resourceToN3( Nepomuk::Vocabulary::NIE::url() ),
Node::resourceToN3( Strigi::Ontology::indexGraphFor() \
),
Node::resourceToN3( \
Vocabulary::NRL::coreGraphMetadataFor() ) );
- qDebug() << "deleteEntries query:" << query;
+// qDebug() << "deleteEntries query:" << query;
QueryResultIterator result = d->repository->executeQuery( query, \
::Soprano::Query::QueryLanguageSparql ); if ( result.next() ) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic