• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDE Support
  • Sitemap
  • Contact Us
 

soprano

Soprano::Statement

Soprano::Statement Class Reference

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

#include <Soprano/Statement>

List of all members.

Public Member Functions



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

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  ) 
virtual Soprano::Statement::~Statement (  )  [virtual]

Member Function Documentation

Node Soprano::Statement::context (  )  const
Returns:
The Context node.
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
bool Soprano::Statement::matches ( const Statement &  other  )  const

Match this statement against template statement other.

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

Be aware that the following is NOT always true since only other is treated a a wildcard:

 // NOT always true:
 a.matches(b) == b.matches(a)
Returns:
true if this statement matches other, false if not.
See also:
Node::matches()
Node Soprano::Statement::object (  )  const
Returns:
The object.
bool Soprano::Statement::operator!= ( const Statement &  other  )  const
Statement& Soprano::Statement::operator= ( const Statement &  other  ) 
bool Soprano::Statement::operator== ( const Statement &  other  )  const
Node Soprano::Statement::predicate (  )  const
Returns:
The predicate.
void Soprano::Statement::setContext ( const Node &  context  ) 

Change the Statement context.

Parameters:
context The new Context.
void Soprano::Statement::setObject ( const Node &  object  ) 

Change the Statement object.

Parameters:
object The new object.
void Soprano::Statement::setPredicate ( const Node &  predicate  ) 

Change the Statement predicate.

Parameters:
predicate The new predicate.
void Soprano::Statement::setSubject ( const Node &  subject  ) 

Change the Statement subject.

Parameters:
subject The new subject.
Node Soprano::Statement::subject (  )  const
Returns:
The subject.

The documentation for this class was generated from the following file:
  • statement.h

soprano

Skip menu "soprano"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE Support

Skip menu "KDE Support"
  • akonadi
  • Decibel
  • grantlee
  • kdewin
  • phonon
  •     Backend
  • polkit-qt
  • qca
  • qimageblitz
  • soprano
  • strigi
  •     searchclient
  •     streamanalyzer
  •     streams
Generated for KDE Support by doxygen 1.5.9-20090814
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