34#ifndef DATAQUAY_STORE_H
35#define DATAQUAY_STORE_H
60typedef QPair<ChangeType, Triple>
Change;
200 virtual void save(QString filename)
const = 0;
QDataStream & operator>>(QDataStream &in, Dataquay::ChangeType &)
QDataStream & operator<<(QDataStream &out, const Dataquay::ChangeType &)
Node represents a single RDF node, with conversions to and from variant types.
Store is an abstract interface for Dataquay RDF data stores.
virtual Node complete(Triple t) const =0
Given a triple in which any two nodes are specified and the other is a wildcard node of type Nothing,...
Feature
Feature defines the set of optional features a Store implementation may support.
virtual Triple matchOnce(Triple t) const =0
Return a triple from the store that matches the given wildcard triple, or the empty triple if none ma...
virtual Uri getUniqueUri(QString prefix) const =0
Get a new URI, starting with the given prefix (e.g.
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...
virtual ResultSet query(QString sparql) const =0
Run a SPARQL query against the store and return its results.
virtual bool contains(Triple t) const =0
Return true if the store contains the given triple, false otherwise.
virtual void save(QString filename) const =0
Export the store to an RDF/TTL file with the given filename.
virtual bool add(Triple t)=0
Add a triple to the store.
virtual Triples match(Triple t) const =0
Return all triples matching the given wildcard triple.
virtual void revert(ChangeSet changes)=0
Atomically apply the sequence of add/remove changes described in the given ChangeSet,...
virtual Node addBlankNode()=0
Create and return a new blank node.
virtual bool remove(Triple t)=0
Remove a triple from the store.
virtual Features getSupportedFeatures() const =0
Retrieve the set of optional features supported by this Store implementation.
ImportDuplicatesMode
ImportDuplicatesMode determines the outcome when an import operation encounters a triple in the impor...
virtual void change(ChangeSet changes)=0
Atomically apply the sequence of add/remove changes described in the given ChangeSet.
virtual void importString(QString encodedRdf, Uri baseUri, ImportDuplicatesMode idm, QString format="")=0
Import the RDF document encoded in the given string into the current store (in addition to its existi...
virtual Node queryOnce(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 bind...
Triple represents an RDF statement made up of three Node objects.
Uri represents a single URI.
QPair< ChangeType, Triple > Change
An add or remove operation specified by add/remove token and triple.
QList< Change > ChangeSet
A sequence of add/remove operations such as may be enacted by a transaction.
QList< Dictionary > ResultSet
A list of Dictionary types, used to contain a sequence of query results.
QHash< QString, Node > Dictionary
A mapping from key to node, used to list results for a set of result keys.