Nepomuk
property.h
Go to the documentation of this file.
00001 /* This file is part of the Nepomuk-KDE libraries 00002 Copyright (c) 2007 Sebastian Trueg <trueg@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef _NEPOMUK_PROPERTY_H_ 00021 #define _NEPOMUK_PROPERTY_H_ 00022 00023 #include <QtCore/QList> 00024 #include <QtCore/QUrl> 00025 #include <QtCore/QString> 00026 #include <QtCore/QVariant> 00027 #include <QtCore/QSharedData> 00028 00029 #include "entity.h" 00030 #include "nepomuk_export.h" 00031 00032 namespace Nepomuk { 00033 namespace Types { 00034 00035 class Class; 00036 class Literal; 00037 00052 class NEPOMUK_EXPORT Property : public Entity 00053 { 00054 public: 00058 Property(); 00059 00069 Property( const QUrl& uri ); 00070 00074 Property( const Property& ); 00075 00079 ~Property(); 00080 00084 Property& operator=( const Property& ); 00085 00092 QList<Property> parentProperties(); 00093 00104 QList<Property> parentProperties() const; 00105 00112 QList<Property> subProperties(); 00113 00124 QList<Property> subProperties() const; 00125 00131 Property inverseProperty(); 00132 00142 Property inverseProperty() const; 00143 00150 Class range(); 00151 00162 Class range() const; 00163 00173 Literal literalRangeType(); 00174 00188 Literal literalRangeType() const; 00189 00193 Class domain(); 00194 00202 Class domain() const; 00203 00209 int cardinality(); 00210 00220 int cardinality() const; 00221 00227 int minCardinality(); 00228 00238 int minCardinality() const; 00239 00245 int maxCardinality(); 00246 00256 int maxCardinality() const; 00257 00264 bool isParentOf( const Property& other ); 00265 00276 bool isParentOf( const Property& other ) const; 00277 00284 bool isSubPropertyOf( const Property& other ); 00285 00296 bool isSubPropertyOf( const Property& other ) const; 00297 }; 00298 } 00299 } 00300 00301 00302 #ifndef DISABLE_NEPOMUK_LEGACY 00303 00304 namespace Nepomuk { 00305 00306 class Ontology; 00307 class Class; 00308 class Literal; 00309 00316 class KDE_DEPRECATED NEPOMUK_EXPORT Property : public Entity 00317 { 00318 public: 00322 Property(); 00323 00327 Property( const Property& ); 00328 00332 ~Property(); 00333 00334 Property& operator=( const Property& ); 00335 00342 QList<const Property*> parentProperties() const; 00343 00350 QList<const Property*> parentOf() const; 00351 00357 const Property* inverseProperty() const; 00358 00365 const Class* range() const; 00366 00376 Literal literalRangeType() const; 00377 00381 const Class* domain() const; 00382 00388 int cardinality() const; 00389 00395 int minCardinality() const; 00396 00402 int maxCardinality() const; 00403 00404 // QString unit() const; 00405 00416 static const Property* load( const QUrl& uri ); 00417 00418 private: 00419 class Private; 00420 QSharedDataPointer<Private> d; 00421 00422 friend class OntologyManager; 00423 }; 00424 } 00425 00426 #endif // DISABLE_NEPOMUK_LEGACY 00427 00428 #endif // _NEPOMUK_PROPERTY_H_
KDE 4.6 API Reference