Entity Class Reference
from PyKDE4.nepomuk import *
Subclasses: Nepomuk.Class, Nepomuk.Types.Class, Nepomuk.Types.Ontology
Namespace: Nepomuk::Types
Detailed Description
Base class for static ontology entities Class and Property. It encapsulates the generic labels and comments that both types have.
Due to internal optimizations comparing two Entities is much faster than comparing two QUrl objects.
Methods | |
__init__ (self, Nepomuk.Types.Entity a0) | |
__init__ (self) | |
QString | comment (self, QString language=KGlobal.locale()->language()) |
QIcon | icon (self) |
bool | isAvailable (self) |
bool | isValid (self) |
QString | label (self, QString language=KGlobal.locale()->language()) |
QString | name (self) |
bool | operator != (self, Nepomuk.Types.Entity other) |
bool | operator == (self, Nepomuk.Types.Entity other) |
QUrl | operator QUrl (self) |
reset (self, bool recursive=0) | |
QUrl | uri (self) |
Method Documentation
__init__ | ( | self, | ||
Nepomuk.Types.Entity | a0 | |||
) |
Default copy constructor.
__init__ | ( | self ) |
Create an invalid Entity instance.
Retrieve the comment of the entity (rdfs:comment)
- Parameters:
-
language The code of the language to use. Defaults to the session language configured in KDE. As of KDE 4.3 only the currently configured language is loaded to save memory.
- Returns:
- The comment translated into language or the default fallback comment if no translation is available or an empty string if no comment could be found at all.
QIcon icon | ( | self ) |
Retrieve the icon stored for the entity (nao:hasSymbol)
If no symbol is defined for the entity a null icon will be returned.
- Since:
- 4.1
bool isAvailable | ( | self ) |
Is this Entity available locally, i.e. could its properties be loaded from the Nepomuk store.
bool isValid | ( | self ) |
Is this a valid Entity, i.e. has it a valid URI. A valid Entity does not necessarily have a label and a comment, it does not even have to exist in the Nepomuk store.
\sa isAvailable
Retrieve the label of the entity (rdfs:label)
- Parameters:
-
language The code of the language to use. Defaults to the session language configured in KDE. As of KDE 4.3 only the currently configured language is loaded to save memory.
- Returns:
- The label translated into language or the default fallback label if no translation is available or the name() if no label could be found at all.
QString name | ( | self ) |
The name of the resource. The name equals the fragment of the URI.
bool operator != | ( | self, | ||
Nepomuk.Types.Entity | other | |||
) |
Compares two Entity instances by simply comparing their URI.
bool operator == | ( | self, | ||
Nepomuk.Types.Entity | other | |||
) |
Compares two Entity instances by simply comparing their URI.
QUrl operator QUrl | ( | self ) |
An Entity can be used as a QUrl automagically.
reset | ( | self, | ||
bool | recursive=0 | |||
) |
The Types classes are optimized for performance under the aasumption that ontologies never change during the execution time of an application.
Since there might be situations where this does not apply the internal cache can be reset via this method.
- Parameters:
-
recursive If true all related entities will be reset as well.
- Since:
- 4.1
QUrl uri | ( | self ) |
The URI of the resource