Dataquay::Store Class Reference

Abstract interface for Dataquay RDF data stores. More...

#include <dataquay/Store.h>

Inherited by Dataquay::BasicStore, Dataquay::Connection, Dataquay::Transaction, and Dataquay::TransactionalStore.

List of all members.

Public Member Functions

virtual bool add (Triple t)=0
 Add a triple to the store.
virtual bool remove (Triple t)=0
 Remove a triple from the store.
virtual void change (ChangeSet changes)=0
 Atomically apply the sequence of add/remove changes described in the given ChangeSet.
virtual void revert (ChangeSet changes)=0
 Atomically apply the sequence of add/remove changes described in the given ChangeSet, in reverse (ie removing adds and adding removes, in reverse order).
virtual bool contains (Triple t) const =0
 Return true if the store contains the given triple, false otherwise.
virtual Triples match (Triple t) const =0
 Return all triples matching the given wildcard triple.
virtual ResultSet query (QString sparql) const =0
 Run a SPARQL query against the store and return its results.
virtual Triple matchFirst (Triple t) const =0
 Return the first triple to match the given wildcard triple.
virtual Node queryFirst (QString sparql, QString bindingName) const =0
 Run a SPARQL query against the store and return the node of the first result for the given query binding.
virtual QUrl getUniqueUri (QString prefix) const =0
 Get a new URI, starting with the given prefix, that does not currently exist within this store.
virtual QUrl expand (QString uri) const =0
 Expand the given URI (which may use local namespaces) and prefix-expand it, returning the result as a QUrl.

Protected Member Functions

virtual ~Store ()


Detailed Description

Abstract interface for Dataquay RDF data stores.

Definition at line 68 of file Store.h.


Constructor & Destructor Documentation

virtual Dataquay::Store::~Store (  )  [inline, protected, virtual]

Definition at line 171 of file Store.h.


Member Function Documentation

virtual bool Dataquay::Store::add ( Triple  t  )  [pure virtual]

Add a triple to the store.

Prefix expansion is performed on URI nodes in the triple. Return false if the triple was already in the store. (Although Redland permits duplicate triples in a store, Dataquay doesn't.) Throw RDFException if the triple can not be added for some other reason.

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

Referenced by Dataquay::PropertyObject::setProperty().

virtual bool Dataquay::Store::remove ( Triple  t  )  [pure virtual]

Remove a triple from the store.

Prefix expansion is performed on URI nodes in the triple. If some nodes in the triple are Nothing nodes, remove all matching triples. Return false if no matching triple was found in the store. Throw RDFException if removal failed for some other reason.

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

Referenced by Dataquay::PropertyObject::removeProperty(), and Dataquay::PropertyObject::setProperty().

virtual void Dataquay::Store::change ( ChangeSet  changes  )  [pure virtual]

Atomically apply the sequence of add/remove changes described in the given ChangeSet.

Throw RDFException if any operation fails for any reason (including duplication etc).

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

virtual void Dataquay::Store::revert ( ChangeSet  changes  )  [pure virtual]

Atomically apply the sequence of add/remove changes described in the given ChangeSet, in reverse (ie removing adds and adding removes, in reverse order).

Throw RDFException if any operation fails for any reason (including duplication etc).

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

virtual bool Dataquay::Store::contains ( Triple  t  )  const [pure virtual]

Return true if the store contains the given triple, false otherwise.

Prefix expansion is performed on URI nodes in the triple. Throw RDFException if the triple is not complete or if the test failed for any other reason.

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

virtual Triples Dataquay::Store::match ( Triple  t  )  const [pure virtual]

Return all triples matching the given wildcard triple.

A node of type Nothing in any part of the triple matches any node in the data store. Prefix expansion is performed on URI nodes in the triple. Return an empty list if there are no matches; may throw RDFException if matching fails in some other way.

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

virtual ResultSet Dataquay::Store::query ( QString  sparql  )  const [pure virtual]

Run a SPARQL query against the store and return its results.

Any prefixes added previously using addQueryPrefix will be available in this query without needing to be declared in the SPARQL given here (equivalent to writing "PREFIX prefix: <uri>" for each prefix,uri pair set with addPrefix).

May throw RDFException.

Note that the RDF store must have an absolute base URI (rather than the default "#") in order to perform queries, as relative URIs in the query will be interpreted relative to the query base rather than the store and without a proper base URI there is no way to override that internally.

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

virtual Triple Dataquay::Store::matchFirst ( Triple  t  )  const [pure virtual]

Return the first triple to match the given wildcard triple.

A node of type Nothing in any part of the triple matches any node in the data store. Prefix expansion is performed on URI nodes in the triple. Return an empty triple (three Nothing nodes) if there are no matches. May throw RDFException.

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

Referenced by Dataquay::PropertyObject::getProperty(), and Dataquay::PropertyObject::hasProperty().

virtual Node Dataquay::Store::queryFirst ( QString  sparql,
QString  bindingName 
) const [pure virtual]

Run a SPARQL query against the store and return the node of the first result for the given query binding.

This is a shorthand for use with queries that are only expected to have one result. May throw RDFException.

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

virtual QUrl Dataquay::Store::getUniqueUri ( QString  prefix  )  const [pure virtual]

Get a new URI, starting with the given prefix, that does not currently exist within this store.

The URI will be prefix expanded.

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

virtual QUrl Dataquay::Store::expand ( QString  uri  )  const [pure virtual]

Expand the given URI (which may use local namespaces) and prefix-expand it, returning the result as a QUrl.

(The QUrl class is not suitable for storing URIs that use namespaces, particularly local ones.)

Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.

Referenced by Dataquay::PropertyObject::getPropertyUri().


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

Generated on Thu Sep 24 23:19:49 2009 for Dataquay by  doxygen 1.5.7.1