• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

syndication/rdf

Syndication::RDF::Model

Syndication::RDF::Model Class Reference

#include <model.h>

List of all members.


Detailed Description

An RDF model, a set of RDF statements.

Model objects are implicitely shared.

Author:
Frank Osterfeld

Definition at line 46 of file model.h.


Public Member Functions

 Model ()
 Model (const Model &other)
virtual ~Model ()
Model & operator= (const Model &other)
bool operator== (const Model &other) const
virtual ResourcePtr createResource (const QString &uri=QString())
virtual PropertyPtr createProperty (const QString &uri)
virtual SequencePtr createSequence (const QString &uri=QString())
virtual LiteralPtr createLiteral (const QString &text)
virtual StatementPtr addStatement (ResourcePtr subject, PropertyPtr predicate, NodePtr object)
virtual void removeStatement (ResourcePtr subject, PropertyPtr predicate, NodePtr object)
virtual void removeStatement (StatementPtr statement)
virtual bool isEmpty () const
virtual QList< ResourcePtr > resourcesWithType (ResourcePtr type) const
virtual QList< StatementPtr > statements () const
virtual NodePtr nodeByID (uint id) const
virtual ResourcePtr resourceByID (uint id) const
virtual PropertyPtr propertyByID (uint id) const
virtual LiteralPtr literalByID (uint id) const
virtual QString debugInfo () const

Constructor & Destructor Documentation

Syndication::RDF::Model::Model (  ) 

default constructor, creates an empty model containing no statements

Definition at line 157 of file model.cpp.

Syndication::RDF::Model::Model ( const Model &  other  ) 

constructs a model from another.

Both models will share the same set of statements, so adding/removing statements from one model also modifies the other!

Parameters:
other another model

Definition at line 161 of file model.cpp.

Syndication::RDF::Model::~Model (  )  [virtual]

destructor

Definition at line 166 of file model.cpp.


Member Function Documentation

Model & Syndication::RDF::Model::operator= ( const Model &  other  ) 

assigns another model.

Both models will share the same set of statements, so adding/removing statements from one model also modifies the other!

Parameters:
other another model

Definition at line 170 of file model.cpp.

bool Syndication::RDF::Model::operator== ( const Model &  other  )  const

Returns whether two models objects represent the same model (i.e.

share the same underlying statement set). Currently this method does _not_ compare the statement list. Two indepently created models containing the same statements are not equal!

Parameters:
other the model to compare to

Definition at line 176 of file model.cpp.

ResourcePtr Syndication::RDF::Model::createResource ( const QString &  uri = QString()  )  [virtual]

creates a resource and associates it with this model.

If the model already contains a resource with the given URI, the existing instance is returned.

Parameters:
uri the URI of the resource. If a null string, a blank node is created.
Returns:
a shared pointer to the requested resource

Definition at line 206 of file model.cpp.

PropertyPtr Syndication::RDF::Model::createProperty ( const QString &  uri  )  [virtual]

creates a property and associates it with this model.

If the model already contains a property with the given URI, the existing instance is returned.

Parameters:
uri the URI of the property. This must be non-empty, otherwise null property is returned
Returns:
a shared pointer to the requested property

Definition at line 181 of file model.cpp.

SequencePtr Syndication::RDF::Model::createSequence ( const QString &  uri = QString()  )  [virtual]

creates a sequence and associates it with this model.

If the model already contains a sequence with the given URI, the existing instance is returned.

Parameters:
uri the URI of the sequence, or a null string for an anonymous instance
Returns:
a shared pointer to the requested sequence

Definition at line 224 of file model.cpp.

LiteralPtr Syndication::RDF::Model::createLiteral ( const QString &  text  )  [virtual]

creates a literal and associates it with this model.

Parameters:
text the literal text
Returns:
a shared pointer to the requested literal

Definition at line 249 of file model.cpp.

StatementPtr Syndication::RDF::Model::addStatement ( ResourcePtr  subject,
PropertyPtr  predicate,
NodePtr  object 
) [virtual]

adds a statement to the model.

Parameters:
subject 
predicate 
object 
Returns:
a shared pointer to a statement associated with this model, with the given subject, predicate and object

Definition at line 272 of file model.cpp.

void Syndication::RDF::Model::removeStatement ( ResourcePtr  subject,
PropertyPtr  predicate,
NodePtr  object 
) [virtual]

removes a statement from the model.

Parameters:
subject subject of the statement
predicate predicate of the statement
object object of the statement

Definition at line 263 of file model.cpp.

void Syndication::RDF::Model::removeStatement ( StatementPtr  statement  )  [virtual]

removes a statement from the model.

Parameters:
statement the statement to remove

Definition at line 258 of file model.cpp.

bool Syndication::RDF::Model::isEmpty (  )  const [virtual]

returns whether this model is empty, i.e.

contains no statements.

Definition at line 324 of file model.cpp.

QList< ResourcePtr > Syndication::RDF::Model::resourcesWithType ( ResourcePtr  type  )  const [virtual]

returns all resources of a given type.

subClassOf semantics are ignored.

Parameters:
type a resource representing an RDFS class

Definition at line 411 of file model.cpp.

QList< StatementPtr > Syndication::RDF::Model::statements (  )  const [virtual]

returns a list of the statements in this model.

Definition at line 380 of file model.cpp.

NodePtr Syndication::RDF::Model::nodeByID ( uint  id  )  const [virtual]

searches the model for a node by ID.

Parameters:
id the ID to search for
Returns:
the node with the given ID, or a null node (which is of type Literal) if the model doesn't contain the node with this ID

Definition at line 428 of file model.cpp.

ResourcePtr Syndication::RDF::Model::resourceByID ( uint  id  )  const [virtual]

searches the model for a resource by ID.

Parameters:
id the ID to search for
Returns:
the resource with the given ID, or a null resource if the model doesn't contain a resource with this ID

Definition at line 440 of file model.cpp.

PropertyPtr Syndication::RDF::Model::propertyByID ( uint  id  )  const [virtual]

searches the model for a property by ID.

Parameters:
id the ID to search for
Returns:
the property with the given ID, or a null property if the model doesn't contain a property with this ID

Definition at line 456 of file model.cpp.

LiteralPtr Syndication::RDF::Model::literalByID ( uint  id  )  const [virtual]

searches the model for a literal by ID.

Parameters:
id the ID to search for
Returns:
the literal with the given ID, or a null literal if the model doesn't contain a literal with this ID

Definition at line 472 of file model.cpp.

QString Syndication::RDF::Model::debugInfo (  )  const [virtual]

a debug string listing the contained statements for debugging purposes

Returns:
debug string

Definition at line 385 of file model.cpp.


The documentation for this class was generated from the following files:
  • model.h
  • model.cpp

syndication/rdf

Skip menu "syndication/rdf"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal