Nepomuk-Core
#include <entity.h>
Public Member Functions | |
Entity (const Entity &) | |
virtual | ~Entity () |
QString | comment (const QString &language=KGlobal::locale() ->language()) |
QString | comment (const QString &language=KGlobal::locale() ->language()) const |
QIcon | icon () |
QIcon | icon () const |
bool | isAvailable () |
bool | isAvailable () const |
bool | isValid () const |
QString | label (const QString &language=KGlobal::locale() ->language()) |
QString | label (const QString &language=KGlobal::locale() ->language()) const |
QString | name () const |
operator QUrl () const | |
bool | operator!= (const Entity &other) const |
bool | operator!= (const QUrl &other) const |
Entity & | operator= (const Entity &) |
bool | operator== (const Entity &other) const |
bool | operator== (const QUrl &other) const |
void | reset (bool recursive=false) |
QUrl | uri () const |
bool | userVisible () const |
Protected Member Functions | |
Entity () | |
Protected Attributes | |
QExplicitlySharedDataPointer < EntityPrivate > | d |
Detailed Description
Abstract base class for Class and Property;.
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.
Constructor & Destructor Documentation
Nepomuk2::Types::Entity::Entity | ( | const Entity & | other | ) |
Default copy constructor.
Definition at line 157 of file entity.cpp.
|
virtual |
Destructor.
Definition at line 163 of file entity.cpp.
|
protected |
Create an invalid Entity instance.
Definition at line 152 of file entity.cpp.
Member Function Documentation
QString Nepomuk2::Types::Entity::comment | ( | const QString & | language = KGlobal::locale()->language() | ) |
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.
Definition at line 215 of file entity.cpp.
QString Nepomuk2::Types::Entity::comment | ( | const QString & | language = KGlobal::locale()->language() | ) | const |
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.
Const version
- Since
- 4.4
Definition at line 234 of file entity.cpp.
QIcon Nepomuk2::Types::Entity::icon | ( | ) |
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
Definition at line 240 of file entity.cpp.
QIcon Nepomuk2::Types::Entity::icon | ( | ) | const |
Retrieve the icon stored for the entity (nao:hasSymbol)
If no symbol is defined for the entity a null icon will be returned.
Const version.
- Since
- 4.4
Definition at line 253 of file entity.cpp.
bool Nepomuk2::Types::Entity::isAvailable | ( | ) |
Is this Entity available locally, i.e.
could its properties be loaded from the Nepomuk store.
Definition at line 265 of file entity.cpp.
bool Nepomuk2::Types::Entity::isAvailable | ( | ) | const |
Is this Entity available locally, i.e.
could its properties be loaded from the Nepomuk store.
Const version.
- Since
- 4.4
Definition at line 277 of file entity.cpp.
bool Nepomuk2::Types::Entity::isValid | ( | ) | const |
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.
- See also
- isAvailable
Definition at line 259 of file entity.cpp.
QString Nepomuk2::Types::Entity::label | ( | const QString & | language = KGlobal::locale()->language() | ) |
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.
Definition at line 187 of file entity.cpp.
QString Nepomuk2::Types::Entity::label | ( | const QString & | language = KGlobal::locale()->language() | ) | const |
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.
Const version
- Since
- 4.4
Definition at line 209 of file entity.cpp.
QString Nepomuk2::Types::Entity::name | ( | ) | const |
The name of the resource.
The name equals the fragment of the URI.
Definition at line 181 of file entity.cpp.
|
inline |
bool Nepomuk2::Types::Entity::operator!= | ( | const Entity & | other | ) | const |
Compares two Entity instances.
This is faster than simply comparing the URIs.
Definition at line 319 of file entity.cpp.
bool Nepomuk2::Types::Entity::operator!= | ( | const QUrl & | other | ) | const |
Nepomuk2::Types::Entity & Nepomuk2::Types::Entity::operator= | ( | const Entity & | other | ) |
Copy operator.
Definition at line 168 of file entity.cpp.
bool Nepomuk2::Types::Entity::operator== | ( | const Entity & | other | ) | const |
Compares two Entity instances.
This is faster than simply comparing the URIs.
Definition at line 302 of file entity.cpp.
bool Nepomuk2::Types::Entity::operator== | ( | const QUrl & | other | ) | const |
void Nepomuk2::Types::Entity::reset | ( | bool | recursive = false | ) |
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
Definition at line 283 of file entity.cpp.
QUrl Nepomuk2::Types::Entity::uri | ( | ) | const |
The URI of the resource.
Definition at line 175 of file entity.cpp.
bool Nepomuk2::Types::Entity::userVisible | ( | ) | const |
nao:userVisible can be used to hide certain properties and resources of a certain type from the user.
- Returns
true
if this entity should be visible to the user.
- Since
- 4.6
Definition at line 290 of file entity.cpp.
Member Data Documentation
|
protected |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.