• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Nepomuk

  • Nepomuk
  • Types
  • Entity
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Nepomuk::Types::Entity Class Reference

#include <entity.h>

Inheritance diagram for Nepomuk::Types::Entity:
Nepomuk::Types::Class Nepomuk::Types::Ontology Nepomuk::Types::Property

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.

Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org

Definition at line 54 of file entity.h.

Constructor & Destructor Documentation

◆ Entity() [1/2]

Nepomuk::Types::Entity::Entity ( const Entity &  )

Default copy constructor.

◆ ~Entity()

virtual Nepomuk::Types::Entity::~Entity ( )
virtual

Destructor.

◆ Entity() [2/2]

Nepomuk::Types::Entity::Entity ( )
protected

Create an invalid Entity instance.

Member Function Documentation

◆ comment() [1/2]

QString Nepomuk::Types::Entity::comment ( const QString &  language = KGlobal::locale() ->language())

Retrieve the comment of the entity (rdfs:comment)

Parameters
languageThe 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.

◆ comment() [2/2]

QString Nepomuk::Types::Entity::comment ( const QString &  language = KGlobal::locale() ->language()) const

Retrieve the comment of the entity (rdfs:comment)

Parameters
languageThe 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

◆ icon() [1/2]

QIcon Nepomuk::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

◆ icon() [2/2]

QIcon Nepomuk::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

◆ isAvailable() [1/2]

bool Nepomuk::Types::Entity::isAvailable ( )

Is this Entity available locally, i.e.

could its properties be loaded from the Nepomuk store.

◆ isAvailable() [2/2]

bool Nepomuk::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

◆ isValid()

bool Nepomuk::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

◆ label() [1/2]

QString Nepomuk::Types::Entity::label ( const QString &  language = KGlobal::locale() ->language())

Retrieve the label of the entity (rdfs:label)

Parameters
languageThe 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.

◆ label() [2/2]

QString Nepomuk::Types::Entity::label ( const QString &  language = KGlobal::locale() ->language()) const

Retrieve the label of the entity (rdfs:label)

Parameters
languageThe 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

◆ name()

QString Nepomuk::Types::Entity::name ( ) const

The name of the resource.

The name equals the fragment of the URI.

◆ operator QUrl()

Nepomuk::Types::Entity::operator QUrl ( ) const
inline

An Entity can be used as a QUrl automagically.

Definition at line 216 of file entity.h.

◆ operator!=() [1/2]

bool Nepomuk::Types::Entity::operator!= ( const Entity &  other) const

Compares two Entity instances.

This is faster than simply comparing the URIs.

◆ operator!=() [2/2]

bool Nepomuk::Types::Entity::operator!= ( const QUrl &  other) const

Compares the Entity with a URI.

Since
4.5

◆ operator=()

Entity & Nepomuk::Types::Entity::operator= ( const Entity &  )

Copy operator.

◆ operator==() [1/2]

bool Nepomuk::Types::Entity::operator== ( const Entity &  other) const

Compares two Entity instances.

This is faster than simply comparing the URIs.

◆ operator==() [2/2]

bool Nepomuk::Types::Entity::operator== ( const QUrl &  other) const

Compares the Entity with a URI.

Since
4.5

◆ reset()

void Nepomuk::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
recursiveIf true all related entities will be reset as well.
Since
4.1

◆ uri()

QUrl Nepomuk::Types::Entity::uri ( ) const

The URI of the resource.

◆ userVisible()

bool Nepomuk::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

Member Data Documentation

◆ d

QExplicitlySharedDataPointer<EntityPrivate> Nepomuk::Types::Entity::d
protected

Definition at line 250 of file entity.h.


The documentation for this class was generated from the following file:
  • entity.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk

Skip menu "Nepomuk"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal