KDE 4.2 PyKDE API Reference

- KDE's Python API

# Property Class Reference

`from PyKDE4.nepomuk import *`

Inherits: Nepomuk.Entity
Namespace: Nepomuk

## Detailed Description

A property is a resource of type rdf:Property which relates a domain with a range. The latter one can be a literal in addition to a Class.

Deprecated:
  in favor of Nepomuk.Types.Property

## Methods

| __init__ (self)
| __init__ (self, Nepomuk.Property a0)
int | cardinality (self)
Nepomuk.Class | domain (self)
Nepomuk.Property | inverseProperty (self)
Nepomuk.Literal | literalRangeType (self)
int | maxCardinality (self)
int | minCardinality (self)
[const Propert] | parentOf (self)
[const Propert] | parentProperties (self)
Nepomuk.Class | range (self)

## Static Methods

Nepomuk.Property | load (QUrl uri)

## Method Documentation

__init__ | ( |  | self ) |

Default constructor. Creates an empty Property.

__init__ | ( | self, |
|  | Nepomuk.Property | a0
| ) |  |  |

Default copy constructor

int cardinality | ( |  | self ) |

The cardinality of this property as specified by nrl:cardinality.

Returns:
  the cardinality of the property or -1 if none was set.

Nepomuk.Class domain | ( |  | self ) |

The domain of the property.

Nepomuk.Property inverseProperty | ( |  | self ) |

The inverse property (nrl:inverseProperty).

Returns:
  A Property instance representing the inverse property of this one or 0 if none was specified in the ontology.

Nepomuk.Literal literalRangeType | ( |  | self ) |

If the rage of this property is a literal (i.e. range returns 0) this method provides the literal type.

Returns:
  the literal type of this property or an empty, invalid Literal if the range is a Class.

\sa range

Nepomuk.Property load | ( | QUrl | uri
| ) |  |  |

Loads a property actually including the whole ontology it is declared in.

Dependancies are resolved automatically if possible.

Returns:
  A property object representing the property identified by uri or an invalid Property object if the resource identified by uri is either not a property or does not exist.

int maxCardinality | ( |  | self ) |

The maximum cardinality of this property as specified by nrl:maxCardinality.

Returns:
  the maximum cardinality of the property or -1 if none was set.

int minCardinality | ( |  | self ) |

The minimum cardinality of this property as specified by nrl:minCardinality.

Returns:
  the minimum cardinality of the property or -1 if none was set.

[const Propert] parentOf | ( |  | self ) |

Returns:
  A list of all properties that have this property as a parent. Be aware that this list can never be final since other ontologies that have not been loaded yet may contain properties that are derived from this property.

[const Propert] parentProperties | ( |  | self ) |

Each property can have multiple parent properties.

Returns:
  A list of all parent properties of this property. If the list is emppty it means that the property has no direct parents, i.e. it is derived from rdf:Resource.

Nepomuk.Class range | ( |  | self ) |

The range of the property.

Returns:
  The range of the property or an invalid Class in case the range of this poperty is a literal.

\sa literalRange