Hello community, here is the log from the commit of package soprano for openSUSE:Factory checked in at Fri Nov 27 14:09:27 CET 2009. -------- --- soprano/soprano-backend-sesame.changes 2009-09-09 21:14:14.000000000 +0200 +++ /mounts/work_src_done/STABLE/soprano/soprano-backend-sesame.changes 2009-11-13 23:10:08.000000000 +0100 @@ -1,0 +2,9 @@ +Fri Nov 13 23:05:42 CET 2009 - dmueller@suse.de + +- update to 2.3.1: + * Changed installation path of cmake modules (SopranoAppOntology.cmake) to <prefix/share/soprano/cmake + * Prevent the redland backend to add one statement multiple times. + * Properly handle class names containing a dash '-' in onto2vocabularyclass + * sopranocmd: Fail if trying to export a non-graph query + +------------------------------------------------------------------- soprano.changes: same change calling whatdependson for head-i586 Old: ---- soprano-2.3.0.tar.bz2 New: ---- soprano-2.3.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ soprano-backend-sesame.spec ++++++ --- /var/tmp/diff_new_pack.wNazlW/_old 2009-11-27 14:08:46.000000000 +0100 +++ /var/tmp/diff_new_pack.wNazlW/_new 2009-11-27 14:08:46.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package soprano-backend-sesame (Version 2.3.0) +# spec file for package soprano-backend-sesame (Version 2.3.1) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -20,7 +20,7 @@ Name: soprano-backend-sesame Url: http://soprano.sourceforge.net/ BuildRequires: fdupes java-devel libsoprano-devel -License: GPL v2 or later ; LGPL v2.1 or later +License: GPLv2+ ; LGPLv2.1+ Group: Development/Libraries/C and C++ Summary: C++/Qt based interface library for RDF - Sesame backend BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -29,8 +29,8 @@ # COMMON1-BEGIN BuildRequires: cmake kde4-filesystem libqt4-devel libraptor-devel libredland-devel BuildRequires: clucene-core-devel doxygen raptor -Version: 2.3.0 -Release: 4 +Version: 2.3.1 +Release: 1 Source: soprano-%{version}.tar.bz2 Patch0: datadir.diff # COMMON1-END @@ -52,7 +52,7 @@ %build export JAVA_HOME=%{_jvmdir}/java - %cmake_kde4 -d build -- -DCMAKE_SKIP_RPATH=OFF + %cmake_kde4 -d build -- -DCMAKE_SKIP_RPATH=OFF -DBUILD_SESAME_BACKEND=ON %make_jobs %install ++++++ soprano.spec ++++++ --- /var/tmp/diff_new_pack.wNazlW/_old 2009-11-27 14:08:46.000000000 +0100 +++ /var/tmp/diff_new_pack.wNazlW/_new 2009-11-27 14:08:46.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package soprano (Version 2.3.0) +# spec file for package soprano (Version 2.3.1) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -22,14 +22,14 @@ %if %suse_version > 1020 BuildRequires: fdupes %endif -License: GPL v2 or later ; LGPL v2.1 or later +License: GPLv2+ ; LGPLv2.1+ Group: Development/Libraries/C and C++ Summary: C++/Qt based interface library for RDF # COMMON1-BEGIN BuildRequires: cmake kde4-filesystem libqt4-devel libraptor-devel libredland-devel BuildRequires: clucene-core-devel doxygen raptor -Version: 2.3.0 -Release: 4 +Version: 2.3.1 +Release: 1 Source: soprano-%{version}.tar.bz2 Patch0: datadir.diff # COMMON1-END @@ -59,7 +59,7 @@ # COMMON2-END %package -n libsoprano-devel -License: LGPL v2.1 or later +License: LGPLv2.1+ Group: Development/Libraries/C and C++ Summary: C++/Qt based interface library for RDF Requires: libsoprano4 = %version @@ -83,7 +83,7 @@ Sebastian Trueg <trueg@kde.org> %package -n libsoprano4 -License: LGPL v2.1 or later +License: LGPLv2.1+ Group: Development/Libraries/C and C++ Summary: C++/Qt based interface library for RDF %requires_ge libqt4 @@ -103,7 +103,7 @@ Sebastian Trueg <trueg@kde.org> %package backend-redland -License: LGPL v2.1 or later +License: LGPLv2.1+ Group: Development/Libraries/C and C++ Summary: C++/Qt based interface library for RDF Provides: soprano_backend = %version ++++++ datadir.diff ++++++ --- /var/tmp/diff_new_pack.wNazlW/_old 2009-11-27 14:08:46.000000000 +0100 +++ /var/tmp/diff_new_pack.wNazlW/_new 2009-11-27 14:08:46.000000000 +0100 @@ -4,6 +4,6 @@ install(FILES SopranoAddOntology.cmake DESTINATION -- share/apps/cmake/modules +- share/soprano/cmake + share/cmake/Modules ) ++++++ soprano-2.3.0.tar.bz2 -> soprano-2.3.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.3.0/backends/redland/redlandmodel.cpp new/soprano-2.3.1/backends/redland/redlandmodel.cpp --- old/soprano-2.3.0/backends/redland/redlandmodel.cpp 2009-06-18 15:58:59.000000000 +0200 +++ new/soprano-2.3.1/backends/redland/redlandmodel.cpp 2009-08-06 11:07:11.000000000 +0200 @@ -2,7 +2,7 @@ * This file is part of Soprano Project. * * Copyright (C) 2006 Daniele Galdi <daniele.galdi@gmail.com> - * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org> + * Copyright (C) 2007-2009 Sebastian Trueg <trueg@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -35,16 +35,27 @@ #include <QtCore/QDebug> -static bool isContextOnlyStatement( const Soprano::Statement& statement ) -{ - return ( !statement.subject().isValid() && - !statement.predicate().isValid() && - !statement.object().isValid() && - statement.context().isValid() ); +namespace { + bool isContextOnlyStatement( const Soprano::Statement& statement ) + { + return ( !statement.subject().isValid() && + !statement.predicate().isValid() && + !statement.object().isValid() && + statement.context().isValid() ); + } + + bool isRedlandStatementEmpty( librdf_statement* statement ) + { + return ( !statement || + ( !librdf_statement_get_subject( statement ) && + !librdf_statement_get_predicate( statement ) && + !librdf_statement_get_object( statement ) ) ); + } } -class Soprano::Redland::RedlandModel::Private { +class Soprano::Redland::RedlandModel::Private +{ public: Private() : world(0), @@ -61,8 +72,84 @@ QList<RedlandStatementIterator*> iterators; QList<Redland::NodeIteratorBackend*> nodeIterators; QList<RedlandQueryResult*> results; + + /** + * librdf_model_find_statements_in_context does not support empty contexts. All in all + * redland is not very flexible. Thus, we have to do it all manually. + */ + librdf_stream* redlandFindStatements( const Soprano::Statement& statement ); + librdf_stream* redlandFindStatements( librdf_statement* statement, librdf_node* context ); + bool redlandContainsStatement( const Soprano::Statement& statement ); + bool redlandContainsStatement( librdf_statement* statement, librdf_node* context ); }; + +librdf_stream* Soprano::Redland::RedlandModel::Private::redlandFindStatements( const Soprano::Statement& statement ) +{ + librdf_node* ctx = world->createNode( statement.context() ); + librdf_statement* st = world->createStatement( statement ); + librdf_stream *stream = redlandFindStatements( st, ctx ); + world->freeNode( ctx ); + world->freeStatement( st ); + return stream; +} + + +librdf_stream* Soprano::Redland::RedlandModel::Private::redlandFindStatements( librdf_statement* statement, librdf_node* context ) +{ + if ( isRedlandStatementEmpty( statement ) && context ) { + return librdf_model_context_as_stream( model, context ); + } + else { + // context support does not work, redland API claims that librdf_model_find_statements_in_context + // with a NULL context is the same as librdf_model_find_statements. Well, in practice it is not. + // We even have to set the context on all statements if we only search in one context! + librdf_stream *stream = 0; + if( !context ) { + stream = librdf_model_find_statements( model, statement ); + } + else { + stream = librdf_model_find_statements_in_context( model, statement, context ); + } + return stream; + } + + return 0; +} + + +bool Soprano::Redland::RedlandModel::Private::redlandContainsStatement( const Soprano::Statement& statement ) +{ + librdf_statement* s = world->createStatement( statement ); + librdf_node* c = statement.context().isValid() ? world->createNode( statement.context() ) : 0; + bool cr = redlandContainsStatement( s, c ); + world->freeStatement( s ); + world->freeNode( c ); + return cr; +} + + +bool Soprano::Redland::RedlandModel::Private::redlandContainsStatement( librdf_statement* statement, librdf_node* context ) +{ + if ( isRedlandStatementEmpty( statement ) && context ) { + return librdf_model_contains_context( model, context ) != 0; + } + else { + // librdf_model_contains_statement does not support + // empty nodes and also there is no context support for contains. + librdf_stream* s = redlandFindStatements( statement, context ); + if ( s ) { + bool c = !librdf_stream_end( s ); + librdf_free_stream( s ); + return c; + } + else { + return false; + } + } +} + + Soprano::Redland::RedlandModel::RedlandModel( const Backend* b, librdf_model *model, librdf_storage *storage, World* world ) : StorageModel( b ) { @@ -119,6 +206,8 @@ clearError(); + bool added = true; + d->readWriteLock.lockForWrite(); librdf_statement* redlandStatement = d->world->createStatement( statement ); @@ -142,14 +231,23 @@ } } else { + // + // there is a bug (at least IMHO it is a bug) in redland which allows to add the same statement to one graph + // multiple times. + // librdf_node* redlandContext = d->world->createNode( statement.context() ); - if ( librdf_model_context_add_statement( d->model, redlandContext, redlandStatement ) ) { - d->world->freeStatement( redlandStatement ); - d->world->freeNode( redlandContext ); - setError( d->world->lastError( Error::Error( "Failed to add statement", - Error::ErrorUnknown ) ) ); - d->readWriteLock.unlock(); - return Error::ErrorUnknown; + if ( d->redlandContainsStatement( redlandStatement, redlandContext ) ) { + added = false; + } + else { + if ( librdf_model_context_add_statement( d->model, redlandContext, redlandStatement ) ) { + d->world->freeStatement( redlandStatement ); + d->world->freeNode( redlandContext ); + setError( d->world->lastError( Error::Error( "Failed to add statement", + Error::ErrorUnknown ) ) ); + d->readWriteLock.unlock(); + return Error::ErrorUnknown; + } } d->world->freeNode( redlandContext ); @@ -162,8 +260,10 @@ d->readWriteLock.unlock(); - emit statementAdded( statement ); - emit statementsAdded(); + if ( added ) { + emit statementAdded( statement ); + emit statementsAdded(); + } return Error::ErrorNone; } @@ -189,29 +289,35 @@ } -bool Soprano::Redland::RedlandModel::containsAnyStatement( const Statement &statement ) const +bool Soprano::Redland::RedlandModel::containsStatement( const Statement& statement ) const { - clearError(); - - if ( isContextOnlyStatement( statement ) ) { + if ( statement.isValid() ) { MultiMutexReadLocker lock( &d->readWriteLock ); - - librdf_node *ctx = d->world->createNode( statement.context() ); - if ( !ctx ) { + if ( statement.context().isValid() ) { + bool c = d->redlandContainsStatement( statement ); setError( d->world->lastError() ); - return false; + return c; } + else { + return StorageModel::containsStatement( statement ); + } + } + else { + setError( "Cannot check for invalid statement", Error::ErrorInvalidArgument ); + return false; + } +} - int result = librdf_model_contains_context( d->model, ctx ); - d->world->freeNode( ctx ); +bool Soprano::Redland::RedlandModel::containsAnyStatement( const Statement& statement ) const +{ + clearError(); - return result != 0; - } + MultiMutexReadLocker lock( &d->readWriteLock ); - // FIXME: looks as if librdf_model_contains_statement does not support - // empty nodes and also there is no context support for contains. - return listStatements( statement ).next(); + bool c = d->redlandContainsStatement( statement ); + setError( d->world->lastError() ); + return c; } @@ -247,65 +353,22 @@ } -Soprano::StatementIterator Soprano::Redland::RedlandModel::listStatements( const Statement &partial ) const +Soprano::StatementIterator Soprano::Redland::RedlandModel::listStatements( const Statement& partial ) const { d->readWriteLock.lockForRead(); clearError(); - if ( isContextOnlyStatement( partial ) ) { - - librdf_node *ctx = d->world->createNode( partial.context() ); - - librdf_stream *stream = librdf_model_context_as_stream( d->model, ctx ); - d->world->freeNode( ctx ); - if ( !stream ) { - setError( d->world->lastError() ); - d->readWriteLock.unlock(); - return StatementIterator(); - } - - // see listStatements( Statement ) for details on the context hack - // second lock for the iterator itself - RedlandStatementIterator* it = new RedlandStatementIterator( this, stream, partial.context() ); - d->iterators.append( it ); - return StatementIterator( it ); + librdf_stream* stream = d->redlandFindStatements( partial ); + if ( !stream ) { + setError( d->world->lastError() ); + d->readWriteLock.unlock(); + return StatementIterator(); } - else { - librdf_statement *st = d->world->createStatement( partial ); - if ( !st ) { - setError( d->world->lastError() ); - d->readWriteLock.unlock(); - return StatementIterator(); - } - - librdf_node *ctx = d->world->createNode( partial.context() ); - // FIXME: context support does not work, redland API claims that librdf_model_find_statements_in_context - // with a NULL context is the same as librdf_model_find_statements. Well, in practice it is not. - // We even have to set the context on all statements if we only search in one context! - librdf_stream *stream = 0; - if( partial.context().isEmpty() ) { - stream = librdf_model_find_statements( d->model, st ); - } - else { - stream = librdf_model_find_statements_in_context( d->model, st, ctx ); - } - - d->world->freeNode( ctx ); - d->world->freeStatement( st ); - - if ( !stream ) { - setError( d->world->lastError() ); - d->readWriteLock.unlock(); - return StatementIterator(); - } - - // we do not unlock d->readWriteLock here. That is done once the iterator closes - RedlandStatementIterator* it = new RedlandStatementIterator( this, stream, partial.context() ); - d->iterators.append( it ); - return StatementIterator( it ); - } + RedlandStatementIterator* it = new RedlandStatementIterator( this, stream, partial.context() ); + d->iterators.append( it ); + return StatementIterator( it ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.3.0/backends/redland/redlandmodel.h new/soprano-2.3.1/backends/redland/redlandmodel.h --- old/soprano-2.3.0/backends/redland/redlandmodel.h 2008-07-30 14:19:23.000000000 +0200 +++ new/soprano-2.3.1/backends/redland/redlandmodel.h 2009-08-06 11:00:32.000000000 +0200 @@ -1,8 +1,8 @@ -/* +/* * This file is part of Soprano Project * * Copyright (C) 2006 Daniele Galdi <daniele.galdi@gmail.com> - * Copyright (C) 2007-2008 Sebastian Trueg <trueg@kde.org> + * Copyright (C) 2007-2009 Sebastian Trueg <trueg@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -60,6 +60,7 @@ virtual NodeIterator listContexts() const; + bool containsStatement( const Statement &statement ) const; bool containsAnyStatement( const Statement &statement ) const; Soprano::QueryResultIterator executeQuery( const QString &query, Query::QueryLanguage language, const QString& userQueryLanguage = QString() ) const; @@ -87,7 +88,7 @@ friend class RedlandStatementIterator; friend class RedlandQueryResult; friend class NodeIteratorBackend; - }; + }; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.3.0/backends/sesame2/jniwrapper.cpp new/soprano-2.3.1/backends/sesame2/jniwrapper.cpp --- old/soprano-2.3.0/backends/sesame2/jniwrapper.cpp 2008-12-30 10:28:47.000000000 +0100 +++ new/soprano-2.3.1/backends/sesame2/jniwrapper.cpp 2009-08-21 09:43:25.000000000 +0200 @@ -95,7 +95,7 @@ JNIEnv* JNIWrapper::env() const { - QHash<QThread*, JNIEnv*>::const_iterator it = d->jniEnvMap.find( QThread::currentThread() ); + QHash<QThread*, JNIEnv*>::const_iterator it = d->jniEnvMap.constFind( QThread::currentThread() ); if ( it == d->jniEnvMap.constEnd() ) { JNIEnv* env = 0; d->jvm->AttachCurrentThread( ( void** )&env, 0 ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.3.0/ChangeLog new/soprano-2.3.1/ChangeLog --- old/soprano-2.3.0/ChangeLog 2009-07-15 12:02:27.000000000 +0200 +++ new/soprano-2.3.1/ChangeLog 2009-08-19 14:29:31.000000000 +0200 @@ -1,3 +1,9 @@ +2.3.1 + * Changed installation path of cmake modules (SopranoAppOntology.cmake) to <prefix/share/soprano/cmake + * Prevent the redland backend to add one statement multiple times. + * Properly handle class names containing a dash '-' in onto2vocabularyclass + * sopranocmd: Fail if trying to export a non-graph query + 2.3 * New class LanguageTag replacing the old simple string language handling with a sophisticated one implementing RFC 4647. At the same time Soprano now directly supports plain literals in addition diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.3.0/cmake/modules/CMakeLists.txt new/soprano-2.3.1/cmake/modules/CMakeLists.txt --- old/soprano-2.3.0/cmake/modules/CMakeLists.txt 2009-06-23 21:45:40.000000000 +0200 +++ new/soprano-2.3.1/cmake/modules/CMakeLists.txt 2009-08-06 11:00:32.000000000 +0200 @@ -1,5 +1,5 @@ install(FILES SopranoAddOntology.cmake DESTINATION - share/apps/cmake/modules + share/soprano/cmake ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.3.0/CMakeLists.txt new/soprano-2.3.1/CMakeLists.txt --- old/soprano-2.3.0/CMakeLists.txt 2009-07-15 16:00:08.000000000 +0200 +++ new/soprano-2.3.1/CMakeLists.txt 2009-08-06 11:00:32.000000000 +0200 @@ -7,7 +7,7 @@ ################## Soprano version ################################ set(CMAKE_SOPRANO_VERSION_MAJOR 2) set(CMAKE_SOPRANO_VERSION_MINOR 3) -set(CMAKE_SOPRANO_VERSION_RELEASE 0) +set(CMAKE_SOPRANO_VERSION_RELEASE 1) set(CMAKE_SOPRANO_VERSION_STRING "${CMAKE_SOPRANO_VERSION_MAJOR}.${CMAKE_SOPRANO_VERSION_MINOR}.${CMAKE_SOPRANO_VERSION_RELEASE}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.3.0/tools/onto2vocabularyclass.cpp new/soprano-2.3.1/tools/onto2vocabularyclass.cpp --- old/soprano-2.3.0/tools/onto2vocabularyclass.cpp 2008-11-28 09:23:39.000000000 +0100 +++ new/soprano-2.3.1/tools/onto2vocabularyclass.cpp 2009-08-21 16:42:15.000000000 +0200 @@ -217,7 +217,7 @@ if ( !QFile::exists( fileName ) ) { QTextStream s( stderr ); - s << "Could not find file" << fileName << endl; + s << "Could not find file " << fileName << endl; return 1; } @@ -435,7 +435,7 @@ for( QMap<QString, QPair<QString, QString> >::const_iterator it = normalizedResources.constBegin(); it != normalizedResources.constEnd(); ++it ) { - QString name = it.value().first; + QString name = normalizeName( it.value().first ); sourceStream << createIndent( 1 ) << "QUrl " << className.toLower() << "_" << name << ";" << endl; } sourceStream << "};" << endl << endl; @@ -453,7 +453,7 @@ for( QMap<QString, QPair<QString, QString> >::const_iterator it = normalizedResources.constBegin(); it != normalizedResources.constEnd(); ++it ) { - QString name = it.value().first; + QString name = normalizeName( it.value().first ); sourceStream << "QUrl "; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.3.0/tools/sopranocmd.cpp new/soprano-2.3.1/tools/sopranocmd.cpp --- old/soprano-2.3.0/tools/sopranocmd.cpp 2009-07-15 16:00:08.000000000 +0200 +++ new/soprano-2.3.1/tools/sopranocmd.cpp 2009-08-19 14:29:31.000000000 +0200 @@ -837,10 +837,17 @@ success = exportFile( model->listStatements(), fileName, serialization ); } else { - success = exportFile( model->executeQuery( tuneQuery( query, queryLang ), - Soprano::Query::queryLanguageFromString( queryLang ), queryLang ).iterateStatements(), - fileName, - serialization ); + QueryResultIterator it = model->executeQuery( tuneQuery( query, queryLang ), + Soprano::Query::queryLanguageFromString( queryLang ), queryLang ); + if ( it.isGraph() ) { + success = exportFile( it.iterateStatements(), + fileName, + serialization ); + } + else { + errStream << "Can only export graph queries"; + return 1; + } } delete model; ++++++ soprano-backend-sesame.spec.in ++++++ --- /var/tmp/diff_new_pack.wNazlW/_old 2009-11-27 14:08:47.000000000 +0100 +++ /var/tmp/diff_new_pack.wNazlW/_new 2009-11-27 14:08:47.000000000 +0100 @@ -40,7 +40,7 @@ %build export JAVA_HOME=%{_jvmdir}/java - %cmake_kde4 -d build -- -DCMAKE_SKIP_RPATH=OFF + %cmake_kde4 -d build -- -DCMAKE_SKIP_RPATH=OFF -DBUILD_SESAME_BACKEND=ON %make_jobs %install ++++++ soprano-backend-virtuoso.spec.in ++++++ --- /var/tmp/diff_new_pack.wNazlW/_old 2009-11-27 14:08:47.000000000 +0100 +++ /var/tmp/diff_new_pack.wNazlW/_new 2009-11-27 14:08:47.000000000 +0100 @@ -19,7 +19,7 @@ Name: soprano-backend-virtuoso Url: http://soprano.sourceforge.net/ -BuildRequires: java-devel fdupes libsoprano-devel +BuildRequires: fdupes libsoprano-devel License: GPL v2 or later; LGPL v2.1 or later Group: Development/Libraries/C and C++ Summary: C++/Qt based interface library for RDF @@ -40,7 +40,7 @@ # COMMON2-END %build - %cmake_kde4 -d build -- -DCMAKE_SKIP_RPATH=OFF + %cmake_kde4 -d build -- -DCMAKE_SKIP_RPATH=OFF -DBUILD_VIRTUOSO_BACKEND=ON %make_jobs %install ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org