Hello community,
here is the log from the commit of package soprano for openSUSE:Factory
checked in at Thu Oct 7 22:21:48 CEST 2010.
--------
--- soprano/soprano-backend-sesame.changes 2010-07-28 21:16:24.000000000 +0200
+++ /mounts/work_src_done/STABLE/soprano/soprano-backend-sesame.changes 2010-10-06 09:57:11.000000000 +0200
@@ -1,0 +2,14 @@
+Wed Oct 6 07:56:41 UTC 2010 - coolo@novell.com
+
+- update to 2.5.0:
+ * New public qHash method for Statement
+ * New Node::fromN3 method and operator>> which allows to
+ parse nodes from N3 encoding.
+ * Updated NRL ontology namespace
+ * New operator== for BindingSet
+ * Ported the DBus service watching to QDBusServiceWatcher
+ * Highly improved server socket handling in the local and
+ tcp socket server implementation.
+ * Several improvements in the Virtuoso backend plugin.
+
+-------------------------------------------------------------------
soprano-backend-virtuoso.changes: same change
soprano.changes: same change
calling whatdependson for head-i586
Old:
----
soprano-2.4.64.tar.bz2
New:
----
soprano-2.5.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ soprano-backend-sesame.spec ++++++
--- /var/tmp/diff_new_pack.4fiN4G/_old 2010-10-07 22:19:52.000000000 +0200
+++ /var/tmp/diff_new_pack.4fiN4G/_new 2010-10-07 22:19:52.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package soprano-backend-sesame (Version 2.4.64)
+# spec file for package soprano-backend-sesame (Version 2.5.0)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -29,7 +29,7 @@
# COMMON1-BEGIN
BuildRequires: cmake kde4-filesystem libqt4-devel libraptor-devel libredland-devel
BuildRequires: clucene-core-devel doxygen raptor
-Version: 2.4.64
+Version: 2.5.0
Release: 1
Source: soprano-%{version}.tar.bz2
Source2: baselibs.conf
soprano-backend-virtuoso.spec: same change
++++++ soprano.spec ++++++
--- /var/tmp/diff_new_pack.4fiN4G/_old 2010-10-07 22:19:52.000000000 +0200
+++ /var/tmp/diff_new_pack.4fiN4G/_new 2010-10-07 22:19:52.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package soprano (Version 2.4.64)
+# spec file for package soprano (Version 2.5.0)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -26,7 +26,7 @@
# COMMON1-BEGIN
BuildRequires: cmake kde4-filesystem libqt4-devel libraptor-devel libredland-devel
BuildRequires: clucene-core-devel doxygen raptor
-Version: 2.4.64
+Version: 2.5.0
Release: 1
Source: soprano-%{version}.tar.bz2
Source2: baselibs.conf
@@ -38,10 +38,10 @@
%description
Soprano is an open and pluggable RDF resource framework which is build
-on top of QT4. It provides RDF storage, RDF parsing, serialization,
+on top of Qt. It provides RDF storage, RDF parsing, serialization,
inference, and full text indexing in a nice C++ API. The main target of
Soprano are desktop applications as it is being developed as a
-subroject of Nepomuk, the semantic desktop initiative.
+subproject of Nepomuk, the semantic desktop initiative.
++++++ soprano-2.4.64.tar.bz2 -> soprano-2.5.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/CMakeLists.txt new/soprano-2.5.0/CMakeLists.txt
--- old/soprano-2.4.64/CMakeLists.txt 2010-07-22 10:45:02.000000000 +0200
+++ new/soprano-2.5.0/CMakeLists.txt 2010-08-06 15:11:29.000000000 +0200
@@ -6,8 +6,8 @@
################## Soprano version ################################
set(CMAKE_SOPRANO_VERSION_MAJOR 2)
-set(CMAKE_SOPRANO_VERSION_MINOR 4)
-set(CMAKE_SOPRANO_VERSION_RELEASE 64)
+set(CMAKE_SOPRANO_VERSION_MINOR 5)
+set(CMAKE_SOPRANO_VERSION_RELEASE 0)
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.4.64/ChangeLog new/soprano-2.5.0/ChangeLog
--- old/soprano-2.4.64/ChangeLog 2010-02-11 13:40:16.000000000 +0100
+++ new/soprano-2.5.0/ChangeLog 2010-07-26 13:51:14.000000000 +0200
@@ -1,3 +1,42 @@
+2.5.0
+ * New public qHash method for Statement
+ * New Node::fromN3 method and operator>> which allows to parse nodes from N3 encoding.
+ * Updated NRL ontology namespace
+ * New operator== for BindingSet
+ * Ported the DBus service watching to QDBusServiceWatcher
+ * Highly improved server socket handling in the local and tcp socket server implementation.
+ * Several improvements in the Virtuoso backend plugin.
+
+2.4.4
+ * Fix to FindIODBC.cmake which ensures that the correct locations are searched first. This
+ allows the usage of a locally installed libiodbc.
+ * Fixed a bug in the Virtuoso backend's query construction code.
+ * Fixed value of AsyncQuery::bindingNames().
+
+2.4.3
+ * Quick and ugly fix for LocalSocketClient::isConnected which actually tries to connect instead
+ of checking if a connection has been established in the current thread.
+
+2.4.2
+ * LocalSocketClient and TcpClient: do not re-establish a connection on model deletion.
+ (This fixes a crash when using a client as a global static)
+ * Properly protect ErrorCache from multithread clashes. (Thanks to Andreas Hartmetz for the patch)
+ * Slight optimizations in the Virtuoso backend.
+ * Do not crash in ClientModel when the connection is lost.
+
+2.4.1
+ * Virtuoso backend:
+ - new parameter "forcedstart" which when set will make the backend shut down
+ any running Virtuoso instance already accessing the storage dir (does not work on Windows).
+ - Shut down Virtuoso using the SIGINT signal (not available on Windows) to ensure
+ a checkpoint.
+ * Allow to build Soprano with -fvisibility=hidden -fvisibility-inlines-hidden (thanks to
+ Modestas Vainius of Debian for the patch)
+ * PkgConfig files for sopranoclient, sopranoserver, and sopranoindex.
+
+2.4.0.1
+ * Fixed a bug in the ClientConnection where mutex was deleted before it had been unlocked.
+
2.4.0
* New methods Client::SparqlModel::listStatementsAsync and Client::SparqlModel::listContextsAsync
* Automatic query prefix expansion in NRLModel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/backends/virtuoso/virtuosobackend.cpp new/soprano-2.5.0/backends/virtuoso/virtuosobackend.cpp
--- old/soprano-2.4.64/backends/virtuoso/virtuosobackend.cpp 2009-12-29 09:49:44.000000000 +0100
+++ new/soprano-2.5.0/backends/virtuoso/virtuosobackend.cpp 2010-08-02 16:05:34.000000000 +0200
@@ -96,10 +96,16 @@
ODBC::ConnectionPool* connectionPool = new ODBC::ConnectionPool( connectString );
// FIXME: should configuration only be allowed on spawned servers?
- ODBC::Connection* conn = connectionPool->connection();
- DatabaseConfigurator configurator( conn );
- configurator.configureServer( settings );
- delete conn;
+ if ( ODBC::Connection* conn = connectionPool->connection() ) {
+ DatabaseConfigurator configurator( conn );
+ configurator.configureServer( settings );
+ delete conn;
+ }
+ else {
+ qDebug() << Q_FUNC_INFO << "Failed to connect to" << connectString;
+ delete connectionPool;
+ return 0;
+ }
VirtuosoModel* model = new VirtuosoModel( connectionPool, this );
// mem mangement the ugly way
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/client/CMakeLists.txt new/soprano-2.5.0/client/CMakeLists.txt
--- old/soprano-2.4.64/client/CMakeLists.txt 2009-11-30 11:13:34.000000000 +0100
+++ new/soprano-2.5.0/client/CMakeLists.txt 2010-08-05 19:43:46.000000000 +0200
@@ -23,12 +23,18 @@
clientstatementiteratorbackend.cpp
clientnodeiteratorbackend.cpp
clientqueryresultiteratorbackend.cpp
- sparql/sparqlmodel.cpp
- sparql/sparqlqueryresult.cpp
- sparql/sparqlprotocol.cpp
- sparql/sparqlxmlresultparser.cpp
)
+if(NOT WINCE)
+ set(soprano_client_SRC
+ ${soprano_client_SRC}
+ sparql/sparqlmodel.cpp
+ sparql/sparqlqueryresult.cpp
+ sparql/sparqlprotocol.cpp
+ sparql/sparqlxmlresultparser.cpp
+ )
+endif(NOT WINCE)
+
if(BUILD_DBUS_SUPPORT)
set(soprano_client_SRC
${soprano_client_SRC}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/soprano/CMakeLists.txt new/soprano-2.5.0/soprano/CMakeLists.txt
--- old/soprano-2.4.64/soprano/CMakeLists.txt 2010-02-09 11:15:34.000000000 +0100
+++ new/soprano-2.5.0/soprano/CMakeLists.txt 2010-07-26 13:45:10.000000000 +0200
@@ -80,6 +80,7 @@
desktopfile.cpp
sopranopluginfile.cpp
sopranodirs.cpp
+ n3nodeparser.cpp
util/extreadwritelock.cpp
util/mutexmodel.cpp
util/mutexstatementiteratorbackend.cpp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/soprano/n3nodeparser.cpp new/soprano-2.5.0/soprano/n3nodeparser.cpp
--- old/soprano-2.4.64/soprano/n3nodeparser.cpp 1970-01-01 01:00:00.000000000 +0100
+++ new/soprano-2.5.0/soprano/n3nodeparser.cpp 2010-07-26 14:18:55.000000000 +0200
@@ -0,0 +1,244 @@
+/*
+ * This file is part of Soprano Project.
+ *
+ * Copyright (C) 2007-2010 Sebastian Trueg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "n3nodeparser.h"
+#include "node.h"
+#include "error.h"
+#include "locator.h"
+#include "vocabulary/rdf.h"
+
+#include
+#include
+
+
+namespace {
+ // an empty delim means: look for space
+ bool scanStream( QTextStream& s, QString* str, const QChar& delim = QChar() )
+ {
+ QChar c;
+ int escapeCnt = 0;
+ while ( 1 ) {
+ if ( s.atEnd() )
+ return false;
+ s >> c;
+ if ( ( delim.isNull() && c.isSpace() ) ||
+ ( c == delim && !escapeCnt ) ) {
+ return true;
+ }
+ else if ( c == '\\') {
+ escapeCnt = ( escapeCnt+1 )%2;
+ }
+ else {
+ escapeCnt = 0;
+ }
+ str->append( c );
+ }
+ }
+
+ QString& decodeLiteral( QString& s )
+ {
+ int pos = 0;
+ while ( 1 ) {
+ pos = s.indexOf( QLatin1String( "\\" ), pos );
+ if ( pos != -1 && s.length() > pos+1 ) {
+ if ( s[pos+1] == '\\' ) {
+ s.remove( pos, 1 );
+ }
+ else if ( s[pos+1] == 'n' ) {
+ s.replace( pos, 2, '\n' );
+ }
+ else if ( s[pos+1] == 'r' ) {
+ s.replace( pos, 2, '\r' );
+ }
+ else if ( s[pos+1] == '\"' ) {
+ s.remove( pos, 1 );
+ }
+ ++pos;
+ }
+ else {
+ break;
+ }
+ }
+ return s;
+ }
+}
+
+
+class Soprano::N3NodeParser::Private
+{
+public:
+ Private()
+ : m_prefixedUriRx( "(\\w+)\\:(\\w+)" ) {
+ }
+
+ // cached prefix reg exp
+ QRegExp m_prefixedUriRx;
+
+ // prefixes that can be used to write something like: "rdf:type"
+ QHash m_prefixes;
+};
+
+
+Soprano::N3NodeParser::N3NodeParser()
+ : d( new Private() )
+{
+}
+
+
+Soprano::N3NodeParser::~N3NodeParser()
+{
+ delete d;
+}
+
+
+void Soprano::N3NodeParser::setNamespacePrefixes( const QHash& prefixes )
+{
+ d->m_prefixes = prefixes;
+}
+
+void Soprano::N3NodeParser::addNamespacePrefix( const QString& bname, const QUrl& ns )
+{
+ d->m_prefixes.insert( bname, ns );
+}
+
+
+Soprano::Node Soprano::N3NodeParser::parseNode( QTextStream& s, Node::N3ParserFlags flags ) const
+{
+ clearError();
+
+ s.skipWhiteSpace();
+
+ Node node;
+
+ // we treat the empty string as an empty node without an error
+ if ( s.atEnd() ) {
+ return Node();
+ }
+
+ QChar c;
+ s >> c;
+
+ // parser resource node
+ // ============================================
+ if ( c == '<' ) {
+ QString str;
+ if ( scanStream( s, &str, '>' ) ) {
+ node = Soprano::Node( QUrl::fromEncoded( str.toAscii(), flags&Node::StrictUris ? QUrl::StrictMode : QUrl::TolerantMode ) );
+ }
+ }
+
+ // parse blank node
+ // ============================================
+ else if ( c == '_' ) {
+ s >> c;
+ if ( c == ':' ) {
+ // TODO: restrict the charset
+ QString str;
+ s >> str;
+ if ( !str.isEmpty() )
+ node = Soprano::Node::createBlankNode( str );
+ }
+ }
+
+ // parse literal node
+ // FIXME: also handle """ as delimiters
+ // ============================================
+ else if ( c == '"' ) {
+ QString val;
+ if ( scanStream( s, &val, '"' ) ) {
+ decodeLiteral( val );
+ if ( s.atEnd() ) {
+ node = LiteralValue::createPlainLiteral( val );
+ }
+ else {
+ QChar c;
+ s >> c;
+ if ( c.isSpace() ) {
+ node = LiteralValue::createPlainLiteral( val );
+ }
+ else if ( c == '@' ) {
+ QString lang;
+ s >> lang;
+ node = LiteralValue::createPlainLiteral( val, lang );
+ }
+ else if ( c == '^' ) {
+ s >> c;
+ if ( c == '^' ) {
+ // recursion: this is a bit evil
+ Node resNode;
+ s >> resNode;
+ if ( resNode.isResource() )
+ node = LiteralValue::fromString( val, resNode.uri() );
+ }
+ }
+ }
+ }
+ }
+
+ // handle a few special strings
+ else {
+ QString token( c );
+ scanStream( s, &token );
+
+ // handle the "a" type
+ if ( token == QLatin1String( "a" ) ) {
+ node = Soprano::Vocabulary::RDF::type();
+ }
+ else if ( !( flags & Node::StrictLiteralTypes ) ) {
+ // boolean values
+ if ( token.toLower() == "false" )
+ node = Soprano::LiteralValue( false );
+ else if ( token.toLower() == "true" )
+ node = Soprano::LiteralValue( true );
+
+ // decimal values
+ bool ok = false;
+ int val = token.toInt( &ok );
+ if ( ok ) {
+ node = Soprano::LiteralValue( val );
+ }
+ double dVal = token.toDouble( &ok );
+ if ( ok ) {
+ node = Soprano::LiteralValue( dVal );
+ }
+ else {
+ node = LiteralValue::createPlainLiteral( token );
+ }
+ }
+ else if ( !( flags & Node::IgnorePrefixes ) &&
+ d->m_prefixedUriRx.exactMatch( token ) ) {
+ const QString bname = d->m_prefixedUriRx.cap( 1 );
+ const QUrl ns = d->m_prefixes[bname];
+ if ( ns.isValid() ) {
+ node = QUrl( ns.toString() + d->m_prefixedUriRx.cap( 2 ) );
+ }
+ else {
+ setError( Error::ParserError( Error::Locator( 0, s.pos() ), QString::fromLatin1("Unknown namespace '%1'.").arg(bname) ) );
+ }
+ }
+ }
+
+ if ( !node.isValid() )
+ setError( Error::ParserError( Error::Locator( 0, s.pos() ),
+ QString::fromLatin1( "Got '%1'. Expected one of '<', '\"', '_', 'a'." ).arg( c ) ) );
+
+ return node;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/soprano/n3nodeparser.h new/soprano-2.5.0/soprano/n3nodeparser.h
--- old/soprano-2.4.64/soprano/n3nodeparser.h 1970-01-01 01:00:00.000000000 +0100
+++ new/soprano-2.5.0/soprano/n3nodeparser.h 2010-07-26 14:18:55.000000000 +0200
@@ -0,0 +1,81 @@
+/*
+ * This file is part of Soprano Project.
+ *
+ * Copyright (C) 2007-2010 Sebastian Trueg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _SOPRANO_N3_NODE_PARSER_H_
+#define _SOPRANO_N3_NODE_PARSER_H_
+
+#include
+#include
+#include
+#include
+
+#include "error.h"
+#include "node.h"
+
+namespace Soprano {
+
+ class Node;
+
+ /**
+ * \brief Parser which converts N3 string representation of nodes into
+ * Node objects.
+ *
+ * This class is NOT PUBLIC API and probably never will be.
+ *
+ * \author Sebastian Trueg
+ */
+ class N3NodeParser : public Error::ErrorCache
+ {
+ public:
+ /**
+ * Create a new N3 node parser
+ */
+ N3NodeParser();
+
+ /**
+ * Destructor
+ */
+ ~N3NodeParser();
+
+ void setNamespacePrefixes( const QHash& bnames );
+ void addNamespacePrefix( const QString& abbr, const QUrl& ns );
+
+ /**
+ * Parse a node from its N3 representation.
+ *
+ * \param s The stream to read the node from.
+ * \param flags An optional set of flags which influence the behaviour of the
+ * parser.
+ *
+ * \return \p The parsed node if it could be successfully parsed or an invalid
+ * node otherwise. In the latter case Error::lastError() provides more details
+ * on the parsing error. Be aware that the empty string will be treated as an
+ * empty node and seen as a successful parse.
+ */
+ Soprano::Node parseNode( QTextStream& s, Node::N3ParserFlags flags = Node::NoFlags ) const;
+
+ private:
+ class Private;
+ Private* const d;
+ };
+}
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/soprano/node.cpp new/soprano-2.5.0/soprano/node.cpp
--- old/soprano-2.4.64/soprano/node.cpp 2010-01-12 19:58:46.000000000 +0100
+++ new/soprano-2.5.0/soprano/node.cpp 2010-07-26 14:18:55.000000000 +0200
@@ -21,6 +21,7 @@
*/
#include "node.h"
+#include "n3nodeparser.h"
#include
#include
@@ -349,34 +350,42 @@
}
+// static
Soprano::Node Soprano::Node::createEmptyNode()
{
return Node();
}
+// static
Soprano::Node Soprano::Node::createResourceNode( const QUrl& uri )
{
return Node( uri );
}
+// static
Soprano::Node Soprano::Node::createBlankNode( const QString& id )
{
return Node( id );
}
+
+// static
Soprano::Node Soprano::Node::createLiteralNode( const LiteralValue& val )
{
return Node( val );
}
+
+// static
Soprano::Node Soprano::Node::createLiteralNode( const LiteralValue& val, const QString& language )
{
return Node( LiteralValue::createPlainLiteral( val.toString(), language ) );
}
+// static
QString Soprano::Node::resourceToN3( const QUrl& uri )
{
QByteArray a = uri.toEncoded();
@@ -384,6 +393,7 @@
}
+// static
QString Soprano::Node::blankToN3( const QString& blank )
{
if ( blank.isEmpty() )
@@ -393,6 +403,7 @@
}
+// static
QString Soprano::Node::literalToN3( const LiteralValue& literal )
{
//
@@ -425,6 +436,23 @@
}
+// static
+Soprano::Node Soprano::Node::fromN3( const QString& s, N3ParserFlags flags )
+{
+ QString str( s );
+ QTextStream stream( &str );
+ return fromN3Stream( stream, flags );
+}
+
+
+// static
+Soprano::Node Soprano::Node::fromN3Stream( QTextStream& stream, N3ParserFlags flags )
+{
+ N3NodeParser p;
+ return p.parseNode( stream, flags );
+}
+
+
QDebug operator<<( QDebug s, const Soprano::Node& n )
{
switch( n.type() ) {
@@ -452,6 +480,14 @@
return s;
}
+
+QTextStream& operator>>( QTextStream& s, Soprano::Node& n )
+{
+ Soprano::N3NodeParser p;
+ n = p.parseNode( s );
+ return s;
+}
+
uint Soprano::qHash( const Soprano::Node& node )
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/soprano/node.h new/soprano-2.5.0/soprano/node.h
--- old/soprano-2.4.64/soprano/node.h 2010-01-12 19:58:46.000000000 +0100
+++ new/soprano-2.5.0/soprano/node.h 2010-07-26 14:18:55.000000000 +0200
@@ -307,7 +307,7 @@
* \return A string representing the node in N3 encoding or an empty
* string for invalid nodes.
*
- * \sa toString()
+ * \sa resourceToN3(), literalToN3(), blankToN3(), fromN3(), toString()
*
* \since 2.2
*/
@@ -394,7 +394,7 @@
* http://soprano.sourceforce.net/
* \endcode
*
- * \sa toN3
+ * \sa toN3(), fromN3()
*
* \since 2.3
*/
@@ -411,7 +411,7 @@
* _:blankNode
* \endcode
*
- * \sa toN3
+ * \sa toN3(), fromN3()
*
* \since 2.3
*/
@@ -429,12 +429,74 @@
* "09-08-1977T17:42.234Z"^^http://www.w3.org/2001/XMLSchema#dateTime
* \endcode
*
- * \sa toN3
+ * \sa toN3(), fromN3()
*
* \since 2.3
*/
static QString literalToN3( const LiteralValue& literal );
+ /**
+ * Parsing flags to infuence the behaviour of the parser in
+ * fromN3() and fromN3Stream().
+ *
+ * \since 2.5
+ */
+ enum N3ParserFlag {
+ /**
+ * No parsing flags, default behaviour.
+ */
+ NoFlags = 0x0,
+
+ /**
+ * Use strict literal parsing, i.e. do not treat
+ * \p true and \p false as boolean literals or
+ * do not handle numbers as literals if they do
+ * not contain a literal type.
+ */
+ StrictLiteralTypes = 0x1,
+
+ /**
+ * Use strict URI parsing.
+ *
+ * \sa QUrl::StrictMode
+ */
+ StrictUris = 0x2,
+
+ /**
+ * Do not make use of m_prefixes
+ */
+ IgnorePrefixes = 0x4
+ };
+ Q_DECLARE_FLAGS( N3ParserFlags, N3ParserFlag )
+
+ /**
+ * Convert a node from its N3 representation.
+ *
+ * \param n3 The N3 representation of the node.
+ *
+ * \return A %Node representing the parsed version of \p n3 or an invalid %Node in case
+ * parsing failed.
+ *
+ * \sa resourceToN3(), literalToN3(), blankToN3(), toN3()
+ *
+ * \since 2.5
+ */
+ static Node fromN3( const QString& n3, N3ParserFlags flags = NoFlags );
+
+ /**
+ * Read a node from its N3 representation on a stream.
+ *
+ * \param stream The stream from which the N3 representation of the node will be read.
+ *
+ * \return A %Node representing the parsed version of \p n3 or an invalid %Node in case
+ * parsing failed.
+ *
+ * \sa resourceToN3(), literalToN3(), blankToN3(), toN3()
+ *
+ * \since 2.5
+ */
+ static Node fromN3Stream( QTextStream& stream, N3ParserFlags flags = NoFlags );
+
private:
class NodeData;
class ResourceNodeData;
@@ -464,8 +526,19 @@
*/
SOPRANO_EXPORT QTextStream& operator<<( QTextStream& s, const Soprano::Node& );
+/**
+ * Read a node from an N3 encoded string.
+ *
+ * \sa Soprano::Node::fromN3()
+ *
+ * \since 2.5
+ */
+SOPRANO_EXPORT QTextStream& operator>>( QTextStream& s, Soprano::Node& );
+
#if QT_VERSION < 0x040700
SOPRANO_EXPORT uint qHash( const QUrl& url );
#endif
+Q_DECLARE_OPERATORS_FOR_FLAGS( Soprano::Node::N3ParserFlags )
+
#endif // SOPRANO_NODE_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/test/CMakeLists.txt new/soprano-2.5.0/test/CMakeLists.txt
--- old/soprano-2.4.64/test/CMakeLists.txt 2010-06-01 13:59:57.000000000 +0200
+++ new/soprano-2.5.0/test/CMakeLists.txt 2010-07-26 13:45:10.000000000 +0200
@@ -30,6 +30,12 @@
target_link_libraries(nodetest soprano ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY})
add_test(nodetest ${EXECUTABLE_OUTPUT_PATH}/nodetest)
+# N3 Node parser
+qt4_automoc(n3nodeparsertest n3nodeparsertest.cpp)
+add_executable(n3nodeparsertest n3nodeparsertest.cpp)
+target_link_libraries(n3nodeparsertest soprano ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY})
+add_test(n3nodeparsertest ${EXECUTABLE_OUTPUT_PATH}/n3nodeparsertest)
+
# Literals
qt4_automoc(literaltest sopranoliteraltest.cpp)
add_executable(literaltest sopranoliteraltest.cpp)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/test/n3nodeparsertest.cpp new/soprano-2.5.0/test/n3nodeparsertest.cpp
--- old/soprano-2.4.64/test/n3nodeparsertest.cpp 1970-01-01 01:00:00.000000000 +0100
+++ new/soprano-2.5.0/test/n3nodeparsertest.cpp 2010-07-26 13:45:10.000000000 +0200
@@ -0,0 +1,58 @@
+/*
+ * This file is part of Soprano Project.
+ *
+ * Copyright (C) 2010 Sebastian Trueg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "n3nodeparsertest.h"
+#include "node.h"
+#include "literalvalue.h"
+
+#include
+
+Q_DECLARE_METATYPE( Soprano::Node )
+
+using namespace Soprano;
+
+void N3NodeParserTest::testToFromN3_data()
+{
+ QTest::addColumnSoprano::Node( "node" );
+
+ QTest::newRow( "empty" ) << Node();
+ QTest::newRow( "resource" ) << Node( QUrl( "http://soprano.test.org#A" ) );
+ QTest::newRow( "blank" ) << Node::createBlankNode( "blank" );
+ QTest::newRow( "plain literal" ) << Node( LiteralValue::createPlainLiteral( "Hello World" ) );
+ QTest::newRow( "plain literal de" ) << Node( LiteralValue::createPlainLiteral( "Hallo Welt", "de" ) );
+ QTest::newRow( "types literal string" ) << Node( LiteralValue( "Hello World" ) );
+ QTest::newRow( "types literal int" ) << Node( LiteralValue( 42 ) );
+ QTest::newRow( "types literal double" ) << Node( LiteralValue( 42.2 ) );
+ QTest::newRow( "types literal string with escaped" ) << Node( LiteralValue( "Hello \"World\"" ) );
+}
+
+
+void N3NodeParserTest::testToFromN3()
+{
+ QFETCH( Node, node );
+
+ QCOMPARE( node, Node::fromN3( node.toN3() ) );
+}
+
+
+QTEST_MAIN( N3NodeParserTest )
+
+#include "n3nodeparsertest.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/test/n3nodeparsertest.h new/soprano-2.5.0/test/n3nodeparsertest.h
--- old/soprano-2.4.64/test/n3nodeparsertest.h 1970-01-01 01:00:00.000000000 +0100
+++ new/soprano-2.5.0/test/n3nodeparsertest.h 2010-07-26 13:45:10.000000000 +0200
@@ -0,0 +1,36 @@
+/*
+ * This file is part of Soprano Project.
+ *
+ * Copyright (C) 2010 Sebastian Trueg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <QObject>
+
+#ifndef N3_NODE_PARSER_TEST_H
+#define N3_NODE_PARSER_TEST_H
+
+class N3NodeParserTest: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void testToFromN3_data();
+ void testToFromN3();
+};
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/soprano-2.4.64/tools/sopranocmd.cpp new/soprano-2.5.0/tools/sopranocmd.cpp
--- old/soprano-2.4.64/tools/sopranocmd.cpp 2010-04-28 09:00:41.000000000 +0200
+++ new/soprano-2.5.0/tools/sopranocmd.cpp 2010-08-05 19:43:46.000000000 +0200
@@ -53,7 +53,9 @@
#include "../client/dbus/dbusclient.h"
#include "../client/dbus/dbusmodel.h"
#endif
+#ifndef _WIN32_WCE
#include "../client/sparql/sparqlmodel.h"
+#endif
#ifndef _WIN32_WCE
#include
@@ -733,6 +735,7 @@
bool isRemoteModel = false;
+#ifndef _WIN32_WCE
if ( args.hasSetting( "sparql" ) ) {
QUrl sparqlEndPoint = args.getSetting( "sparql" );
QString userName = args.getSetting( "username", sparqlEndPoint.userName() );
@@ -750,7 +753,9 @@
s_model = sparqlModel;
isRemoteModel = true;
}
- else if ( args.hasSetting( "port" ) &&
+ else
+#endif
+ if ( args.hasSetting( "port" ) &&
!args.hasSetting( "backend" ) ) {
QHostAddress host = QHostAddress::LocalHost;
quint16 port = Soprano::Client::TcpClient::DEFAULT_PORT;
++++++ soprano-backend-sesame.spec.in ++++++
--- /var/tmp/diff_new_pack.4fiN4G/_old 2010-10-07 22:19:53.000000000 +0200
+++ /var/tmp/diff_new_pack.4fiN4G/_new 2010-10-07 22:19:53.000000000 +0200
@@ -20,7 +20,7 @@
Name: soprano-backend-sesame
Url: http://soprano.sourceforge.net/
BuildRequires: java-devel fdupes 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
++++++ soprano-backend-virtuoso.spec.in ++++++
--- /var/tmp/diff_new_pack.4fiN4G/_old 2010-10-07 22:19:53.000000000 +0200
+++ /var/tmp/diff_new_pack.4fiN4G/_new 2010-10-07 22:19:53.000000000 +0200
@@ -20,7 +20,7 @@
Name: soprano-backend-virtuoso
Url: http://soprano.sourceforge.net/
BuildRequires: fdupes 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
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org