Ontology Class Reference
from PyKDE4.nepomuk import *
Inherits: Nepomuk.Types.Entity
Namespace: Nepomuk::Types
Detailed Description
\class Ontology ontology.h Nepomuk/Types/Ontology
Represents one ontology.
Methods | |
__init__ (self) | |
__init__ (self, QUrl uri) | |
__init__ (self, Nepomuk.Types.Ontology a0) | |
[Nepomuk.Types.Class] | allClasses (self) |
[Nepomuk.Types.Property] | allProperties (self) |
Nepomuk.Types.Class | findClassByLabel (self, QString label, QString language=QString()) |
Nepomuk.Types.Class | findClassByName (self, QString name) |
Nepomuk.Types.Property | findPropertyByLabel (self, QString label, QString language=QString()) |
Nepomuk.Types.Property | findPropertyByName (self, QString name) |
Method Documentation
__init__ | ( | self ) |
Default constructor. Creates an empty Ontology.
__init__ | ( | self, | ||
QUrl | uri | |||
) |
Create the ontology referred to by uri. The result is either a valid ontology which could be loaded from the Nepomuk store or a simple class which only contains the uri.
Be aware that the data is only loaded once read.
Subsequent calls result in a simple hash lookup of cached data.
__init__ | ( | self, | ||
Nepomuk.Types.Ontology | a0 | |||
) |
Default copy constructor
[Nepomuk.Types.Class] allClasses | ( | self ) |
All classes defined in this ontology, i.e. its namespace.
[Nepomuk.Types.Property] allProperties | ( | self ) |
A list of all properties defined in this ontology. This does not include properties that use classes of this ontology but are defined in a different one.
Nepomuk.Types.Class findClassByLabel | ( | self, | ||
QString | label, | |||
QString | language=QString() | |||
) |
Search for a class in the ontology by its label.
- Parameters:
-
label The label of the class (i.e. rdfs:label)
- Parameters:
-
language The language in which the label was specified. If empty the default rdfs:label is returned.
- Returns:
- the Class object identified by label or an invalid one if the class could not be found.
Nepomuk.Types.Class findClassByName | ( | self, | ||
QString | name | |||
) |
Search for a class in the ontology by its name.
- Parameters:
-
name The name of the class.
- Returns:
- the Class object identified by name or an invalid one if the class could not be found.
Nepomuk.Types.Property findPropertyByLabel | ( | self, | ||
QString | label, | |||
QString | language=QString() | |||
) |
Search for a property in the ontology 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 an invalid one if the property could not be found.
Nepomuk.Types.Property findPropertyByName | ( | self, | ||
QString | name | |||
) |
Search for a property in the ontology by its name.
- Parameters:
-
name The name of the property.
- Returns:
- the Property object identified by name or an invalid one if the property could not be found.