Soprano 2.9.4
|
A FilterModel is a virtual model that wraps another Model. More...
#include <Soprano/FilterModel>
Public Member Functions | |
virtual | ~FilterModel () |
virtual void | setParentModel (Model *model) |
virtual Model * | parentModel () const |
virtual Error::ErrorCode | addStatement (const Statement &statement) |
Error::ErrorCode | addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
virtual Error::ErrorCode | removeStatement (const Statement &statement) |
Error::ErrorCode | removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
virtual Error::ErrorCode | removeAllStatements (const Statement &statement) |
Error::ErrorCode | removeAllStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
virtual StatementIterator | listStatements (const Statement &partial) const |
StatementIterator | listStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
virtual NodeIterator | listContexts () const |
virtual QueryResultIterator | executeQuery (const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const |
virtual bool | containsStatement (const Statement &statement) const |
bool | containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
virtual bool | containsAnyStatement (const Statement &statement) const |
bool | containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
virtual bool | isEmpty () const |
virtual int | statementCount () const |
virtual Error::ErrorCode | write (QTextStream &os) const |
virtual Node | createBlankNode () |
virtual Error::ErrorCode | addStatement (const Statement &statement)=0 |
Error::ErrorCode | addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
virtual Error::ErrorCode | removeStatement (const Statement &statement)=0 |
Error::ErrorCode | removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
virtual Error::ErrorCode | removeAllStatements (const Statement &statement)=0 |
Error::ErrorCode | removeAllStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
Error::ErrorCode | removeAllStatements () |
virtual StatementIterator | listStatements (const Statement &partial) const=0 |
StatementIterator | listStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
StatementIterator | listStatements () const |
virtual bool | containsStatement (const Statement &statement) const=0 |
bool | containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
virtual bool | containsAnyStatement (const Statement &statement) const=0 |
bool | containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
![]() | |
virtual | ~Model () |
virtual Error::ErrorCode | addStatement (const Statement &statement)=0 |
Error::ErrorCode | addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
Error::ErrorCode | addStatements (const QList< Statement > &statements) |
virtual Error::ErrorCode | removeStatement (const Statement &statement)=0 |
Error::ErrorCode | removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
virtual Error::ErrorCode | removeAllStatements (const Statement &statement)=0 |
Error::ErrorCode | removeAllStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
Error::ErrorCode | removeStatements (const QList< Statement > &statements) |
Error::ErrorCode | removeContext (const Node &) |
Error::ErrorCode | removeAllStatements () |
virtual StatementIterator | listStatements (const Statement &partial) const =0 |
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 |
virtual NodeIterator | listContexts () const =0 |
virtual QueryResultIterator | executeQuery (const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const =0 |
virtual bool | containsAnyStatement (const Statement &statement) const =0 |
bool | containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
virtual bool | containsStatement (const Statement &statement) const =0 |
bool | containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
bool | containsContext (const Node &context) const |
virtual bool | isEmpty () const =0 |
virtual int | statementCount () const =0 |
virtual Error::ErrorCode | write (QTextStream &os) const |
virtual Node | createBlankNode ()=0 |
![]() | |
QObject (QObject *parent=0) | |
blockSignals (bool block) | |
childEvent (QChildEvent *event) | |
children () | |
connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection) | |
connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection) | |
connectNotify (const char *signal) | |
customEvent (QEvent *event) | |
deleteLater () | |
destroyed (QObject *obj=0) | |
disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) | |
disconnect (const char *signal=0, const QObject *receiver=0, const char *method=0) | |
disconnect (const QObject *receiver, const char *method=0) | |
disconnectNotify (const char *signal) | |
dumpObjectInfo () | |
dumpObjectTree () | |
dynamicPropertyNames () | |
event (QEvent *e) | |
eventFilter (QObject *watched, QEvent *event) | |
findChild (const QString &name=QString() | |
findChildren (const QString &name=QString() | |
findChildren (const QRegExp ®Exp) | |
inherits (const char *className) | |
installEventFilter (QObject *filterObj) | |
isWidgetType () | |
killTimer (int id) | |
metaObject () | |
moveToThread (QThread *targetThread) | |
parent () | |
property (const char *name) | |
receivers (const char *signal) | |
removeEventFilter (QObject *obj) | |
sender () | |
setParent (QObject *parent) | |
setProperty (const char *name, const QVariant &value) | |
signalsBlocked () | |
startTimer (int interval) | |
thread () | |
timerEvent (QTimerEvent *event) | |
tr (const char *sourceText, const char *comment=0, int n=-1) | |
trUtf8 (const char *sourceText, const char *comment=0, int n=-1) | |
staticMetaObject | |
QObject (QObject *parent, const char *name) | |
checkConnectArgs (const char *signal, const QObject *object, const char *method) | |
child (const char *objName, const char *inheritsClass=0, bool recursiveSearch=true) | |
className () | |
insertChild (QObject *object) | |
isA (const char *className) | |
name () | |
name (const char *defaultName) | |
normalizeSignalSlot (const char *signalSlot) | |
removeChild (QObject *object) | |
setName (const char *name) | |
![]() | |
virtual | ~ErrorCache () |
virtual Error | lastError () const |
Protected Member Functions | |
FilterModel () | |
FilterModel (Model *parent) | |
virtual void | parentStatementsAdded () |
virtual void | parentStatementsRemoved () |
virtual void | parentStatementAdded (const Statement &) |
virtual void | parentStatementRemoved (const Statement &) |
![]() | |
Model () | |
![]() | |
ErrorCache () | |
void | clearError () const |
void | setError (const Error &) const |
void | setError (const QString &errorMessage, int code=ErrorUnknown) const |
Additional Inherited Members | |
![]() | |
void | statementsAdded () |
void | statementsRemoved () |
void | statementAdded (const Soprano::Statement &statement) |
void | statementRemoved (const Soprano::Statement &statement) |
A FilterModel is a virtual model that wraps another Model.
FilterModels can be stacked to provide filtering on each of the Model's methods. A FilterModel has a parent model which is the data base for this filter. The parent can be an actual StorageModel or another FilterModel.
Error handling:
The FilterModel "inherits" its parent Model's errors, i.e. FilterModel::lastError() always equals FilterModel::parent()->lastError() (If the FilterModel implementations are called in subclasses).
Definition at line 48 of file filtermodel.h.
|
virtual |
Destructor
|
protected |
Create an empty filter model.
|
protected |
Create a new FilterModel which works on parent. Calls setParentModel.
parent | The parent Model. |
|
virtual |
|
virtual |
Get the parent model.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
Reimplemented in Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Util::MutexModel, Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
Error::ErrorCode Soprano::FilterModel::addStatement | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) |
Reimplemented for convenience. Calls Model::addStatement(const Node&,const Node&,const Node&,const Node&)
|
virtual |
Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
Reimplemented in Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Util::MutexModel, Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
Error::ErrorCode Soprano::FilterModel::removeStatement | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) |
Reimplemented for convenience. Calls Model::removeStatement(const Node&,const Node&,const Node&,const Node&)
|
virtual |
Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
Reimplemented in Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::NRLModel, Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Util::MutexModel, Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
Error::ErrorCode Soprano::FilterModel::removeAllStatements | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) |
Reimplemented for convenience. Calls Model::removeAllStatements(const Node&,const Node&,const Node&,const Node&)
|
virtual |
Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
Reimplemented in Soprano::Util::AsyncModel, Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Util::MutexModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
StatementIterator Soprano::FilterModel::listStatements | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) | const |
Reimplemented for convenience. Calls Model::listStatements(const Node&,const Node&,const Node&,const Node&)
|
virtual |
Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
Reimplemented in Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
|
virtual |
Default implementation simply pipes the call through to the parent model. Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
Reimplemented in Soprano::Index::IndexFilterModel, Soprano::NRLModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
Reimplemented in Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Util::MutexModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
bool Soprano::FilterModel::containsStatement | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) | const |
Reimplemented for convenience. Calls Model::containsStatement(const Node&,const Node&,const Node&,const Node&)
|
virtual |
Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
Reimplemented in Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Util::MutexModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
bool Soprano::FilterModel::containsAnyStatement | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) | const |
Reimplemented for convenience. Calls Model::containsAnyStatement(const Node&,const Node&,const Node&,const Node&)
|
virtual |
Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
Reimplemented in Soprano::Util::MutexModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
Reimplemented in Soprano::Util::MutexModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::Model.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Implements Soprano::Model.
|
protectedvirtual |
Handle a statementsAdded() signal from the parent Model.
The default implementation simply re-emits the signal.
Reimplemented in Soprano::Util::SignalCacheModel.
|
protectedvirtual |
Handle a statementsRemoved() signal from the parent Model.
The default implementation simply re-emits the signal.
Reimplemented in Soprano::Util::SignalCacheModel.
|
protectedvirtual |
Handle a statementsAdded() signal from the parent Model.
The default implementation simply re-emits the signal.
|
protectedvirtual |
Handle a statementsRemoved() signal from the parent Model.
The default implementation simply re-emits the signal.
|
virtual |
Add the Statement to the Model.
statement | The Statement to add. |
Implements Soprano::Model.
Reimplemented in Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
Error::ErrorCode Soprano::Model::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.
|
virtual |
Remove one statement. For removing statements with wildward matching see removeAllStatements().
statement | The statement that should be removed. This has to be a valid statement. |
Implements Soprano::Model.
Reimplemented in Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
Error::ErrorCode Soprano::Model::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.
|
virtual |
Remove all statements that match the partial statement. For removing one specific statement see removeStatement().
statement | A possible partially defined statement that serves as a filter for all statements that should be removed. |
Implements Soprano::Model.
Reimplemented in Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Index::IndexFilterModel, Soprano::Inference::InferenceModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
Error::ErrorCode Soprano::Model::removeAllStatements | ( | 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.
subject | The subject node to match. Can be empty as a wildcard. |
predicate | The predicate node to match. Can be empty as a wildcard. |
object | The object node to match. Can be empty as a wildcard. |
context | The context node to match. Can be empty as a wildcard. |
Error::ErrorCode Soprano::Model::removeAllStatements | ( | ) |
Convenience method that clear the Model of all statements
|
virtual |
Return an iterator over Model Statements that "partial" match the input Statement.
partial | The partial Statement to match. |
Implements Soprano::Model.
Reimplemented in Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
StatementIterator Soprano::Model::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.
subject | The subject node to match. Can be empty as a wildcard. |
predicate | The predicate node to match. Can be empty as a wildcard. |
object | The object node to match. Can be empty as a wildcard. |
context | The context node to match. Can be empty as a wildcard. |
StatementIterator Soprano::Model::listStatements | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Check if the model contains a statements.
statement | The 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. |
Implements Soprano::Model.
Reimplemented in Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
bool Soprano::Model::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.
|
virtual |
Check if the model contains certain statements.
statement | A partially defined statement that serves as a pattern. |
Implements Soprano::Model.
Reimplemented in Soprano::Util::AsyncModel, Soprano::Util::MutexModel, Soprano::Util::AsyncModel, and Soprano::Util::MutexModel.
bool Soprano::Model::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.
subject | The subject node to match. Can be empty as a wildcard. |
predicate | The predicate node to match. Can be empty as a wildcard. |
object | The object node to match. Can be empty as a wildcard. |
context | The context node to match. Can be empty as a wildcard. |