Hello community,

here is the log from the commit of package soprano for openSUSE:Factory checked 
in at 2012-05-21 10:02:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/soprano (Old)
 and      /work/SRC/openSUSE:Factory/.soprano.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "soprano", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/soprano/soprano-backend-sesame.changes   
2012-03-13 09:39:52.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.soprano.new/soprano-backend-sesame.changes      
2012-05-21 10:02:22.000000000 +0200
@@ -1,0 +2,11 @@
+Fri May 18 08:27:46 UTC 2012 - [email protected]
+
+- Update to 2.7.6:
+  * Support for the new SPARQL 1.1 DELETE statement which omits
+    the graph to delete from for faster removeAllStatement
+    execution in the Virtuoso backend.
+  * Support for the new default graph query result format of
+    Virtuoso >= 6.1.5.
+  * Fixed apidox generation with Doxygen 1.8.0.
+
+-------------------------------------------------------------------
soprano-backend-virtuoso.changes: same change
soprano.changes: same change

Old:
----
  soprano-2.7.5.tar.bz2

New:
----
  soprano-2.7.6.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ soprano-backend-sesame.spec ++++++
--- /var/tmp/diff_new_pack.5ooQyw/_old  2012-05-21 10:02:23.000000000 +0200
+++ /var/tmp/diff_new_pack.5ooQyw/_new  2012-05-21 10:02:23.000000000 +0200
@@ -22,7 +22,7 @@
 Group:          System/Libraries
 # COMMON1-BEGIN
 # COMMON1-BEGIN
-Version:        2.7.5
+Version:        2.7.6
 Release:        0
 Url:            http://soprano.sourceforge.net/
 Source0:        
http://downloads.sourceforge.net/soprano/soprano-%{version}.tar.bz2

soprano-backend-virtuoso.spec: same change
++++++ soprano.spec ++++++
--- /var/tmp/diff_new_pack.5ooQyw/_old  2012-05-21 10:02:23.000000000 +0200
+++ /var/tmp/diff_new_pack.5ooQyw/_new  2012-05-21 10:02:23.000000000 +0200
@@ -21,7 +21,7 @@
 License:        LGPL-2.1+ and GPL-2.0+
 Group:          System/Libraries
 # COMMON1-BEGIN
-Version:        2.7.5
+Version:        2.7.6
 Release:        0
 Url:            http://soprano.sourceforge.net/
 Source0:        
http://downloads.sourceforge.net/soprano/soprano-%{version}.tar.bz2

++++++ soprano-2.7.5.tar.bz2 -> soprano-2.7.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/soprano-2.7.5/CMakeLists.txt 
new/soprano-2.7.6/CMakeLists.txt
--- old/soprano-2.7.5/CMakeLists.txt    2012-03-03 19:44:20.000000000 +0100
+++ new/soprano-2.7.6/CMakeLists.txt    2012-05-16 10:36:35.000000000 +0200
@@ -11,7 +11,7 @@
 ##################  Soprano version  ################################
 set(CMAKE_SOPRANO_VERSION_MAJOR 2)
 set(CMAKE_SOPRANO_VERSION_MINOR 7)
-set(CMAKE_SOPRANO_VERSION_RELEASE 5)
+set(CMAKE_SOPRANO_VERSION_RELEASE 6)
 set(CMAKE_SOPRANO_VERSION_STRING 
"${CMAKE_SOPRANO_VERSION_MAJOR}.${CMAKE_SOPRANO_VERSION_MINOR}.${CMAKE_SOPRANO_VERSION_RELEASE}")
 
 
@@ -222,33 +222,35 @@
 find_package(Doxygen)
 
 if(DOXYGEN_EXECUTABLE)
-  configure_file(${soprano_SOURCE_DIR}/Doxyfile.cmake 
${soprano_BINARY_DIR}/Doxyfile)
-  set(QTDOCS_ONLINE "http://doc.qt.nokia.com/latest/";)
+  set(QTDOCS_ONLINE "http://qt-project.org/doc/qt-4.8/";)
 
   if(EXISTS ${QT_DOC_DIR}/html)
-    set(QTDOCS "${QT_DOC_DIR}/html")
+    set(QTDOCS_LOCAL "${QT_DOC_DIR}/html")
   else(EXISTS ${QT_DOC_DIR}/html)
-    set(QTDOCS ${QTDOCS_ONLINE})
+    set(QTDOCS_LOCAL ${QTDOCS_ONLINE})
   endif(EXISTS ${QT_DOC_DIR}/html)
 
+  set(QTDOCS ${QTDOCS_LOCAL})
+  configure_file(${soprano_SOURCE_DIR}/Doxyfile.cmake 
${soprano_BINARY_DIR}/Doxyfile.local)
+
+  set(QTDOCS ${QTDOCS_ONLINE})
+  configure_file(${soprano_SOURCE_DIR}/Doxyfile.cmake 
${soprano_BINARY_DIR}/Doxyfile.online)
+
   if(SOPRANO_BUILD_API_DOCS)
     add_custom_target(
       apidox ALL
-      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
-      COMMAND docs/html/installdox -q -l qt4.tag@${QTDOCS} docs/html/*.html
+      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile.local
       COMMENT "Building Soprano API docs...")
   else(SOPRANO_BUILD_API_DOCS)
     add_custom_target(
       apidox
-      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
-      COMMAND docs/html/installdox -q -l qt4.tag@${QTDOCS} docs/html/*.html
+      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile.local
       COMMENT "Building Soprano API docs...")
   endif(SOPRANO_BUILD_API_DOCS)
 
   add_custom_target(
     onlineapidox
-    COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
-    COMMAND docs/html/installdox -q -l qt4.tag@${QTDOCS_ONLINE} 
docs/html/*.html
+    COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile.online
     COMMENT "Building Soprano API docs...")
 
   add_custom_target(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/soprano-2.7.5/ChangeLog new/soprano-2.7.6/ChangeLog
--- old/soprano-2.7.5/ChangeLog 2012-03-03 19:44:20.000000000 +0100
+++ new/soprano-2.7.6/ChangeLog 2012-05-16 10:36:35.000000000 +0200
@@ -1,3 +1,9 @@
+2.7.6
+       * Support for the new SPARQL 1.1 DELETE statement which omits the graph 
to delete from
+         for faster removeAllStatement execution.
+       * Support for the new default graph query result format of Virtuoso >= 
6.1.5
+       * Fixed apidox generation with Doxygen 1.8.0.
+
 2.7.5
        * Be less strict when converting a string to a QDateTime:
           - Allow an empty time part, ie. "2011-10-04".
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/soprano-2.7.5/Doxyfile.cmake 
new/soprano-2.7.6/Doxyfile.cmake
--- old/soprano-2.7.5/Doxyfile.cmake    2012-03-03 19:44:20.000000000 +0100
+++ new/soprano-2.7.6/Doxyfile.cmake    2012-05-16 10:36:35.000000000 +0200
@@ -238,7 +238,7 @@
 #---------------------------------------------------------------------------
 # Configuration::additions related to external references   
 #---------------------------------------------------------------------------
-TAGFILES               = ${soprano_SOURCE_DIR}/qt4.tag
+TAGFILES               = ${soprano_SOURCE_DIR}/qt4.tag=${QTDOCS}
 GENERATE_TAGFILE       = 
 ALLEXTERNALS           = NO
 EXTERNAL_GROUPS        = YES
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/soprano-2.7.5/backends/virtuoso/virtuosobackend.cpp 
new/soprano-2.7.6/backends/virtuoso/virtuosobackend.cpp
--- old/soprano-2.7.5/backends/virtuoso/virtuosobackend.cpp     2012-03-03 
19:44:20.000000000 +0100
+++ new/soprano-2.7.6/backends/virtuoso/virtuosobackend.cpp     2012-05-16 
10:36:35.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  * This file is part of Soprano Project
  *
- * Copyright (C) 2008-2011 Sebastian Trueg <[email protected]>
+ * Copyright (C) 2008-2012 Sebastian Trueg <[email protected]>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -35,6 +35,26 @@
 
 Q_EXPORT_PLUGIN2(soprano_virtuosobackend, Soprano::Virtuoso::BackendPlugin)
 
+namespace {
+    QString parseVirtuosoVersion( const QByteArray& data ) {
+        QString erroutput = QString::fromLocal8Bit( data );
+        int vp = erroutput.indexOf( QLatin1String("Version" ) );
+        if ( vp > 0 ) {
+            vp += 8;
+            return erroutput.mid( vp, erroutput.indexOf( ' ', vp ) - vp );
+        }
+        return QString();
+    }
+
+    QString determineVirtuosoVersion( const QString& virtuosoBin ) {
+        QProcess p;
+        p.start( virtuosoBin, QStringList() << QLatin1String( "--version" ), 
QIODevice::ReadOnly );
+        p.waitForFinished();
+        return parseVirtuosoVersion( p.readAllStandardError() );
+    }
+}
+
+
 Soprano::Virtuoso::BackendPlugin::BackendPlugin()
     : Backend( "virtuosobackend" )
 {
@@ -58,6 +78,7 @@
     int queryTimeout = valueInSettings( settings, QLatin1String( 
"QueryTimeout" ), 0 ).toInt();
 
     VirtuosoController* controller = 0;
+    QString virtuosoVersion = QLatin1String("1.0.0"); // a default low version 
in case we connect to a running server
     if ( host.isEmpty() &&
          port == 0 &&
          uid.isEmpty() &&
@@ -67,9 +88,21 @@
             return 0;
         }
 
+        const QString virtuosoExe = locateVirtuosoBinary();
+        if ( virtuosoExe.isEmpty() ) {
+            setError( "Unable to find the Virtuoso binary." );
+            return 0;
+        }
+
+        virtuosoVersion = determineVirtuosoVersion(virtuosoExe);
+        if ( virtuosoVersion.isEmpty() ) {
+            setError( QString::fromLatin1("Failed to determine version of 
Virtuoso binary at %1").arg(virtuosoExe) );
+            return 0;
+        }
+
         // start local server
         controller = new VirtuosoController();
-        if ( !controller->start( settings, debugMode ? 
VirtuosoController::DebugMode : VirtuosoController::NoFlags ) ) {
+        if ( !controller->start( virtuosoExe, settings, debugMode ? 
VirtuosoController::DebugMode : VirtuosoController::NoFlags ) ) {
             setError( controller->lastError() );
             delete controller;
             return 0;
@@ -112,7 +145,7 @@
         return 0;
     }
 
-    VirtuosoModel* model = new VirtuosoModel( connectionPool, this );
+    VirtuosoModel* model = new VirtuosoModel( virtuosoVersion, connectionPool, 
this );
     // mem mangement the ugly way
     // FIXME: improve
     if ( controller ) {
@@ -169,25 +202,6 @@
 }
 
 
-namespace {
-    QString parseVirtuosoVersion( const QByteArray& data ) {
-        QString erroutput = QString::fromLocal8Bit( data );
-        int vp = erroutput.indexOf( QLatin1String("Version" ) );
-        if ( vp > 0 ) {
-            vp += 8;
-            return erroutput.mid( vp, erroutput.indexOf( ' ', vp ) - vp );
-        }
-        return QString();
-    }
-
-    QString determineVirtuosoVersion( const QString& virtuosoBin ) {
-        QProcess p;
-        p.start( virtuosoBin, QStringList() << QLatin1String( "--version" ), 
QIODevice::ReadOnly );
-        p.waitForFinished();
-        return parseVirtuosoVersion( p.readAllStandardError() );
-    }
-}
-
 bool Soprano::Virtuoso::BackendPlugin::isAvailable() const
 {
 #ifndef Q_OS_WIN
@@ -197,7 +211,7 @@
     }
 #endif
 
-    QString virtuosoBin = VirtuosoController::locateVirtuosoBinary();
+    QString virtuosoBin = locateVirtuosoBinary();
     if ( virtuosoBin.isEmpty() ) {
         qDebug() << Q_FUNC_INFO << "could not find virtuoso-t binary";
         return false;
@@ -218,8 +232,36 @@
 }
 
 
+// static
+QString Soprano::Virtuoso::BackendPlugin::locateVirtuosoBinary()
+{
+    QStringList dirs = Soprano::exeDirs();
+#ifdef Q_OS_WIN
+    const QString virtuosoHome = QDir::fromNativeSeparators( 
qgetenv("VIRTUOSO_HOME") );
+    if ( !virtuosoHome.isEmpty() )
+        dirs << virtuosoHome + QLatin1String("/bin");
+    else {
+        dirs << QCoreApplication::applicationDirPath();
+    }
+#endif
+
+    foreach( const QString& dir, dirs ) {
+#ifdef Q_OS_WIN
+        QFileInfo info( dir + QLatin1String("/virtuoso-t.exe") );
+#else
+        QFileInfo info( dir + QLatin1String("/virtuoso-t") );
+#endif
+        if ( info.isExecutable() ) {
+            return info.absoluteFilePath();
+        }
+    }
+    return QString();
+}
+
+
 #ifndef Q_OS_WIN
-QString Soprano::Virtuoso::BackendPlugin::findVirtuosoDriver() const
+// static
+QString Soprano::Virtuoso::BackendPlugin::findVirtuosoDriver()
 {
     return Soprano::findLibraryPath( "virtodbc_r", QStringList(), 
QStringList() << QLatin1String( "virtuoso/plugins/" ) << QLatin1String( "odbc/" 
) );
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/soprano-2.7.5/backends/virtuoso/virtuosobackend.h 
new/soprano-2.7.6/backends/virtuoso/virtuosobackend.h
--- old/soprano-2.7.5/backends/virtuoso/virtuosobackend.h       2012-03-03 
19:44:20.000000000 +0100
+++ new/soprano-2.7.6/backends/virtuoso/virtuosobackend.h       2012-05-16 
10:36:35.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  * This file is part of Soprano Project
  *
- * Copyright (C) 2008 Sebastian Trueg <[email protected]>
+ * Copyright (C) 2008-2012 Sebastian Trueg <[email protected]>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -48,9 +48,11 @@
             BackendFeatures supportedFeatures() const;
             bool isAvailable() const;
 
+            static QString locateVirtuosoBinary();
+
 #ifndef Q_OS_WIN
         private:
-            QString findVirtuosoDriver() const;
+            static QString findVirtuosoDriver();
 #endif
         };
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/soprano-2.7.5/backends/virtuoso/virtuosocontroller.cpp 
new/soprano-2.7.6/backends/virtuoso/virtuosocontroller.cpp
--- old/soprano-2.7.5/backends/virtuoso/virtuosocontroller.cpp  2012-03-03 
19:44:20.000000000 +0100
+++ new/soprano-2.7.6/backends/virtuoso/virtuosocontroller.cpp  2012-05-16 
10:36:35.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  * This file is part of Soprano Project
  *
- * Copyright (C) 2009-2011 Sebastian Trueg <[email protected]>
+ * Copyright (C) 2009-2012 Sebastian Trueg <[email protected]>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -90,7 +90,7 @@
 }
 
 
-bool Soprano::VirtuosoController::start( const BackendSettings& settings, 
RunFlags flags )
+bool Soprano::VirtuosoController::start( const QString &virtuosoExe, const 
BackendSettings &settings, RunFlags flags )
 {
     switch( m_status ) {
         case NotRunning:
@@ -117,12 +117,6 @@
 
     m_status = StartingUp;
 
-    QString virtuosoExe = locateVirtuosoBinary();
-    if ( virtuosoExe.isEmpty() ) {
-        setError( "Unable to find the Virtuoso binary." );
-        return false;
-    }
-
     const QString storageDir = valueInSettings( settings, 
BackendOptionStorageDir ).toString();
 
     // aquire a lock for ourselves
@@ -369,33 +363,6 @@
 }
 
 
-// static
-QString Soprano::VirtuosoController::locateVirtuosoBinary()
-{
-    QStringList dirs = Soprano::exeDirs();
-#ifdef Q_OS_WIN
-    const QString virtuosoHome = QDir::fromNativeSeparators( 
qgetenv("VIRTUOSO_HOME") );
-    if ( !virtuosoHome.isEmpty() )
-        dirs << virtuosoHome + QLatin1String("/bin");
-    else {
-        dirs << QCoreApplication::applicationDirPath();
-    }
-#endif
-
-    foreach( const QString& dir, dirs ) {
-#ifdef Q_OS_WIN
-        QFileInfo info( dir + QLatin1String("/virtuoso-t.exe") );
-#else
-        QFileInfo info( dir + QLatin1String("/virtuoso-t") );
-#endif
-        if ( info.isExecutable() ) {
-            return info.absoluteFilePath();
-        }
-    }
-    return QString();
-}
-
-
 // static
 int Soprano::VirtuosoController::pidOfRunningVirtuosoInstance( const QString& 
storagePath )
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/soprano-2.7.5/backends/virtuoso/virtuosocontroller.h 
new/soprano-2.7.6/backends/virtuoso/virtuosocontroller.h
--- old/soprano-2.7.5/backends/virtuoso/virtuosocontroller.h    2012-03-03 
19:44:20.000000000 +0100
+++ new/soprano-2.7.6/backends/virtuoso/virtuosocontroller.h    2012-05-16 
10:36:35.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  * This file is part of Soprano Project
  *
- * Copyright (C) 2009-2011 Sebastian Trueg <[email protected]>
+ * Copyright (C) 2009-2012 Sebastian Trueg <[email protected]>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -61,7 +61,7 @@
         };
         Q_DECLARE_FLAGS( RunFlags, RunFlag )
 
-        bool start( const BackendSettings& settings, RunFlags = NoFlags );
+        bool start( const QString& virtuosoBinary, const BackendSettings& 
settings, RunFlags flags = NoFlags );
         bool shutdown();
 
         int usedPort() const;
@@ -69,7 +69,6 @@
         Status status() const { return m_status; }
         ExitStatus lastExitStatus() const { return m_lastExitStatus; }
 
-        static QString locateVirtuosoBinary();
         static int pidOfRunningVirtuosoInstance( const QString& storagePath );
 
     Q_SIGNALS:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/soprano-2.7.5/backends/virtuoso/virtuosomodel.cpp 
new/soprano-2.7.6/backends/virtuoso/virtuosomodel.cpp
--- old/soprano-2.7.5/backends/virtuoso/virtuosomodel.cpp       2012-03-03 
19:44:20.000000000 +0100
+++ new/soprano-2.7.6/backends/virtuoso/virtuosomodel.cpp       2012-05-16 
10:36:35.000000000 +0200
@@ -140,11 +140,12 @@
 }
 
 
-Soprano::VirtuosoModel::VirtuosoModel( ODBC::ConnectionPool* connectionPool, 
const Backend* b )
+Soprano::VirtuosoModel::VirtuosoModel( const QString &virtuosoVersion, 
ODBC::ConnectionPool* connectionPool, const Backend* b )
     : StorageModel(b),
       d( new VirtuosoModelPrivate() )
 {
     d->q = this;
+    d->m_virtuosoVersion = virtuosoVersion;
     d->connectionPool = connectionPool;
 }
 
@@ -319,13 +320,13 @@
 {
 //    qDebug() << Q_FUNC_INFO << statement;
 
+    QString query;
     if ( statement.context().isValid() ) {
         if ( statement.context().uri() == Virtuoso::openlinkVirtualGraph() ) {
             setError( "Cannot remove statements from the virtual openlink 
graph. Virtuoso would not like that.", Error::ErrorInvalidArgument );
             return Error::ErrorInvalidArgument;
         }
 
-        QString query;
         if ( statement.context().isValid() &&
              !statement.subject().isValid() &&
              !statement.predicate().isValid() &&
@@ -340,75 +341,50 @@
                           statementToConstructGraphPattern( statement, true ) 
);
 
         }
-//        qDebug() << "removeAllStatements query:" << query;
-        if ( ODBC::Connection* conn = d->connectionPool->connection() ) {
-            if ( conn->executeCommand( "sparql " + query ) == Error::ErrorNone 
) {
-                // FIXME: can this be done with SQL/RDF views?
-                emit statementsRemoved();
-                Statement signalStatement( statement );
-                if( signalStatement.context() == Virtuoso::defaultGraph() )
-                    signalStatement.setContext( Node() );
-                emit statementRemoved( signalStatement );
-            }
-            setError( conn->lastError() );
-        }
-        else {
-            setError( d->connectionPool->lastError() );
-        }
-        return Error::convertErrorCode( lastError().code() );
     }
     else {
-        // FIXME: do this in a fancy way, maybe an inner sql query or something
-        QList<Node> allContexts = d->sparqlQuery( QString::fromLatin1( "select 
distinct ?g where { %1 . FILTER(?g != <%2>) . }" )
-                                                  .arg( 
statementToConstructGraphPattern( statement, true ),
-                                                        QLatin1String( 
Virtuoso::openlinkVirtualGraphString() ) ) )
-                                  .iterateBindings( 0 ).allNodes();
-        foreach( const Node& node, allContexts ) {
-            Statement s( statement );
-            if ( node.isValid() )
-                s.setContext( node );
-            else
-                s.setContext( Virtuoso::defaultGraph() );
-            Error::ErrorCode c = removeAllStatements( s );
-            if ( c != Error::ErrorNone )
-                return c;
+        //
+        // Starting with version 6.1.5 Virtuoso now supports the SPARQL 1.1 
delete variant which allows to omit
+        // the graph from the delete pattern.
+        // For versions before we need to use the old hacky method which 
requires iterating all graph candidates.
+        //
+        if( d->m_virtuosoVersion >= QLatin1String("6.1.5") ) {
+            query = QString::fromLatin1("delete { %1 } where { %1 }").arg( 
statementToConstructGraphPattern(statement, true) );
         }
-
-// the code below is not finished yet, still missing is a literal comparison. 
But then it should be much faster
-#if 0
-QStringList conditions;
-        if ( statement.subject().isValid() )
-            conditions << QString::fromLatin1( "s=iri_to_id ('')" ).arg( 
QString::fromAscii( statement.subject().uri().toEncoded() ) );
-        if ( statement.predicate().isValid() )
-            conditions << QString::fromLatin1( "p=iri_to_id ('')" ).arg( 
QString::fromAscii( statement.predicate().uri().toEncoded() ) );
-        if ( statement.object().isValid() ) {
-            if ( statement.object().isResource() ) {
-                conditions << QString::fromLatin1( "o=iri_to_id ('')" ).arg( 
QString::fromAscii( statement.object().uri().toEncoded() ) );
-            }
-            else {
-                Q_ASSERT( 0 );
+        else {
+            QList<Node> allContexts = d->sparqlQuery( QString::fromLatin1( 
"select distinct ?g where { %1 . FILTER(?g != <%2>) . }" )
+                                                      .arg( 
statementToConstructGraphPattern( statement, true ),
+                                                            QLatin1String( 
Virtuoso::openlinkVirtualGraphString() ) ) )
+                                      .iterateBindings( 0 ).allNodes();
+            foreach( const Node& node, allContexts ) {
+                Statement s( statement );
+                if ( node.isValid() )
+                    s.setContext( node );
+                else
+                    s.setContext( Virtuoso::defaultGraph() );
+                Error::ErrorCode c = removeAllStatements( s );
+                if ( c != Error::ErrorNone )
+                    return c;
             }
+            return Error::ErrorNone;
         }
+    }
 
-        QString query = QLatin1String( "delete from DB.DBA.RDF_QUAD where " ) 
+ conditions.join( QLatin1String( " AND " ) ) + ';';
-
-        if ( ODBC::Connection* conn = d->connectionPool->connection() ) {
-            if ( ODBC::QueryResult* sh = conn->executeQuery( query ) ) {
-                bool b = sh->fetchScroll();
-                delete sh;
-                return Error::ErrorUnknown;
-            }
-            else {
-                setError( conn->lastError() );
-            }
-        }
-        else {
-            setError( d->connectionPool->lastError() );
+    if ( ODBC::Connection* conn = d->connectionPool->connection() ) {
+        if ( conn->executeCommand( "sparql " + query ) == Error::ErrorNone ) {
+            // FIXME: can this be done with SQL/RDF views?
+            emit statementsRemoved();
+            Statement signalStatement( statement );
+            if( signalStatement.context() == Virtuoso::defaultGraph() )
+                signalStatement.setContext( Node() );
+            emit statementRemoved( signalStatement );
         }
-#endif
-
-        return Error::ErrorNone;
+        setError( conn->lastError() );
+    }
+    else {
+        setError( d->connectionPool->lastError() );
     }
+    return Error::convertErrorCode( lastError().code() );
 }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/soprano-2.7.5/backends/virtuoso/virtuosomodel.h 
new/soprano-2.7.6/backends/virtuoso/virtuosomodel.h
--- old/soprano-2.7.5/backends/virtuoso/virtuosomodel.h 2012-03-03 
19:44:20.000000000 +0100
+++ new/soprano-2.7.6/backends/virtuoso/virtuosomodel.h 2012-05-16 
10:36:35.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  * This file is part of Soprano Project
  *
- * Copyright (C) 2008-2011 Sebastian Trueg <[email protected]>
+ * Copyright (C) 2008-2012 Sebastian Trueg <[email protected]>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -40,7 +40,7 @@
         /**
          * \param connection The base connection used for non-transaction 
requests
          */
-        VirtuosoModel( ODBC::ConnectionPool* connectionPool, const Backend* );
+        VirtuosoModel( const QString& virtuosoVersion, ODBC::ConnectionPool* 
connectionPool, const Backend* );
         ~VirtuosoModel();
 
         Error::ErrorCode addStatement( const Statement &statement );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/soprano-2.7.5/backends/virtuoso/virtuosomodel_p.h 
new/soprano-2.7.6/backends/virtuoso/virtuosomodel_p.h
--- old/soprano-2.7.5/backends/virtuoso/virtuosomodel_p.h       2012-03-03 
19:44:20.000000000 +0100
+++ new/soprano-2.7.6/backends/virtuoso/virtuosomodel_p.h       2012-05-16 
10:36:35.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  * This file is part of Soprano Project
  *
- * Copyright (C) 2009-2010 Sebastian Trueg <[email protected]>
+ * Copyright (C) 2009-2012 Sebastian Trueg <[email protected]>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -72,6 +72,8 @@
         ODBC::ConnectionPool* connectionPool;
         QList<Virtuoso::QueryResultIteratorBackend*> m_openIterators;
 
+        QString m_virtuosoVersion;
+
         VirtuosoModel* q;
 
     private:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/soprano-2.7.5/backends/virtuoso/virtuosoqueryresultiteratorbackend.cpp 
new/soprano-2.7.6/backends/virtuoso/virtuosoqueryresultiteratorbackend.cpp
--- old/soprano-2.7.5/backends/virtuoso/virtuosoqueryresultiteratorbackend.cpp  
2012-03-03 19:44:20.000000000 +0100
+++ new/soprano-2.7.6/backends/virtuoso/virtuosoqueryresultiteratorbackend.cpp  
2012-05-16 10:36:35.000000000 +0200
@@ -69,7 +69,6 @@
         // otherwise a single row is returned
         if ( d->m_queryResult->fetchRow() ) {
             Node askVal = d->m_queryResult->getData( 1 );
-//            qDebug() << Q_FUNC_INFO << d->m_queryResult->resultColumns() << 
askVal;
             d->askResult = askVal.literal().toInt() != 0;
         }
         else {
@@ -171,7 +170,22 @@
 
 Soprano::Statement 
Soprano::Virtuoso::QueryResultIteratorBackend::currentStatement() const
 {
-    return d->graphIterator.current();
+    //
+    // More graph result hacking: starting with version 6.1.5 Virtuoso will 
return graph results
+    // as three columns S, P, O. While this makes way more sense than the 
serialized data in one
+    // blob it is harder to handle as a client could perfectly write a select 
query with variables
+    // S, P, and O.
+    // Thus, the only way to go is to allow both a binding and a graph 
handling of the result.
+    //
+    if( d->m_resultType == QueryResultIteratorBackendPrivate::GraphResult ) {
+        return d->graphIterator.current();
+    }
+    else if( isGraph() ) {
+        return Statement(binding(0), binding(1), binding(2));
+    }
+    else {
+        return Statement();
+    }
 }
 
 
@@ -228,7 +242,17 @@
 
 bool Soprano::Virtuoso::QueryResultIteratorBackend::isGraph() const
 {
-    return d->m_resultType == QueryResultIteratorBackendPrivate::GraphResult;
+    //
+    // More graph result hacking: starting with version 6.1.5 Virtuoso will 
return graph results
+    // as three columns S, P, O. While this makes way more sense than the 
serialized data in one
+    // blob it is harder to handle as a client could perfectly write a select 
query with variables
+    // S, P, and O.
+    // Thus, the only way to go is to allow both a binding and a graph 
handling of the result.
+    //
+    return( d->m_resultType == QueryResultIteratorBackendPrivate::GraphResult 
||
+            ( d->m_resultType == 
QueryResultIteratorBackendPrivate::BindingResult &&
+              d->bindingNames.count() == 3 &&
+              d->bindingNames == QStringList() << QLatin1String("S") << 
QLatin1String("P") << QLatin1String("O") ) );
 }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/soprano-2.7.5/soprano/pluginstub.cpp 
new/soprano-2.7.6/soprano/pluginstub.cpp
--- old/soprano-2.7.5/soprano/pluginstub.cpp    2012-03-03 19:44:20.000000000 
+0100
+++ new/soprano-2.7.6/soprano/pluginstub.cpp    2012-05-16 10:36:35.000000000 
+0200
@@ -114,7 +114,7 @@
             }
         }
         else {
-            qDebug() << "(Soprano::PluginManager) found no soprano plugin at " 
<< loader.fileName();
+            qDebug() << "(Soprano::PluginManager) found no soprano plugin at " 
<< loader.fileName() << "- error:" << loader.errorString();
             delete d->plugin;
             d->plugin = 0;
         }

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to