Soprano::Statement Class Reference

A Statement instance represents one RDF quadruple. More...

#include <Soprano/Statement>

List of all members.

Public Member Functions

 Statement ()
 Statement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
 Statement (const Statement &other)
virtual ~Statement ()
Statementoperator= (const Statement &other)
bool operator== (const Statement &other) const
bool operator!= (const Statement &other) const
bool matches (const Statement &other) const
bool isValid () const
Node subject () const
Node predicate () const
Node object () const
Node context () const
void setSubject (const Node &subject)
void setPredicate (const Node &predicate)
void setObject (const Node &object)
void setContext (const Node &context)


Detailed Description

A Statement instance represents one RDF quadruple.

In Soprano statements are quadruples, i.e. in addition to the subject, predicate, and object nodes, they have a fourth node, the context. The context represents the named graph in which the statement is stored. If the context is an empty node the statement is stored in the default graph.

A Statement is valid if subject, predicate, and object are valid. Invalid statements can, however, be used in many methods such as Model::listStatements as wildwards.

See also:
Node
Author:
Daniele Galdi <daniele.galdi@gmail.com>
Sebastian Trueg <trueg@kde.org>

Definition at line 47 of file statement.h.


Constructor & Destructor Documentation

Soprano::Statement::Statement (  ) 

Default Constructor, build an empty (invalid) Statement.

Soprano::Statement::Statement ( const Node subject,
const Node predicate,
const Node object,
const Node context = Node() 
)

Build a Statement with the given subject, predicate and object.

Parameters:
subject The subject (cannot be of type Node::LiteralNode)
predicate The predicate (has to be of type Node::ResourceNode or Node::EmptyNode)
object The object can be of either Node type.
context The context node (has to be of type Node::ResourceNode or Node::EmptyNode)

Soprano::Statement::Statement ( const Statement other  ) 

Default Constructor, build an empty (invalid) Statement.

virtual Soprano::Statement::~Statement (  )  [virtual]

Default Constructor, build an empty (invalid) Statement.


Member Function Documentation

Statement& Soprano::Statement::operator= ( const Statement other  ) 

Default Constructor, build an empty (invalid) Statement.

bool Soprano::Statement::operator== ( const Statement other  )  const

Match this statement against other. The only difference to operator== is that empty nodes are matched as wildcards, i.e. they match any other node.

See also:
Node::matches()
Returns:
true if this statement matches other, false if not.

bool Soprano::Statement::operator!= ( const Statement other  )  const

Match this statement against other. The only difference to operator== is that empty nodes are matched as wildcards, i.e. they match any other node.

See also:
Node::matches()
Returns:
true if this statement matches other, false if not.

bool Soprano::Statement::matches ( const Statement other  )  const

Match this statement against other. The only difference to operator== is that empty nodes are matched as wildcards, i.e. they match any other node.

See also:
Node::matches()
Returns:
true if this statement matches other, false if not.

bool Soprano::Statement::isValid (  )  const

A Statement is valid if the subject is a resource or blank node, the predicate is a resource node, and the object is a valid node.

Returns:
true if the Statement is valid, false otherwise

Node Soprano::Statement::subject (  )  const

Returns:
The subject.

Node Soprano::Statement::predicate (  )  const

Returns:
The predicate.

Node Soprano::Statement::object (  )  const

Returns:
The object.

Node Soprano::Statement::context (  )  const

Returns:
The Context node.

void Soprano::Statement::setSubject ( const Node subject  ) 

Change the Statement subject.

Parameters:
subject The new subject.

void Soprano::Statement::setPredicate ( const Node predicate  ) 

Change the Statement predicate.

Parameters:
predicate The new predicate.

void Soprano::Statement::setObject ( const Node object  ) 

Change the Statement object.

Parameters:
object The new object.

void Soprano::Statement::setContext ( const Node context  ) 

Change the Statement context.

Parameters:
context The new Context.


The documentation for this class was generated from the following file:

Generated on Tue Jul 22 17:39:35 2008 for Soprano by  doxygen 1.5.6