Soprano  2.8.0
Public Member Functions
Soprano::Util::DummyModel Class Reference

A dummy model. All its methods do nothing and always fail with a default error. More...

#include <Soprano/Util/DummyModel>

+ Inheritance diagram for Soprano::Util::DummyModel:

List of all members.

Public Member Functions

 DummyModel ()
 ~DummyModel ()
Error::ErrorCode addStatement (const Statement &statement)
Error::ErrorCode addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Error::ErrorCode addStatements (const QList< Statement > &statements)
Error::ErrorCode removeStatement (const Statement &statement)
Error::ErrorCode removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Error::ErrorCode removeAllStatements (const Statement &statement)
Error::ErrorCode removeStatements (const QList< Statement > &statements)
Error::ErrorCode removeContext (const Node &)
Error::ErrorCode removeAllStatements ()
StatementIterator listStatements (const Statement &partial) const
StatementIterator listStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
StatementIterator listStatements () const
StatementIterator listStatementsInContext (const Node &context) const
NodeIterator listContexts () const
QueryResultIterator executeQuery (const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
bool containsAnyStatement (const Statement &statement) const
bool containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
bool containsStatement (const Statement &statement) const
bool containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
bool containsContext (const Node &context) const
bool isEmpty () const
int statementCount () const
Error::ErrorCode write (QTextStream &os) const
Node createBlankNode ()

Detailed Description

A dummy model. All its methods do nothing and always fail with a default error.

A dummy model might be useful in situations where a null pointer could lead to crashes if creating a real model fails.

Author:
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org

Definition at line 42 of file dummymodel.h.


Constructor & Destructor Documentation

Create a new dummy model.

destructor


Member Function Documentation

Add the Statement to the Model.

Parameters:
statementThe Statement to add.

Implements Soprano::Model.

Error::ErrorCode Soprano::Util::DummyModel::addStatement ( const Node subject,
const Node predicate,
const Node object,
const Node context = Node() 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from Soprano::Model.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from Soprano::Model.

Remove one statement. For removing statements with wildward matching see removeAllStatements().

Parameters:
statementThe statement that should be removed. This has to be a valid statement.
Returns:
Error::ErrorNone on success and an error code if statement was invalid or an error occured.

Implements Soprano::Model.

Error::ErrorCode Soprano::Util::DummyModel::removeStatement ( const Node subject,
const Node predicate,
const Node object,
const Node context = Node() 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from Soprano::Model.

Remove all statements that match the partial statement. For removing one specific statement see removeStatement().

Parameters:
statementA possible partially defined statement that serves as a filter for all statements that should be removed.

Implements Soprano::Model.

Convenience method which removes all statements in statements.

Reimplemented from Soprano::Model.

Convenience method that removes all statements in the context.

Reimplemented from Soprano::Model.

Convenience method that clear the Model of all statements

Reimplemented from Soprano::Model.

Return an iterator over Model Statements that "partial" match the input Statement.

Parameters:
partialThe partial Statement to match.
Returns:
An iterator for all the matched Statements, on error an invalid iterator is returned.

Implements Soprano::Model.

StatementIterator Soprano::Util::DummyModel::listStatements ( const Node subject,
const Node predicate,
const Node object,
const Node context = Node() 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
subjectThe subject node to match. Can be empty as a wildcard.
predicateThe predicate node to match. Can be empty as a wildcard.
objectThe object node to match. Can be empty as a wildcard.
contextThe context node to match. Can be empty as a wildcard.
Returns:
An iterator for all the matched Statements, on error an invalid iterator is returned.

Reimplemented from Soprano::Model.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns:
An iterator for all statements in the model, on error an invalid iterator is returned.

Reimplemented from Soprano::Model.

Convenience method which lists all statements in context.

Returns:
An iterator for all the matched Statements, on error an invalid iterator is returned.

Reimplemented from Soprano::Model.

List all contexts in the model, i.e. all named graphs.

Returns:
An iterator over context Nodes, on error an invalid iterator is returned.

Implements Soprano::Model.

QueryResultIterator Soprano::Util::DummyModel::executeQuery ( const QString query,
Query::QueryLanguage  language,
const QString userQueryLanguage = QString() 
) const [virtual]

query_api_disabled Execute the given query over the Model.

This is a const read-only method. As such Model implementations should not support SPARQL extensions such as INSERT or UPDATE through this method. A future version of Soprano will provide an additional API for queries that change the Model.

Parameters:
queryThe query to evaluate.
languageThe query language used to encode query.
userQueryLanguageIf language equals Query::QueryLanguageUser userQueryLanguage defines the language to use.
Returns:
An iterator over all results matching the query, on error an invalid iterator is returned.

Implements Soprano::Model.

bool Soprano::Util::DummyModel::containsAnyStatement ( const Statement statement) const [virtual]

Check if the model contains certain statements.

Parameters:
statementA partially defined statement that serves as a pattern.
Returns:
true if the Model contains a Statement matching the given statement pattern.

Implements Soprano::Model.

bool Soprano::Util::DummyModel::containsAnyStatement ( const Node subject,
const Node predicate,
const Node object,
const Node context = Node() 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
subjectThe subject node to match. Can be empty as a wildcard.
predicateThe predicate node to match. Can be empty as a wildcard.
objectThe object node to match. Can be empty as a wildcard.
contextThe context node to match. Can be empty as a wildcard.

Reimplemented from Soprano::Model.

bool Soprano::Util::DummyModel::containsStatement ( const Statement statement) const [virtual]

Check if the model contains a statements.

Parameters:
statementThe statement in question. This has to be a valid statement, i.e. subject, predicate, and object need to be defined. If the context node is empty the default graph is searched.
Returns:
true if the Model contains the Statement, false otherwise or is statement is invalid.

Implements Soprano::Model.

bool Soprano::Util::DummyModel::containsStatement ( const Node subject,
const Node predicate,
const Node object,
const Node context = Node() 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from Soprano::Model.

bool Soprano::Util::DummyModel::containsContext ( const Node context) const

Convenience method which is based on containsAnyStatement

Reimplemented from Soprano::Model.

bool Soprano::Util::DummyModel::isEmpty ( ) const [virtual]
Returns:
true if the Model doesn't contains any Statement.

Implements Soprano::Model.

The number of statements stored in this Model.

Returns:
The size of the Model, or -1 on error.

Implements Soprano::Model.

Write all statements in this Model to os.

Default implementation is based on Model::listStatements

Reimplemented from Soprano::Model.

Creates a new blank node with a unique identifier.

Returns:
A blank node that can be used to create new statements.

Implements Soprano::Model.


The documentation for this class was generated from the following file: