6 #ifndef KNOWROB_REDLAND_MODEL_H
7 #define KNOWROB_REDLAND_MODEL_H
10 #include "knowrob/semweb/TripleContainer.h"
11 #include "knowrob/URI.h"
12 #include "knowrob/semweb/TripleFormat.h"
13 #include "knowrob/storage/Storage.h"
14 #include "knowrob/semweb/SPARQLQuery.h"
16 #include "knowrob/storage/SPARQLBackend.h"
52 class RedlandModel :
public SPARQLBackend {
196 std::map<std::string, librdf_node *, std::less<>>
contextNodes_;
200 std::optional<std::string>
origin_;
201 std::optional<std::string>
host_;
202 std::optional<std::string>
port_;
204 std::optional<std::string>
user_;
207 std::optional<RedlandHashType>
hashType_;
bool insertOne(const Triple &triple) override
std::optional< std::string > port_
librdf_node * getContextNode(const Triple &triple)
librdf_world * ownedWorld_
void setRaptorWorld(librdf_world *world)
void setUser(std::string_view user)
bool isInitialized() const
std::map< std::string, librdf_node *, std::less<> > contextNodes_
void batchOrigin(std::string_view origin, const TripleHandler &callback) override
void knowrobToRaptor(const Triple &triple, raptor_statement *raptorTriple)
raptor_term * knowrobToRaptor(const TermPtr &term)
void setStorageType(RedlandStorageType storageType)
void batch(const TripleHandler &callback) const override
std::optional< std::string > storageDir_
void match(const TriplePattern &query, const TripleVisitor &visitor) override
bool removeAll(const TripleContainerPtr &triples) override
librdf_storage * storage_
RedlandURI xsdURIs_[static_cast< int >(XSDType::LAST)]
bool load(const URI &uri, semweb::TripleFormat tripleFormat)
bool isPersistent() const override
std::optional< std::string > host_
bool insertAll(const TripleContainerPtr &triples) override
void setStorageHashType(RedlandHashType hashType)
void setPassword(std::string_view password)
bool contains(const Triple &triple) override
std::optional< std::string > password_
void setOrigin(std::string_view origin)
bool sparql(std::string_view queryString, const BindingsHandler &callback) const override
void setHost(std::string_view host)
std::string getStorageOptions() const
bool removeAllWithOrigin(std::string_view origin) override
bool initializeBackend(const PropertyTree &config) override
std::optional< std::string > origin_
void setDatabase(std::string_view database)
void setHashesStorage(RedlandHashType hashType, std::string_view dir=".")
librdf_node * getContextNode(std::string_view origin)
std::optional< std::string > database_
std::string storageOptions_
RedlandStorageType storageType_
void setStorageDirectory(std::string_view dir=".")
void knowrobToRaptor(const TriplePattern &pat, raptor_statement *raptorTriple)
RedlandURI & xsdURI(XSDType xsdType)
std::optional< std::string > user_
static constexpr std::string_view QUERY_LANGUAGE_SPARQL
std::optional< RedlandHashType > hashType_
bool removeOne(const Triple &triple) override
bool query(const SPARQLQuery &query, const BindingsHandler &callback) const
std::function< void(const TriplePtr &)> TripleVisitor
std::shared_ptr< TripleContainer > TripleContainerPtr
std::shared_ptr< Term > TermPtr
std::function< void(const BindingsPtr &)> BindingsHandler
std::function< void(const TripleContainerPtr &)> TripleHandler
XSDType
The XSDType enum Enumeration of the XSD types.