node.h | node.h | |||
---|---|---|---|---|
skipping to change at line 310 | skipping to change at line 310 | |||
* \code | * \code | |||
* <http://soprano.sourceforce.net/> | * <http://soprano.sourceforce.net/> | |||
* "Hello World"^^<http://www.w3.org/2001/XMLSchema#string> | * "Hello World"^^<http://www.w3.org/2001/XMLSchema#string> | |||
* "09-08-1977T17:42.234Z"^^<http://www.w3.org/2001/XMLSchema#dateT ime> | * "09-08-1977T17:42.234Z"^^<http://www.w3.org/2001/XMLSchema#dateT ime> | |||
* _:blankNode | * _:blankNode | |||
* \endcode | * \endcode | |||
* | * | |||
* \return A string representing the node in N3 encoding or an empt y | * \return A string representing the node in N3 encoding or an empt y | |||
* string for invalid nodes. | * string for invalid nodes. | |||
* | * | |||
* \sa toString() | * \sa resourceToN3(), literalToN3(), blankToN3(), fromN3(), toStri ng() | |||
* | * | |||
* \since 2.2 | * \since 2.2 | |||
*/ | */ | |||
QString toN3() const; | QString toN3() const; | |||
//@} | //@} | |||
/** | /** | |||
* Convenience method to create an empty node. | * Convenience method to create an empty node. | |||
* Using this method instead of the default constructor | * Using this method instead of the default constructor | |||
* may result in better readable code. | * may result in better readable code. | |||
skipping to change at line 397 | skipping to change at line 397 | |||
* Format a resource URI as N3 string to be used in SPARQL queries. | * Format a resource URI as N3 string to be used in SPARQL queries. | |||
* | * | |||
* \return A string representing the resource in N3 encoding or an empty | * \return A string representing the resource in N3 encoding or an empty | |||
* string for invalid URIs. | * string for invalid URIs. | |||
* | * | |||
* Example: | * Example: | |||
* \code | * \code | |||
* <http://soprano.sourceforce.net/> | * <http://soprano.sourceforce.net/> | |||
* \endcode | * \endcode | |||
* | * | |||
* \sa toN3 | * \sa toN3(), fromN3() | |||
* | * | |||
* \since 2.3 | * \since 2.3 | |||
*/ | */ | |||
static QString resourceToN3( const QUrl& resource ); | static QString resourceToN3( const QUrl& resource ); | |||
/** | /** | |||
* Format a blank node identifier as N3 string to be used in SPARQL queries. | * Format a blank node identifier as N3 string to be used in SPARQL queries. | |||
* | * | |||
* \return A string representing the blank identifier in N3 encodin g or an empty | * \return A string representing the blank identifier in N3 encodin g or an empty | |||
* string for invalid/empty ids. | * string for invalid/empty ids. | |||
* | * | |||
* Example: | * Example: | |||
* \code | * \code | |||
* _:blankNode | * _:blankNode | |||
* \endcode | * \endcode | |||
* | * | |||
* \sa toN3 | * \sa toN3(), fromN3() | |||
* | * | |||
* \since 2.3 | * \since 2.3 | |||
*/ | */ | |||
static QString blankToN3( const QString& blank ); | static QString blankToN3( const QString& blank ); | |||
/** | /** | |||
* Format a literal value as N3 string to be used in SPARQL queries . | * Format a literal value as N3 string to be used in SPARQL queries . | |||
* | * | |||
* \return A string representing the literal in N3 encoding or an e mpty | * \return A string representing the literal in N3 encoding or an e mpty | |||
* string for invalid literals. | * string for invalid literals. | |||
* | * | |||
* Examples: | * Examples: | |||
* \code | * \code | |||
* "Hello World"^^<http://www.w3.org/2001/XMLSchema#string> | * "Hello World"^^<http://www.w3.org/2001/XMLSchema#string> | |||
* "09-08-1977T17:42.234Z"^^<http://www.w3.org/2001/XMLSchema#dateT ime> | * "09-08-1977T17:42.234Z"^^<http://www.w3.org/2001/XMLSchema#dateT ime> | |||
* \endcode | * \endcode | |||
* | * | |||
* \sa toN3 | * \sa toN3(), fromN3() | |||
* | * | |||
* \since 2.3 | * \since 2.3 | |||
*/ | */ | |||
static QString literalToN3( const LiteralValue& literal ); | 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 i | ||||
nvalid %Node in case | ||||
* parsing failed. | ||||
* | ||||
* \sa resourceToN3(), literalToN3(), blankToN3(), toN3() | ||||
* | ||||
* \since 2.5 | ||||
*/ | ||||
static Node fromN3( const QString& n3, N3ParserFlags flags = NoFlag | ||||
s ); | ||||
/** | ||||
* 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 i | ||||
nvalid %Node in case | ||||
* parsing failed. | ||||
* | ||||
* \sa resourceToN3(), literalToN3(), blankToN3(), toN3() | ||||
* | ||||
* \since 2.5 | ||||
*/ | ||||
static Node fromN3Stream( QTextStream& stream, N3ParserFlags flags | ||||
= NoFlags ); | ||||
private: | private: | |||
class NodeData; | class NodeData; | |||
class ResourceNodeData; | class ResourceNodeData; | |||
class BNodeData; | class BNodeData; | |||
class LiteralNodeData; | class LiteralNodeData; | |||
QSharedDataPointer<NodeData> d; | QSharedDataPointer<NodeData> d; | |||
}; | }; | |||
/** | /** | |||
* \relates Soprano::Node | * \relates Soprano::Node | |||
skipping to change at line 467 | skipping to change at line 529 | |||
/** | /** | |||
* Default Soprano::Node stream operator. The operator serializes the Node | * Default Soprano::Node stream operator. The operator serializes the Node | |||
* based on the N-Triples standard, except that it uses Unicode strings. | * based on the N-Triples standard, except that it uses Unicode strings. | |||
* | * | |||
* \sa Soprano::Node::toN3() | * \sa Soprano::Node::toN3() | |||
* | * | |||
* \relates Soprano::Node | * \relates Soprano::Node | |||
*/ | */ | |||
SOPRANO_EXPORT QTextStream& operator<<( QTextStream& s, const Soprano::Node & ); | 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 | #if QT_VERSION < 0x040700 | |||
SOPRANO_EXPORT uint qHash( const QUrl& url ); | SOPRANO_EXPORT uint qHash( const QUrl& url ); | |||
#endif | #endif | |||
Q_DECLARE_OPERATORS_FOR_FLAGS( Soprano::Node::N3ParserFlags ) | ||||
#endif // SOPRANO_NODE_H | #endif // SOPRANO_NODE_H | |||
End of changes. 7 change blocks. | ||||
4 lines changed or deleted | 82 lines changed or added | |||
version.h | version.h | |||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
* Boston, MA 02110-1301, USA. | * Boston, MA 02110-1301, USA. | |||
*/ | */ | |||
#ifndef _SOPRANO_VERSION_H_ | #ifndef _SOPRANO_VERSION_H_ | |||
#define _SOPRANO_VERSION_H_ | #define _SOPRANO_VERSION_H_ | |||
#include "soprano_export.h" | #include "soprano_export.h" | |||
/// @brief Soprano version as string at compile time. | /// @brief Soprano version as string at compile time. | |||
#define SOPRANO_VERSION_STRING "2.4.64" | #define SOPRANO_VERSION_STRING "2.5.0" | |||
/// @brief The major Soprano version number at compile time | /// @brief The major Soprano version number at compile time | |||
#define SOPRANO_VERSION_MAJOR 2 | #define SOPRANO_VERSION_MAJOR 2 | |||
/// @brief The minor Soprano version number at compile time | /// @brief The minor Soprano version number at compile time | |||
#define SOPRANO_VERSION_MINOR 4 | #define SOPRANO_VERSION_MINOR 5 | |||
/// @brief The Soprano release version number at compile time | /// @brief The Soprano release version number at compile time | |||
#define SOPRANO_VERSION_RELEASE 64 | #define SOPRANO_VERSION_RELEASE 0 | |||
/** | /** | |||
* \brief Create a unique number from the major, minor and release number o f a %Soprano version | * \brief Create a unique number from the major, minor and release number o f a %Soprano version | |||
* | * | |||
* This function can be used for preprocessing. For version information at runtime | * This function can be used for preprocessing. For version information at runtime | |||
* use the version methods in the Soprano namespace. | * use the version methods in the Soprano namespace. | |||
*/ | */ | |||
#define SOPRANO_MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c)) | #define SOPRANO_MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c)) | |||
/** | /** | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||