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

Nepomuk

  • nepomuk
  • types
entity.h
Go to the documentation of this file.
1/* This file is part of the Nepomuk-KDE libraries
2 Copyright (c) 2007-2010 Sebastian Trueg <trueg@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef _NEPOMUK_ENTITY_H_
21#define _NEPOMUK_ENTITY_H_
22
23#include <QtCore/QUrl>
24#include <QtCore/QString>
25#include <QtCore/QSharedData>
26#include <QtCore/QHash>
27
28#include <Soprano/Node>
29
30#include <kglobal.h>
31#include <klocale.h>
32
33#include "nepomuk_export.h"
34
35class QIcon;
36
37
38namespace Nepomuk {
39 namespace Types {
40 class EntityPrivate;
41
54 class NEPOMUK_EXPORT Entity
55 {
56 public:
60 Entity( const Entity& );
61
65 virtual ~Entity();
66
70 Entity& operator=( const Entity& );
71
76 QString name() const;
77
81 QUrl uri() const;
82
94 QString label( const QString& language = KGlobal::locale()->language() );
95
111 QString label( const QString& language = KGlobal::locale()->language() ) const;
112
124 QString comment( const QString& language = KGlobal::locale()->language() );
125
141 QString comment( const QString& language = KGlobal::locale()->language() ) const;
142
150 QIcon icon();
151
161 QIcon icon() const;
162
170 bool isValid() const;
171
176 bool isAvailable();
177
186 bool isAvailable() const;
187
201 void reset( bool recursive = false );
202
211 bool userVisible() const;
212
216 operator QUrl() const { return uri(); }
217
222 bool operator==( const Entity& other ) const;
223
229 bool operator==( const QUrl& other ) const;
230
235 bool operator!=( const Entity& other ) const;
236
242 bool operator!=( const QUrl& other ) const;
243
244 protected:
248 Entity();
249
250 QExplicitlySharedDataPointer<EntityPrivate> d;
251 };
252
253 inline uint qHash( const Entity& c )
254 {
255 return qHash( c.uri() );
256 }
257 }
258}
259
260#ifndef DISABLE_NEPOMUK_LEGACY
261
262namespace Nepomuk {
263
264 class Ontology;
265
269 class KDE_DEPRECATED NEPOMUK_EXPORT Entity
270 {
271 public:
272 Entity( const Entity& );
273 ~Entity();
274
275 Entity& operator=( const Entity& );
276
280 const Ontology* definingOntology() const;
281
286 QString name() const;
287
291 QUrl uri() const;
292
293 QString label( const QString& language = QString() ) const;
294 QString comment( const QString& language = QString() ) const;
295
296 protected:
297 Entity();
298
299 private:
300 class Private;
301 QSharedDataPointer<Private> d;
302
303 friend class OntologyManager;
304 };
305}
306
307#endif // DISABLE_NEPOMUK_LEGACY
308
309#endif // _NEPOMUK_ENTITY_H_
Nepomuk::Entity
Definition: entity.h:270
Nepomuk::Entity::uri
QUrl uri() const
The URI of the resource.
Nepomuk::Entity::name
QString name() const
The name of the resource.
Nepomuk::Entity::comment
QString comment(const QString &language=QString()) const
Nepomuk::Entity::operator=
Entity & operator=(const Entity &)
Nepomuk::Entity::definingOntology
const Ontology * definingOntology() const
The ontology in which the resource is defined.
Nepomuk::Entity::Entity
Entity(const Entity &)
Nepomuk::Entity::Entity
Entity()
Nepomuk::Entity::label
QString label(const QString &language=QString()) const
Nepomuk::Entity::~Entity
~Entity()
Nepomuk::OntologyManager
The OntologyManager is the central ontology cache handler.
Definition: ontologymanager.h:45
Nepomuk::Ontology
Ontology represents one ontology specified using NRL.
Definition: ontology.h:136
Nepomuk::Types::Entity
Abstract base class for Class and Property;.
Definition: entity.h:55
Nepomuk::Types::Entity::uri
QUrl uri() const
The URI of the resource.
Nepomuk::Types::Entity::icon
QIcon icon()
Retrieve the icon stored for the entity (nao:hasSymbol)
Nepomuk::Types::Entity::icon
QIcon icon() const
Retrieve the icon stored for the entity (nao:hasSymbol)
Nepomuk::Types::Entity::operator=
Entity & operator=(const Entity &)
Copy operator.
Nepomuk::Types::Entity::name
QString name() const
The name of the resource.
Nepomuk::Types::Entity::reset
void reset(bool recursive=false)
The Types classes are optimized for performance under the aasumption that ontologies never change dur...
Nepomuk::Types::Entity::operator!=
bool operator!=(const QUrl &other) const
Compares the Entity with a URI.
Nepomuk::Types::Entity::operator==
bool operator==(const Entity &other) const
Compares two Entity instances.
Nepomuk::Types::Entity::label
QString label(const QString &language=KGlobal::locale() ->language()) const
Retrieve the label of the entity (rdfs:label)
Nepomuk::Types::Entity::label
QString label(const QString &language=KGlobal::locale() ->language())
Retrieve the label of the entity (rdfs:label)
Nepomuk::Types::Entity::isValid
bool isValid() const
Is this a valid Entity, i.e.
Nepomuk::Types::Entity::Entity
Entity(const Entity &)
Default copy constructor.
Nepomuk::Types::Entity::comment
QString comment(const QString &language=KGlobal::locale() ->language())
Retrieve the comment of the entity (rdfs:comment)
Nepomuk::Types::Entity::operator!=
bool operator!=(const Entity &other) const
Compares two Entity instances.
Nepomuk::Types::Entity::~Entity
virtual ~Entity()
Destructor.
Nepomuk::Types::Entity::userVisible
bool userVisible() const
nao:userVisible can be used to hide certain properties and resources of a certain type from the user.
Nepomuk::Types::Entity::isAvailable
bool isAvailable() const
Is this Entity available locally, i.e.
Nepomuk::Types::Entity::Entity
Entity()
Create an invalid Entity instance.
Nepomuk::Types::Entity::operator==
bool operator==(const QUrl &other) const
Compares the Entity with a URI.
Nepomuk::Types::Entity::d
QExplicitlySharedDataPointer< EntityPrivate > d
Definition: entity.h:250
Nepomuk::Types::Entity::comment
QString comment(const QString &language=KGlobal::locale() ->language()) const
Retrieve the comment of the entity (rdfs:comment)
Nepomuk::Types::Entity::isAvailable
bool isAvailable()
Is this Entity available locally, i.e.
Nepomuk::Types::qHash
uint qHash(const Entity &c)
Definition: entity.h:253
Nepomuk
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