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

Nepomuk-Core

  • Nepomuk2
  • SimpleResource
Public Member Functions | List of all members
Nepomuk2::SimpleResource Class Reference

#include <Nepomuk2/SimpleResource>

Public Member Functions

 SimpleResource (const QUrl &uri=QUrl())
 
 SimpleResource (const PropertyHash &properties)
 
 SimpleResource (const SimpleResource &other)
 
virtual ~SimpleResource ()
 
void addProperties (const PropertyHash &properties)
 
void addProperty (const QUrl &property, const QVariant &value)
 
void addProperty (const QUrl &property, const SimpleResource &res)
 
void addPropertyNode (const QUrl &property, const Soprano::Node &value)
 
void addType (const QUrl &type)
 
void clear ()
 
bool contains (const QUrl &property) const
 
bool contains (const QUrl &property, const QVariant &value) const
 
bool containsNode (const QUrl &property, const Soprano::Node &value) const
 
bool isValid () const
 
SimpleResource & operator= (const SimpleResource &other)
 
bool operator== (const SimpleResource &other) const
 
PropertyHash properties () const
 
QVariantList property (const QUrl &property) const
 
void remove (const QUrl &property, const QVariant &value)
 
void remove (const QUrl &property)
 
void removeAll (const QUrl &property, const QVariant &value)
 
void setProperties (const PropertyHash &properties)
 
void setProperty (const QUrl &property, const QVariant &value)
 
void setProperty (const QUrl &property, const QVariantList &values)
 
void setProperty (const QUrl &property, const SimpleResource &res)
 
void setPropertyNode (const QUrl &property, const Soprano::Node &value)
 
void setTypes (const QList< QUrl > &types)
 
void setUri (const QUrl &uri)
 
QList< Soprano::Statement > toStatementList () const
 
QUrl uri () const
 

Detailed Description

Represents a snapshot of one Nepomuk resource.

Author
Vishesh Handa handa.nosp@m..vis.nosp@m.h@gma.nosp@m.il.c.nosp@m.om, Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org

Definition at line 46 of file simpleresource.h.

Constructor & Destructor Documentation

Nepomuk2::SimpleResource::SimpleResource ( const QUrl &  uri = QUrl())
explicit

Definition at line 62 of file simpleresource.cpp.

Nepomuk2::SimpleResource::SimpleResource ( const PropertyHash &  properties)

Definition at line 68 of file simpleresource.cpp.

Nepomuk2::SimpleResource::SimpleResource ( const SimpleResource &  other)

Definition at line 75 of file simpleresource.cpp.

Nepomuk2::SimpleResource::~SimpleResource ( )
virtual

Definition at line 80 of file simpleresource.cpp.

Member Function Documentation

void Nepomuk2::SimpleResource::addProperties ( const PropertyHash &  properties)

Add a set of properties to the existing ones.

Definition at line 281 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::addProperty ( const QUrl &  property,
const QVariant &  value 
)

Add a property.

This allows to add more than one value for a property.

Parameters
propertyThe property to set
valueThe value of the property.

Definition at line 206 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::addProperty ( const QUrl &  property,
const SimpleResource &  res 
)

Add a property.

This allows to add more than one value for a property.

Parameters
propertyThe property to set
resThe value of the property.

Definition at line 213 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::addPropertyNode ( const QUrl &  property,
const Soprano::Node &  value 
)

Add a property.

Parameters
propertyThe property to set
valueThe value of the property. Will be converted to a QVariant.

Definition at line 218 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::addType ( const QUrl &  type)

A convenience method which adds a property of type rdf:type.

Parameters
typeThe type to add to the resource. Must be the URI of an RDF class.

Definition at line 257 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::clear ( )

Clear the resource, remove all properties.

Definition at line 276 of file simpleresource.cpp.

bool Nepomuk2::SimpleResource::contains ( const QUrl &  property) const

Definition at line 160 of file simpleresource.cpp.

bool Nepomuk2::SimpleResource::contains ( const QUrl &  property,
const QVariant &  value 
) const

Definition at line 165 of file simpleresource.cpp.

bool Nepomuk2::SimpleResource::containsNode ( const QUrl &  property,
const Soprano::Node &  value 
) const

Definition at line 170 of file simpleresource.cpp.

bool Nepomuk2::SimpleResource::isValid ( ) const
Returns
true if the resource is valid, ie. if it has a valid uri() and a non-empty list of properties.

Definition at line 132 of file simpleresource.cpp.

Nepomuk2::SimpleResource & Nepomuk2::SimpleResource::operator= ( const SimpleResource &  other)

Definition at line 84 of file simpleresource.cpp.

bool Nepomuk2::SimpleResource::operator== ( const SimpleResource &  other) const

Definition at line 150 of file simpleresource.cpp.

Nepomuk2::PropertyHash Nepomuk2::SimpleResource::properties ( ) const
Returns
All properties.

Definition at line 155 of file simpleresource.cpp.

QVariantList Nepomuk2::SimpleResource::property ( const QUrl &  property) const

Get all values for property.

Definition at line 292 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::remove ( const QUrl &  property,
const QVariant &  value 
)

Definition at line 227 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::remove ( const QUrl &  property)

Definition at line 232 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::removeAll ( const QUrl &  property,
const QVariant &  value 
)

Remove all property/value pairs matchin the provided pattern.

Both parameters can be set to empty values to act as wildcards.

Definition at line 237 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::setProperties ( const PropertyHash &  properties)

Set the properties, replacing the existing properties.

Definition at line 271 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::setProperty ( const QUrl &  property,
const QVariant &  value 
)

Set a property overwriting existing values.

Parameters
propertyThe property to set
valueThe value of the property.

Definition at line 186 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::setProperty ( const QUrl &  property,
const QVariantList &  values 
)

Set a property overwriting existing values.

Parameters
propertyThe property to set
valuesThe values of the property.

Definition at line 198 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::setProperty ( const QUrl &  property,
const SimpleResource &  res 
)

Set a property overwriting existing values.

Parameters
propertyThe property to set
setThe values of the property.

Definition at line 192 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::setPropertyNode ( const QUrl &  property,
const Soprano::Node &  value 
)

Set a property overwriting existing values.

Parameters
propertyThe property to set
valueThe value of the property. Will be converted to a QVariant.

Definition at line 180 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::setTypes ( const QList< QUrl > &  types)

A convenience method which sets the property of type rdf:type.

Parameters
typesThe types to set to the resource. Must be URIs of RDF classes.

Definition at line 262 of file simpleresource.cpp.

void Nepomuk2::SimpleResource::setUri ( const QUrl &  uri)

Setting an invalid/empty uri will create a new random ID.

This allows to reuse SimpleResource instances.

Definition at line 95 of file simpleresource.cpp.

QList< Soprano::Statement > Nepomuk2::SimpleResource::toStatementList ( ) const

Converts the resource into a list of statements.

None of the statements will have a valid context set.

Definition at line 112 of file simpleresource.cpp.

QUrl Nepomuk2::SimpleResource::uri ( ) const

Definition at line 90 of file simpleresource.cpp.


The documentation for this class was generated from the following files:
  • simpleresource.h
  • simpleresource.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

Skip menu "Nepomuk-Core"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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