30#include <QtCore/QString>
32#include <boost/weak_ptr.hpp>
36namespace Syndication {
39class Statement::StatementPrivate
46 weak_ptr<Model::ModelPrivate> model;
48 bool operator==(
const StatementPrivate& other)
const
51 return subjectID == other.subjectID &&
52 predicateID == other.predicateID &&
53 objectID == other.objectID;
70 NodePtr
object) : d(new StatementPrivate)
75 d->objectID =
object->id();
93 return *d == *(other.d);
98 return d->subjectID == 0;
103 const shared_ptr<Model::ModelPrivate> m = d ? d->model.lock() : shared_ptr<Model::ModelPrivate>();
104 return m ? m->resourceByID(d->subjectID) : ResourcePtr(
new Resource);
109 const shared_ptr<Model::ModelPrivate> m = d ? d->model.lock() : shared_ptr<Model::ModelPrivate>();
110 return m ? m->propertyByID(d->predicateID) : PropertyPtr(
new Property() );
115 const shared_ptr<Model::ModelPrivate> m = d ? d->model.lock() : shared_ptr<Model::ModelPrivate>();
116 return m ? m->nodeByID(d->objectID) : NodePtr( LiteralPtr(
new Literal() ) );
121 const shared_ptr<Model::ModelPrivate> m = d ? d->model.lock() : shared_ptr<Model::ModelPrivate>();
123 if (
isNull() || !m || !m->nodeByID(d->objectID)->isResource())
126 return m->resourceByID(d->objectID);
134 const shared_ptr<Model::ModelPrivate> m = d ? d->model.lock() : shared_ptr<Model::ModelPrivate>();
135 return m ? m->nodeByID(d->objectID)->text() : QString();
a node type representing simple string values.
a property is node type that represents properties of things, like "name" is a property of a person,...
Resources are the entities in the RDF graph.
An RDF statement, consisting of a triple (subject, predicate, object).
virtual QString asString() const
returns the object of this statement as string, if possible.
virtual ~Statement()
destructor
virtual bool isNull() const
returns whether this statement is a null statement (i.e.
Statement & operator=(const Statement &other)
assigns another statement
virtual ResourcePtr subject() const
the subject of the statement.
virtual NodePtr object() const
the object of the statement
Statement()
creates a null statement
virtual PropertyPtr predicate() const
the predicate of the statement
virtual ResourcePtr asResource() const
returns the object of this statement as resource, if possible.
virtual bool operator==(const Statement &other) const
returns whether two statements are equal.