Syndication::RDF::Resource

Search for usage in LXR

Syndication::RDF::Resource Class Reference

#include <resource.h>

Inheritance diagram for Syndication::RDF::Resource:

Public Member Functions

 Resource ()
 
 Resource (const QString &uri)
 
 Resource (const Resource &other)
 
 ~Resource () override
 
void accept (NodeVisitor *visitor, NodePtr ptr) override
 
Resourceclone () const override
 
virtual bool hasProperty (PropertyPtr property) const
 
unsigned int id () const override
 
bool isAnon () const override
 
bool isLiteral () const override
 
bool isNull () const override
 
bool isProperty () const override
 
bool isResource () const override
 
bool isSequence () const override
 
virtual Model model () const
 
Resourceoperator= (const Resource &other)
 
bool operator== (const Resource &other) const
 
virtual QList< StatementPtrproperties (PropertyPtr property) const
 
virtual StatementPtr property (PropertyPtr property) const
 
void setId (unsigned int id) override
 
void setModel (const Model &model) override
 
QString text () const override
 
virtual QString uri () const
 
- Public Member Functions inherited from Syndication::RDF::Node
virtual ~Node ()
 

Additional Inherited Members

- Static Protected Attributes inherited from Syndication::RDF::Node
static unsigned int idCounter = 1
 

Detailed Description

Resources are the entities in the RDF graph.

In RSS, e.g. the feed channel itself and the items are resources.

Definition at line 36 of file resource.h.

Constructor & Destructor Documentation

◆ Resource() [1/3]

Resource::Resource ( )

creates a null resource

Definition at line 48 of file resource.cpp.

◆ Resource() [2/3]

Resource::Resource ( const Resource & other)

copies a resource

Parameters
otherthe resource to copy

Definition at line 42 of file resource.cpp.

◆ Resource() [3/3]

Resource::Resource ( const QString & uri)
explicit

creates a resource with a given URI.

Do not use this directly, use Model::createResource() instead.

Parameters
urithe URI of the new resource

Definition at line 53 of file resource.cpp.

◆ ~Resource()

Resource::~Resource ( )
override

destructor

Definition at line 67 of file resource.cpp.

Member Function Documentation

◆ accept()

void Resource::accept ( NodeVisitor * visitor,
NodePtr ptr )
overridevirtual

Used by visitors for double dispatch.

See NodeVisitor for more information.

Parameters
visitorthe visitor calling the method
ptra shared pointer object for this node

Reimplemented from Syndication::RDF::Node.

Reimplemented in Syndication::RDF::Sequence.

Definition at line 128 of file resource.cpp.

◆ clone()

Resource * Resource::clone ( ) const
overridevirtual

creates a copy of the resource object

Implements Syndication::RDF::Node.

Reimplemented in Syndication::RDF::Sequence.

Definition at line 123 of file resource.cpp.

◆ hasProperty()

bool Resource::hasProperty ( PropertyPtr property) const
virtual

returns whether the resource has a property property in the associated model.

Parameters
propertythe property to check for

Definition at line 85 of file resource.cpp.

◆ id()

unsigned int Resource::id ( ) const
overridevirtual

the identifier of this node.

the ID is unique per model and set by the associated model at creation time.

Implements Syndication::RDF::Node.

Definition at line 136 of file resource.cpp.

◆ isAnon()

bool Resource::isAnon ( ) const
overridevirtual

returns whether this resource is an anonymous resource

Implements Syndication::RDF::Node.

Definition at line 178 of file resource.cpp.

◆ isLiteral()

bool Resource::isLiteral ( ) const
overridevirtual

returns false

Implements Syndication::RDF::Node.

Definition at line 173 of file resource.cpp.

◆ isNull()

bool Resource::isNull ( ) const
overridevirtual

returns whether the resource is a null resource

Implements Syndication::RDF::Node.

Definition at line 141 of file resource.cpp.

◆ isProperty()

bool Resource::isProperty ( ) const
overridevirtual

returns true if this resource is also a property, false otherwise

Implements Syndication::RDF::Node.

Definition at line 168 of file resource.cpp.

◆ isResource()

bool Resource::isResource ( ) const
overridevirtual

returns true

Implements Syndication::RDF::Node.

Definition at line 163 of file resource.cpp.

◆ isSequence()

bool Resource::isSequence ( ) const
overridevirtual

returns true if this resource is also a sequence, false otherwise.

Implements Syndication::RDF::Node.

Reimplemented in Syndication::RDF::Sequence.

Definition at line 183 of file resource.cpp.

◆ model()

Model Resource::model ( ) const
virtual

the model this resource belongs to

Definition at line 146 of file resource.cpp.

◆ operator=()

Resource & Resource::operator= ( const Resource & other)

assigns a resource

Parameters
otherthe resource to assign

Definition at line 71 of file resource.cpp.

◆ operator==()

bool Resource::operator== ( const Resource & other) const

checks two resources for equality.

Currently both URI (or anonID) and id() must be equal!

Parameters
otherthe node to compare this node to

Definition at line 77 of file resource.cpp.

◆ properties()

QList< StatementPtr > Resource::properties ( PropertyPtr property) const
virtual

returns the list of all statements from the associated model where this resource is the subject and the given property the predicate.

Parameters
propertythe property to check for
Returns
a list of the statements that satisfy the conditions.

Definition at line 110 of file resource.cpp.

◆ property()

StatementPtr Resource::property ( PropertyPtr property) const
virtual

returns a statement from the associated model where this resource is the subject and the given property the predicate.

Parameters
propertythe property to check for
Returns
the first statement found that satisfies the conditions. If there are multiple statements, an arbitrary one is returned.

Definition at line 97 of file resource.cpp.

◆ setId()

void Resource::setId ( unsigned int id)
overridevirtual

used in Model

Implements Syndication::RDF::Node.

Definition at line 195 of file resource.cpp.

◆ setModel()

void Resource::setModel ( const Model & model)
overridevirtual

used in Model

Implements Syndication::RDF::Node.

Definition at line 188 of file resource.cpp.

◆ text()

QString Resource::text ( ) const
overridevirtual

returns a null string

Implements Syndication::RDF::Node.

Definition at line 202 of file resource.cpp.

◆ uri()

QString Resource::uri ( ) const
virtual

returns the URI of the resource

Definition at line 207 of file resource.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 Fri Oct 11 2024 12:09:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.