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 );
static QString labelUri()
Resource & operator=(const QUrl &uri)
Same as operator=( Resource( uri ) )
void addAnnotation(const Resource &value)
Add a value to property 'annotation'.
static QString isRelatedUri()
QHash< QUrl, Variant > properties() const
QString className() const
The name of the class this Resource represents an object of.
void addIsRelated(const Resource &value)
Add a value to property 'isRelated'.
bool operator==(const Resource &) const
Operator to compare two Resource objects.
static QString topicUri()
ResourceManager * manager() const
The Resource manager that manages this resource.
void setProperty(const QUrl &uri, const Variant &value)
Set a property of the resource.
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 tagUri()
Thing pimoThing()
Get or create the PIMO thing that relates to this resource.
Resource & operator=(const Resource &other)
Makes this instance of Resource a copy of other.
Variant property(const QString &uri) const
void setProperty(const QString &uri, const Variant &value)
QList< Resource > isRelatedOf() const
Get all resources that have this resource set as property 'isRelated'.
static QString altLabelUri()
QUrl resourceUri() const
The URI of the resource, uniquely identifying it.
bool exists() const
static QString isTopicOfUri()
void setIsRelateds(const QList< Resource > &value)
Set property 'isRelated'.
int usageCount() const
QHash< QString, Variant > allProperties() const
static QList< Resource > allResources()
Retrieve a list of all available Resource resources.
QList< QUrl > types() const
bool hasType(const QUrl &typeUri) const
Check if the resource is of a certain type.
uint qHash(const Resource &res)
QString errorString(ErrorCode code)
bool hasProperty(const QUrl &uri) const
Check if property identified by uri is defined for this resource.
QString genericDescription() const
Tries very hard to find a suitable human-readable description of the resource.
void increaseUsageCount()
Increase the usage count of this resource and also update the last used date to the current date and ...
static QString ratingUri()
void removeProperty(const QString &uri)
QString genericLabel() const
Tries very hard to find a suitable human-readable label for this resource.
Resource(const QString &pathOrIdentifier, const QString &type)
bool hasProperty(const Types::Property &p, const Variant &v) const
Check if the resource has a property p with value v.
static QString identifierUri()
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...
File toFile() const
Convert this resource into a File resource to have access to the convinience methods provided by the ...
void addAltLabel(const QString &value)
Add a value to property 'altLabel'.
QString genericIcon() const
Tries very hard to find an icon suitable for this resource.
QList< Resource > annotationOf() const
Get all resources that have this resource set as property 'annotation'.
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.
void setDescription(const QString &value)
Set property 'description'.
bool isFile() const
bool isValid() const
Variant property(const QUrl &uri) const
Retrieve the value of property uri.
void removeProperty(const QUrl &uri)
Remove property uri from this resource object.
static QString descriptionUri()
static QString symbolUri()
bool hasProperty(const QString &uri) const
Resource(const QString &pathOrIdentifier, const QUrl &type=QUrl())
Creates a new Resource object.
The ResourceManager is the central Nepomuk configuration point.
Definition: resourcemanager.h:56
static QString annotationUri()
void setIdentifiers(const QStringList &value)
Set property 'identifier'.
Resource(const QUrl &uri, const QUrl &type=QUrl())
Creates a new Resource object.
void addIdentifier(const QString &value)
Add a value to property 'identifier'.
void removeProperty(const QUrl &uri, const Variant &value)
Remove value from property uri of this resource object.
bool operator!=(const Resource &) const
Operator to compare two Resource objects.
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
void addIsTopicOf(const Resource &value)
Add a value to property 'isTopicOf'.
void addProperty(const QUrl &uri, const Variant &value)
Add a property value to the existing values.
void setAnnotations(const QList< Resource > &value)
Set property 'annotation'.
void setIsTopicOfs(const QList< Resource > &value)
Set property 'isTopicOf'.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 27 2020 00:00:00 by doxygen 1.8.20 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 27 2020 00:00:00 by doxygen 1.8.20 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.