# class Entity

###

Module | nepomuk
Namespace | Nepomuk::Types
Class | Entity
Inherits |

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.

Author Sebastian Trueg <trueg@kde.org>

### methods

- Entity (a0)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  a0 | Nepomuk.Types.Entity |

  Default copy constructor.

- Entity ( )

  returns ctor

  Create an invalid Entity instance.

- comment (language)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  language | QString | KGlobal.locale()->language()

  Retrieve the comment of the entity (rdfs:comment)

  language - The code of the language to use. Defaults to the session language configured in KDE.

  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.

- icon ( )

  returns QIcon

  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

- isAvailable ( )

  returns bool

  Is this Entity available locally, i.e. could its properties be loaded from the Nepomuk store.

- isValid ( )

  returns bool

  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

- label (language)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  language | QString | KGlobal.locale()->language()

  Retrieve the label of the entity (rdfs:label)

  language - The code of the language to use. Defaults to the session language configured in KDE.

  Returns The label translated into language or the default fallback label if no translation is available or an empty string if no label could be found at all.

- name ( )

  returns QString

  The name of the resource. The name equals the fragment of the URI.

- operator != (other)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  other | Nepomuk.Types.Entity |

  Compares two Entity instances by simply comparing their URI.

- operator == (other)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  other | Nepomuk.Types.Entity |

  Compares two Entity instances by simply comparing their URI.

- operator QUrl ( )

  returns QUrl

  An Entity can be used as a QUrl automagically.

- reset (recursive)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  recursive | bool | 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.

  recursive - If true all related entities will be reset as well.

  \since 4.1

- uri ( )

  returns QUrl

  The URI of the resource