# class FilterModel

###

Module | soprano
Namespace | Soprano
Class | FilterModel
Inherits | Soprano::Model

\class FilterModel filtermodel.h Soprano/FilterModel

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).

Author Sebastian Trueg <trueg@kde.org>

### methods

- FilterModel ( )

  returns ctor

  Create an empty filter model.

- FilterModel (parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  parent | Soprano.Model |

  Create a new FilterModel which works on parent. Calls setParentModel.

  parent - The parent Model.

- addStatement (statement)

  returns Soprano.Error.ErrorCode

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.Statement |

  Default implementation simply pipes the call through to the parent model.

- addStatement (subject, predicate, object, context)

  returns Soprano.Error.ErrorCode

  Argument | Type | Default
  --- | --- | ---
  subject | Soprano.Node |
  predicate | Soprano.Node |
  object | Soprano.Node |
  context | Soprano.Node | Soprano.Node()

  Reimplemented for convenience. Calls Model.addStatement(const Node&,const Node&,const Node&,const Node&)

- containsAnyStatement (statement)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.Statement |

  Default implementation simply pipes the call through to the parent model.

- containsAnyStatement (subject, predicate, object, context)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  subject | Soprano.Node |
  predicate | Soprano.Node |
  object | Soprano.Node |
  context | Soprano.Node | Soprano.Node()

  Reimplemented for convenience. Calls Model.containsAnyStatement(const Node&,const Node&,const Node&,const Node&)

- containsStatement (statement)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.Statement |

  Default implementation simply pipes the call through to the parent model.

- containsStatement (subject, predicate, object, context)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  subject | Soprano.Node |
  predicate | Soprano.Node |
  object | Soprano.Node |
  context | Soprano.Node | Soprano.Node()

  Reimplemented for convenience. Calls Model.containsStatement(const Node&,const Node&,const Node&,const Node&)

- createBlankNode ( )

  returns Soprano.Node

  Default implementation simply pipes the call through to the parent model.

- executeQuery (query, language, userQueryLanguage)

  returns Soprano.QueryResultIterator

  Argument | Type | Default
  --- | --- | ---
  query | QString |
  language | Soprano.Query.QueryLanguage |
  userQueryLanguage | QString | QString()

  Default implementation simply pipes the call through to the parent model.

- isEmpty ( )

  returns bool

  Default implementation simply pipes the call through to the parent model.

- listContexts ( )

  returns Soprano.NodeIterator

  Default implementation simply pipes the call through to the parent model.

- listStatements (partial)

  returns Soprano.StatementIterator

  Argument | Type | Default
  --- | --- | ---
  partial | Soprano.Statement |

  Default implementation simply pipes the call through to the parent model.

- listStatements (subject, predicate, object, context)

  returns Soprano.StatementIterator

  Argument | Type | Default
  --- | --- | ---
  subject | Soprano.Node |
  predicate | Soprano.Node |
  object | Soprano.Node |
  context | Soprano.Node | Soprano.Node()

  Reimplemented for convenience. Calls Model.listStatements(const Node&,const Node&,const Node&,const Node&)

- parentModel ( )

  returns Soprano.Model

  Get the parent model. Returns The parent Model or 0 if none has been set.

- parentStatementAdded (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | Soprano.Statement |

  Handle a statementsAdded() signal from the parent Model.

  The default implementation simply re-emits the signal.

- parentStatementRemoved (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | Soprano.Statement |

  Handle a statementsRemoved() signal from the parent Model.

  The default implementation simply re-emits the signal.

- parentStatementsAdded ( )

  returns Nothing

  Handle a statementsAdded() signal from the parent Model.

  The default implementation simply re-emits the signal.

- parentStatementsRemoved ( )

  returns Nothing

  Handle a statementsRemoved() signal from the parent Model.

  The default implementation simply re-emits the signal.

- removeAllStatements (statement)

  returns Soprano.Error.ErrorCode

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.Statement |

  Default implementation simply pipes the call through to the parent model.

- removeAllStatements (subject, predicate, object, context)

  returns Soprano.Error.ErrorCode

  Argument | Type | Default
  --- | --- | ---
  subject | Soprano.Node |
  predicate | Soprano.Node |
  object | Soprano.Node |
  context | Soprano.Node | Soprano.Node()

  Reimplemented for convenience. Calls Model.removeAllStatements(const Node&,const Node&,const Node&,const Node&)

- removeStatement (statement)

  returns Soprano.Error.ErrorCode

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.Statement |

  Default implementation simply pipes the call through to the parent model.

- removeStatement (subject, predicate, object, context)

  returns Soprano.Error.ErrorCode

  Argument | Type | Default
  --- | --- | ---
  subject | Soprano.Node |
  predicate | Soprano.Node |
  object | Soprano.Node |
  context | Soprano.Node | Soprano.Node()

  Reimplemented for convenience. Calls Model.removeStatement(const Node&,const Node&,const Node&,const Node&)

- setParentModel (model)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  model | Soprano.Model |

  Set the parent Model.

  model - The Model that this filter will forward any commands to.

- statementCount ( )

  returns int

  Default implementation simply pipes the call through to the parent model.

- write (os)

  returns Soprano.Error.ErrorCode

  Argument | Type | Default
  --- | --- | ---
  os | QTextStream |

  Default implementation simply pipes the call through to the parent model.