Dataquay::Store Class Reference
Store is an abstract interface for Dataquay RDF data stores. More...
#include <dataquay/Store.h>

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 Uri | getUniqueUri (QString prefix) const =0 |
| Get a new URI, starting with the given prefix (e.g. | |
| virtual Node | addBlankNode ()=0 |
| Create and return a new blank node. | |
| virtual Uri | expand (QString uri) const =0 |
| Expand the given URI (which may use local namespaces) and prefix-expand it, returning the result as a Uri. | |
| virtual void | save (QString filename) const =0 |
| Export the store to an RDF/TTL file with the given filename. | |
Protected Member Functions | |
| virtual | ~Store () |
Detailed Description
Store is an abstract interface for Dataquay RDF data stores.
Definition at line 67 of file Store.h.
Constructor & Destructor Documentation
| virtual Dataquay::Store::~Store | ( | ) | [inline, protected, virtual] |
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. (Dataquay does not permit duplicate triples in a store.) 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(), and Dataquay::PropertyObject::setPropertyList().
| 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(), Dataquay::PropertyObject::setProperty(), and Dataquay::PropertyObject::setPropertyList().
| 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.
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.
Referenced by Dataquay::PropertyObject::getPropertyList(), Dataquay::PropertyObject::getPropertyNames(), and Dataquay::PropertyObject::getPropertyNodeList().
| 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.
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::getObjectType(), Dataquay::PropertyObject::getProperty(), Dataquay::PropertyObject::getPropertyNode(), 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 Uri Dataquay::Store::getUniqueUri | ( | QString | prefix | ) | const [pure virtual] |
Get a new URI, starting with the given prefix (e.g.
":event_"), that does not currently exist within this store. The URI will be prefix expanded.
Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.
| virtual Node Dataquay::Store::addBlankNode | ( | ) | [pure virtual] |
Create and return a new blank node.
This node can only be referred to using the given Node object, and only during its lifetime within this instance of the store.
Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.
| virtual Uri 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 Uri.
(The Uri class cannot be used to store URIs that have unexpanded namespace prefixes.)
The set of available prefixes for expansion depends on the subclass implementation. See, for example, BasicStore::addPrefix.
Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.
Referenced by Dataquay::CacheingPropertyObject::getObjectType(), Dataquay::PropertyObject::getPropertyUri(), and Dataquay::PropertyObject::PropertyObject().
| virtual void Dataquay::Store::save | ( | QString | filename | ) | const [pure virtual] |
Export the store to an RDF/TTL file with the given filename.
If the file already exists, it will if possible be overwritten.
Implemented in Dataquay::BasicStore, Dataquay::Connection, and Dataquay::TransactionalStore.
The documentation for this class was generated from the following file:
Generated on Thu May 17 22:54:21 2012 for Dataquay by
1.6.3