/usr/include/dataquay/BasicStore.h is in libdataquay-dev 0.9.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
Dataquay
A C++/Qt library for simple RDF datastore management.
Copyright 2009-2012 Chris Cannam.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Chris Cannam
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written
authorization.
*/
#ifndef _DATAQUAY_BASIC_STORE_H_
#define _DATAQUAY_BASIC_STORE_H_
#include "Store.h"
namespace Dataquay
{
/**
* \class BasicStore BasicStore.h <dataquay/BasicStore.h>
*
* BasicStore is an in-memory RDF data store implementing the Store
* interface, providing add, remove, matching and query operations for
* RDF triples and SPARQL, as well as export and import.
*
* BasicStore uses a Redland or Sord datastore internally, depending
* on whether USE_REDLAND or USE_SORD was defined when Dataquay was
* built.
*
* All operations are thread safe.
*/
class BasicStore : public Store
{
public:
BasicStore();
~BasicStore();
/**
* Set the base URI for the store. This is used to expand the
* empty URI prefix when adding and querying triples, and is also
* used as the document base URI when exporting.
*/
void setBaseUri(Uri uri);
/**
* Retrieve the base URI for the store.
*/
Uri getBaseUri() const;
/**
* Empty the store of triples. Prefixes that have been added with
* addPrefix are unaffected.
*!!! hoist to Store()?
*/
void clear();
/**
* Add a prefix/uri pair (an XML namespace, except that this class
* doesn't directly deal in XML) for use in subsequent operations.
* If the prefix has already been added, this overrides any uri
* associated with it.
*
* Example: addPrefix("dc", "http://purl.org/dc/elements/1.1/") to
* add a prefix for the Dublin Core namespace.
*
* The store always knows about the XSD and RDF namespaces.
*
* Note that the base URI is always available as the empty prefix.
* For example, the URI ":blather" will be expanded to the base
* URI plus "blather".
*/
void addPrefix(QString prefix, Uri uri);
// Store interface
bool add(Triple t);
bool remove(Triple t);
void change(ChangeSet changes);
void revert(ChangeSet changes);
bool contains(Triple t) const;
Triples match(Triple t) const;
ResultSet query(QString sparql) const;
Node complete(Triple t) const;
Triple matchOnce(Triple t) const;
Node queryOnce(QString sparql, QString bindingName) const;
Uri getUniqueUri(QString prefix) const;
Node addBlankNode();
Uri expand(QString uri) const;
void save(QString filename) const;
void import(QUrl url, ImportDuplicatesMode idm, QString format = "");
Features getSupportedFeatures() const;
/**
* Construct a new BasicStore from the RDF document at the given
* URL. May throw RDFException. The returned BasicStore is owned
* by the caller and must be deleted using delete when finished
* with. The return value is never NULL; all errors result in
* exceptions.
*
* Note that the URL must be a URL, not just a filename
* (i.e. local files need the file: prefix). The file URL will
* also become the base URI of the store.
*
* If format is specified, it will be taken as the RDF parse
* format (e.g. ntriples). The set of supported format strings
* depends on the underlying RDF library configuration. The
* default is to guess the format if possible.
*/
static BasicStore *load(QUrl url, QString format = "");
private:
class D;
D *m_d;
};
}
#endif
|