KDE 4.2 PyKDE API Reference

- KDE's Python API

# Class Class Reference

`from PyKDE4.nepomuk import *`

Inherits: Nepomuk.Entity
Namespace: Nepomuk

## Detailed Description

A Class is a resource of type rdf:Class.

Deprecated:
  in favor of Nepomuk.Types.Class

## Methods

| __init__ (self)
| __init__ (self, Nepomuk.Class a0)
[const Propert] | allProperties (self)
Nepomuk.Property | findPropertyByLabel (self, QString label, QString language=QString())
Nepomuk.Property | findPropertyByName (self, QString name)
Nepomuk.Property | findPropertyByUri (self, QUrl uri)
bool | isParentOf (self, Nepomuk.Class other)
bool | isSubClassOf (self, Nepomuk.Class other)
[const Clas] | parentClasses (self)
[const Clas] | subClasses (self)

## Static Methods

Nepomuk.Class | load (QUrl uri)

## Method Documentation

__init__ | ( |  | self ) |

Default constructor. Creates an empty Class.

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

Default copy constructor

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

Nepomuk.Property findPropertyByLabel | ( | self, |
|  | QString | label,
|  | QString | language=QString()
| ) |  |  |

Search for a property in the class by its label.

Parameters:

  | label | The label of the property (i.e. rdfs:label)

Parameters:

  | language | The language in which the label was specified. If empty the default rdfs:label is returned.

Returns:
  the Property object identified by label or 0 if the property could not be found.

Nepomuk.Property findPropertyByName | ( | self, |
|  | QString | name
| ) |  |  |

Search for a property in the class by its name.

Parameters:

  | name | The name of the property.

Returns:
  the Property object identified by name or 0 if the property could not be found.

Nepomuk.Property findPropertyByUri | ( | self, |
|  | QUrl | uri
| ) |  |  |

Search for a property in the class by its name.

Parameters:

  | uri | the URI of the property

Returns:
  the Property object identified by uri or 0 if the property could not be found.

bool isParentOf | ( | self, |
|  | Nepomuk.Class | other
| ) |  |  |

Check if a class inherits this class. This is a recursive method which does not only check direct child classes.

Returns:
  true if other is derived from this class, false otherwise.

bool isSubClassOf | ( | self, |
|  | Nepomuk.Class | other
| ) |  |  |

Check if this class is derived from another class. This is a recursive method which does not only check direct child classes.

Returns:
  true if this class is derived from other, false otherwise.

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

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

Dependancies are resolved automatically if possible.

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

[const Clas] parentClasses | ( |  | self ) |

Each class can have multiple parent classes.

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

[const Clas] subClasses | ( |  | self ) |

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