Syndication::RDF::Model

Search for usage in LXR

Syndication::RDF::Model Class Reference

#include <model.h>

Public Member Functions

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

Detailed Description

An RDF model, a set of RDF statements.

Model objects are implicitly shared.

Author
Frank Osterfeld

Definition at line 36 of file model.h.

Constructor & Destructor Documentation

◆ Model() [1/2]

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

default constructor, creates an empty model containing no statements

Definition at line 17 of file model.cpp.

◆ Model() [2/2]

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
otheranother model

Definition at line 22 of file model.cpp.

◆ ~Model()

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

destructor

Definition at line 27 of file model.cpp.

Member Function Documentation

◆ addStatement()

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 122 of file model.cpp.

◆ createLiteral()

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

creates a literal and associates it with this model.

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

Definition at line 98 of file model.cpp.

◆ createProperty()

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
urithe 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 42 of file model.cpp.

◆ createResource()

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
urithe URI of the resource. If a null string, a blank node is created.
Returns
a shared pointer to the requested resource

Definition at line 62 of file model.cpp.

◆ createSequence()

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
urithe URI of the sequence, or a null string for an anonymous instance
Returns
a shared pointer to the requested sequence

Definition at line 77 of file model.cpp.

◆ debugInfo()

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

/** a debug string listing the contained statements for debugging purposes

Returns
debug string

Definition at line 231 of file model.cpp.

◆ isEmpty()

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

returns whether this model is empty, i.e.

contains no statements.

Definition at line 169 of file model.cpp.

◆ literalByID()

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

searches the model for a literal by ID.

Parameters
idthe 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 313 of file model.cpp.

◆ nodeByID()

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

searches the model for a node by ID.

Parameters
idthe 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 261 of file model.cpp.

◆ operator=()

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
otheranother model

Definition at line 31 of file model.cpp.

◆ operator==()

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 independently created models containing the same statements are not equal!

Parameters
otherthe model to compare to

Definition at line 37 of file model.cpp.

◆ propertyByID()

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

searches the model for a property by ID.

Parameters
idthe 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 294 of file model.cpp.

◆ removeStatement() [1/2]

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

removes a statement from the model.

Parameters
subjectsubject of the statement
predicatepredicate of the statement
objectobject of the statement

Definition at line 111 of file model.cpp.

◆ removeStatement() [2/2]

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

removes a statement from the model.

Parameters
statementthe statement to remove

Definition at line 106 of file model.cpp.

◆ resourceByID()

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

searches the model for a resource by ID.

Parameters
idthe 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 275 of file model.cpp.

◆ resourcesWithType()

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

returns all resources of a given type.

subClassOf semantics are ignored.

Parameters
typea resource representing an RDFS class

Definition at line 247 of file model.cpp.

◆ statements()

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

returns a list of the statements in this model.

Definition at line 226 of file model.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:15 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.