Nepomuk
resource.h
Go to the documentation of this file.
50 };
788 static Resource fromResourceUri( const KUrl& uri, const Nepomuk::Types::Class& type = Nepomuk::Types::Class(), ResourceManager* manager = 0 );
The ResourceManager is the central Nepomuk configuration point.
Definition: resourcemanager.h:56
QHash< QString, Variant > allProperties() const
Variant property(const QString &uri) const
File toFile() const
Convert this resource into a File resource to have access to the convinience methods provided by the ...
QString genericDescription() const
Tries very hard to find a suitable human-readable description of the resource.
QList< Resource > isRelatedOf() const
Get all resources that have this resource set as property 'isRelated'.
static QString ratingUri()
void addAnnotation(const Resource &value)
Add a value to property 'annotation'.
Resource(const QString &pathOrIdentifier, const QString &type)
static QList< Resource > allResources()
Retrieve a list of all available Resource resources.
QList< Resource > annotationOf() const
Get all resources that have this resource set as property 'annotation'.
bool hasProperty(const QUrl &uri) const
Check if property identified by uri is defined for this resource.
int usageCount() const
Resource(const QString &pathOrIdentifier, const QUrl &type, ResourceManager *manager)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString altLabelUri()
bool isFile() const
void addIsRelated(const Resource &value)
Add a value to property 'isRelated'.
ResourceManager * manager() const
The Resource manager that manages this resource.
QString genericLabel() const
Tries very hard to find a suitable human-readable label for this resource.
Thing pimoThing()
Get or create the PIMO thing that relates to this resource.
void setIdentifiers(const QStringList &value)
Set property 'identifier'.
static QString isRelatedUri()
void setProperty(const QString &uri, const Variant &value)
static QString annotationUri()
static QString labelUri()
void setAnnotations(const QList< Resource > &value)
Set property 'annotation'.
Resource & operator=(const Resource &other)
Makes this instance of Resource a copy of other.
static Resource fromResourceUri(const KUrl &uri, const Nepomuk::Types::Class &type=Nepomuk::Types::Class(), ResourceManager *manager=0)
Allows to quickly load a resource from its resource URI without any additional checks.
bool operator!=(const Resource &) const
Operator to compare two Resource objects.
static QString isTopicOfUri()
bool isValid() const
Resource(const QUrl &uri, const QUrl &type, ResourceManager *manager)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setDescription(const QString &value)
Set property 'description'.
void addIsTopicOf(const Resource &value)
Add a value to property 'isTopicOf'.
static QString identifierUri()
void setProperty(const QUrl &uri, const Variant &value)
Set a property of the resource.
bool hasProperty(const QString &uri) const
void removeProperty(const QUrl &uri, const Variant &value)
Remove value from property uri of this resource object.
void addProperty(const QUrl &uri, const Variant &value)
Add a property value to the existing values.
void addAltLabel(const QString &value)
Add a value to property 'altLabel'.
static QString descriptionUri()
Resource(const QString &pathOrIdentifier, const QUrl &type=QUrl())
Creates a new Resource object.
QList< QUrl > types() const
Variant property(const QUrl &uri) const
Retrieve the value of property uri.
void increaseUsageCount()
Increase the usage count of this resource and also update the last used date to the current date and ...
void setIsRelateds(const QList< Resource > &value)
Set property 'isRelated'.
bool hasType(const QUrl &typeUri) const
Check if the resource is of a certain type.
void setIsTopicOfs(const QList< Resource > &value)
Set property 'isTopicOf'.
QString genericIcon() const
Tries very hard to find an icon suitable for this resource.
static QString topicUri()
bool operator==(const Resource &) const
Operator to compare two Resource objects.
bool exists() const
void addIdentifier(const QString &value)
Add a value to property 'identifier'.
static QString tagUri()
QHash< QUrl, Variant > properties() const
bool hasProperty(const Types::Property &p, const Variant &v) const
Check if the resource has a property p with value v.
Resource(const QUrl &uri, const QUrl &type=QUrl())
Creates a new Resource object.
QString className() const
The name of the class this Resource represents an object of.
QUrl resourceUri() const
The URI of the resource, uniquely identifying it.
void removeProperty(const QUrl &uri)
Remove property uri from this resource object.
static QString symbolUri()
void removeProperty(const QString &uri)
Resource & operator=(const QUrl &uri)
Same as operator=( Resource( uri ) )
A property is a resource of type rdf:Property which relates a domain with a range.
Definition: property.h:53
The Nepomuk Variant extends over QVariant by introducing direct support for Resource embedding,...
Definition: variant.h:66
uint qHash(const Resource &res)
QString errorString(ErrorCode code)
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
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.