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

Nepomuk

  • nepomuk
  • types
class.h
Go to the documentation of this file.
1/* This file is part of the Nepomuk-KDE libraries
2 Copyright (c) 2007-2009 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_CLASS_H_
21#define _NEPOMUK_CLASS_H_
22
23#include <QtCore/QList>
24#include <QtCore/QUrl>
25#include <QtCore/QString>
26#include <QtCore/QSharedData>
27
28#include "entity.h"
29#include "nepomuk_export.h"
30
31
32namespace Nepomuk {
33 namespace Types {
34 class Property;
35
49 class NEPOMUK_EXPORT Class : public Entity
50 {
51 friend class ClassPrivate;
52
53 public:
57 Class();
58
68 Class( const QUrl& uri );
69
73 Class( const Class& );
74
78 ~Class();
79
83 Class& operator=( const Class& );
84
90 QList<Property> rangeOf();
91
101 QList<Property> rangeOf() const;
102
108 QList<Property> domainOf();
109
119 QList<Property> domainOf() const;
120
126 Property findPropertyByName( const QString& name );
127
137 Property findPropertyByName( const QString& name ) const;
138
146 Property findPropertyByLabel( const QString& label, const QString& language = QString() );
147
159 Property findPropertyByLabel( const QString& label, const QString& language = QString() ) const;
160
169 QList<Class> parentClasses();
170
183 QList<Class> parentClasses() const;
184
191 QList<Class> subClasses();
192
203 QList<Class> subClasses() const;
204
211 QList<Class> allParentClasses();
212
223 QList<Class> allParentClasses() const;
224
231 QList<Class> allSubClasses();
232
243 QList<Class> allSubClasses() const;
244
251 bool isParentOf( const Class& other );
252
263 bool isParentOf( const Class& other ) const;
264
271 bool isSubClassOf( const Class& other );
272
283 bool isSubClassOf( const Class& other ) const;
284 };
285 }
286}
287
288
289#ifndef DISABLE_NEPOMUK_LEGACY
290
291namespace Nepomuk {
292
293 class Ontology;
294 class Property;
295
301 class KDE_DEPRECATED NEPOMUK_EXPORT Class : public Entity
302 {
303 public:
307 Class();
308
312 Class( const Class& );
313
317 ~Class();
318
319 Class& operator=( const Class& );
320
321 // an alternative would be: QList<Property> rangeOf() and QList<Property> domainOf()
322 QList<const Property*> allProperties() const;
323
329 const Property* findPropertyByName( const QString& name ) const;
330
338 const Property* findPropertyByLabel( const QString& label, const QString& language = QString() ) const;
339
345 const Property* findPropertyByUri( const QUrl& uri ) const;
346
353 QList<const Class*> parentClasses() const;
354
361 QList<const Class*> subClasses() const;
362
369 bool isParentOf( const Class* other ) const;
370
377 bool isSubClassOf( const Class* other ) const;
378
389 static const Class* load( const QUrl& uri );
390
391 private:
392 class Private;
393 QSharedDataPointer<Private> d;
394
395 friend class OntologyManager;
396 };
397}
398
399#endif
400#endif
Nepomuk::Class
A Class is a resource of type rdf:Class.
Definition: class.h:302
Nepomuk::Class::findPropertyByUri
const Property * findPropertyByUri(const QUrl &uri) const
Search for a property in the class by its name.
Nepomuk::Class::load
static const Class * load(const QUrl &uri)
Loads a class actually including the whole ontology it is declared in.
Nepomuk::Class::isParentOf
bool isParentOf(const Class *other) const
Check if a class inherits this class.
Nepomuk::Class::Class
Class()
Default constructor.
Nepomuk::Class::allProperties
QList< const Property * > allProperties() const
Nepomuk::Class::~Class
~Class()
Destructor.
Nepomuk::Class::findPropertyByLabel
const Property * findPropertyByLabel(const QString &label, const QString &language=QString()) const
Search for a property in the class by its label.
Nepomuk::Class::findPropertyByName
const Property * findPropertyByName(const QString &name) const
Search for a property in the class by its name.
Nepomuk::Class::subClasses
QList< const Class * > subClasses() const
Nepomuk::Class::operator=
Class & operator=(const Class &)
Nepomuk::Class::isSubClassOf
bool isSubClassOf(const Class *other) const
Check if this class is derived from another class.
Nepomuk::Class::parentClasses
QList< const Class * > parentClasses() const
Each class can have multiple parent classes.
Nepomuk::Class::Class
Class(const Class &)
Default copy constructor.
Nepomuk::Entity
Definition: entity.h:270
Nepomuk::OntologyManager
The OntologyManager is the central ontology cache handler.
Definition: ontologymanager.h:45
Nepomuk::Property
A property is a resource of type rdf:Property which relates a domain with a range.
Definition: property.h:317
Nepomuk::Types::Class
A Class is a resource of type rdf:Class.
Definition: class.h:50
Nepomuk::Types::Class::operator=
Class & operator=(const Class &)
Copy operator.
Nepomuk::Types::Class::allParentClasses
QList< Class > allParentClasses()
Recursively determines all parent classes of this class, not only the direct ones.
Nepomuk::Types::Class::findPropertyByLabel
Property findPropertyByLabel(const QString &label, const QString &language=QString())
Search for a property in the class by its label.
Nepomuk::Types::Class::findPropertyByName
Property findPropertyByName(const QString &name)
Search for a property in the class by its name.
Nepomuk::Types::Class::~Class
~Class()
Destructor.
Nepomuk::Types::Class::Class
Class(const Class &)
Default copy constructor.
Nepomuk::Types::Class::isSubClassOf
bool isSubClassOf(const Class &other)
Check if this class is derived from another class.
Nepomuk::Types::Class::domainOf
QList< Property > domainOf() const
A Property has a certain domain which is a Class.
Nepomuk::Types::Class::isParentOf
bool isParentOf(const Class &other)
Check if a class inherits this class.
Nepomuk::Types::Class::findPropertyByName
Property findPropertyByName(const QString &name) const
Search for a property in the class by its name.
Nepomuk::Types::Class::Class
Class(const QUrl &uri)
Create the class referred to by uri.
Nepomuk::Types::Class::rangeOf
QList< Property > rangeOf() const
A Property has a certain range which is a Class or a Literal.
Nepomuk::Types::Class::domainOf
QList< Property > domainOf()
A Property has a certain domain which is a Class.
Nepomuk::Types::Class::isParentOf
bool isParentOf(const Class &other) const
Check if a class inherits this class.
Nepomuk::Types::Class::subClasses
QList< Class > subClasses()
Nepomuk::Types::Class::parentClasses
QList< Class > parentClasses()
Each class can have multiple parent classes.
Nepomuk::Types::Class::allSubClasses
QList< Class > allSubClasses()
Recursively determines all sub classes of this class, not only the direct ones.
Nepomuk::Types::Class::findPropertyByLabel
Property findPropertyByLabel(const QString &label, const QString &language=QString()) const
Search for a property in the class by its label.
Nepomuk::Types::Class::isSubClassOf
bool isSubClassOf(const Class &other) const
Check if this class is derived from another class.
Nepomuk::Types::Class::parentClasses
QList< Class > parentClasses() const
Each class can have multiple parent classes.
Nepomuk::Types::Class::allParentClasses
QList< Class > allParentClasses() const
Recursively determines all parent classes of this class, not only the direct ones.
Nepomuk::Types::Class::Class
Class()
Default constructor.
Nepomuk::Types::Class::rangeOf
QList< Property > rangeOf()
A Property has a certain range which is a Class or a Literal.
Nepomuk::Types::Class::allSubClasses
QList< Class > allSubClasses() const
Recursively determines all sub classes of this class, not only the direct ones.
Nepomuk::Types::Class::subClasses
QList< Class > subClasses() const
Nepomuk::Types::Entity
Abstract base class for Class and Property;.
Definition: entity.h:55
Nepomuk::Types::Property
A property is a resource of type rdf:Property which relates a domain with a range.
Definition: property.h:53
entity.h
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