KDE 4.9 PyKDE API Reference

- KDE's Python API

# OptionalTerm Class Reference

`from PyKDE4.nepomuk import *`

Inherits: Nepomuk.Query.SimpleTerm → Nepomuk.Query.Term
Namespace: Nepomuk.Query

## Detailed Description

\class OptionalTerm optionalterm.h Nepomuk/Query/OptionalTerm

Make a term optional.

%OptionalTerm can be used to mark another term as optional. This is mostly useful with subterms of type ComparisonTerm (or an AndTerm combining ComparisonTerms) which either have additional bindings (ComparisonTerm.setVariableName()) or a specified sort weight (ComparisonTerm.setSortWeight()).

Author:
  Sebastian Trueg <trueg@kde.org>

Since:
  4.5

## Methods
| __init__ (self)
| __init__ (self, Nepomuk.Query.OptionalTerm term)
## Static Methods
Nepomuk.Query.Term | optionalizeTerm (Nepomuk.Query.Term term)

## Method Documentation

__init__ | ( |  | self ) |

Default constructor: creates an invalid optional term.

__init__ | ( | self, |
|  | Nepomuk.Query.OptionalTerm | term
| ) |  |  |

Copy constructor.

## Static Method Documentation

Nepomuk.Query.Term optionalizeTerm | ( | Nepomuk.Query.Term | term
| ) |  |  |

Mark term as optional. This method will encasulate term in an OptionalTerm except if term is already of type OptionalTerm.

Returns:
  The optional term.