KDE 4.7 PyKDE API Reference

- KDE's Python API

# BindingSet Class Reference

`from PyKDE4.soprano import *`

Namespace: Soprano

## Detailed Description

\class BindingSet bindingset.h Soprano/BindingSet

Represents one set of bindings in the result of a select query.

BindingSet is mostly a convenience class for caching of query results.

\sa QueryResultIterator

Author:
  Sebastian Trueg <trueg@kde.org>

## Methods

| __init__ (self)
| __init__ (self, Soprano.BindingSet other)
QStringList | bindingNames (self)
bool | contains (self, QString name)
int | count (self)
| insert (self, QString name, Soprano.Node value)
bool | operator != (self, Soprano.BindingSet other)
bool | operator == (self, Soprano.BindingSet other)
Soprano.Node | operator [] (self, int offset)
Soprano.Node | operator [] (self, QString name)
| replace (self, int offset, Soprano.Node value)
| replace (self, QString name, Soprano.Node value)
Soprano.Node | value (self, int offset)
Soprano.Node | value (self, QString name)

## Method Documentation

__init__ | ( |  | self ) |

Create an emtpy set.

__init__ | ( | self, |
|  | Soprano.BindingSet | other
| ) |  |  |

Copy constructor.

QStringList bindingNames | ( |  | self ) |

Returns:
  The names of the bound variables in this set.

bool contains | ( | self, |
|  | QString | name
| ) |  |  |

Check if a certain variable has a binding in this set.

Parameters:

  | name | The variable name.

Returns:
  true if this set contains a binding for the variable name, false otherwise.

int count | ( |  | self ) |

The number of bindings in this set.

Returns:
  The number of bindings.

insert | ( | self, |
|  | QString | name,
|  | Soprano.Node | value
| ) |  |  |

Insert a new binding into the set.

bool operator != | ( | self, |
|  | Soprano.BindingSet | other
| ) |  |  |

Comparison operator.

Since:
  2.5

bool operator == | ( | self, |
|  | Soprano.BindingSet | other
| ) |  |  |

Comparison operator.

Since:
  2.5

Soprano.Node operator [] | ( | self, |
|  | int | offset
| ) |  |  |

Get the binding for a variable.

This is equivalent to value(const QString&) const.

Soprano.Node operator [] | ( | self, |
|  | QString | name
| ) |  |  |

Get the binding for a variable.

This is equivalent to value(const QString&) const.

replace | ( | self, |
|  | int | offset,
|  | Soprano.Node | value
| ) |  |  |

Replaces a value in the binding set.

Since:
  2.3

replace | ( | self, |
|  | QString | name,
|  | Soprano.Node | value
| ) |  |  |

Replaces a value in the binding set.

Since:
  2.3

Soprano.Node value | ( | self, |
|  | int | offset
| ) |  |  |

Get the binding for a variable.

Parameters:

  | name | The name of the requested variable.

Returns:
  The binding for the requested variable or and invalid node if the bindings do not contain the variable.

\sa QueryResultIterator.binding(const QString&) const.

Soprano.Node value | ( | self, |
|  | QString | name
| ) |  |  |

Get the binding for a variable.

Parameters:

  | name | The name of the requested variable.

Returns:
  The binding for the requested variable or and invalid node if the bindings do not contain the variable.

\sa QueryResultIterator.binding(const QString&) const.