knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::TransformedOntology Class Reference

#include <TransformedOntology.h>

Inheritance diagram for knowrob::TransformedOntology:
Collaboration diagram for knowrob::TransformedOntology:

Public Member Functions

 TransformedOntology (const URI &uri, std::string_view format)
 
bool load (const TripleHandler &callback) override
 
auto & storage ()
 
 TransformedOntology (const URI &uri, std::string_view format)
 
bool load (const TripleHandler &callback) override
 
auto & storage ()
 
- Public Member Functions inherited from knowrob::OntologySource
 OntologySource (const URI &uri, std::string_view format)
 
virtual ~OntologySource ()=default
 
void setFrame (const GraphSelectorPtr &frame)
 
const auto & frame () const
 
void setParentOrigin (std::string_view parentOrigin)
 
auto & parentOrigin () const
 
std::string_view origin () const
 
const auto & imports () const
 
void setImports (const std::vector< std::string > &imports)
 
 OntologySource (const URI &uri, std::string_view format)
 
virtual ~OntologySource ()=default
 
void setFrame (const GraphSelectorPtr &frame)
 
const auto & frame () const
 
void setParentOrigin (std::string_view parentOrigin)
 
auto & parentOrigin () const
 
std::string_view origin () const
 
const auto & imports () const
 
void setImports (const std::vector< std::string > &imports)
 
- Public Member Functions inherited from knowrob::DataSource
 DataSource (URI uri, std::string_view format, DataSourceType dataSourceType)
 
const auto & uri () const
 
const auto & path () const
 
const auto & format () const
 
DataSourceType dataSourceType () const
 
auto name () const
 
auto version () const
 
 DataSource (URI uri, std::string_view format, DataSourceType dataSourceType)
 
const auto & uri () const
 
const auto & path () const
 
const auto & format () const
 
DataSourceType dataSourceType () const
 
auto name () const
 
auto version () const
 

Protected Attributes

std::unique_ptr< RedlandModelstorage_
 
- Protected Attributes inherited from knowrob::OntologySource
GraphSelectorPtr frame_
 
std::optional< std::string > parentOrigin_
 
std::string origin_
 
std::vector< std::string > imports_
 
- Protected Attributes inherited from knowrob::DataSource
DataSourceType dataSourceType_
 
std::string format_
 
URI uri_
 

Additional Inherited Members

- Static Public Member Functions inherited from knowrob::DataSource
static std::string getNameFromURI (const std::string &uriString)
 
static std::string getVersionFromURI (const std::string &uriString)
 
static bool isVersionString (const std::string &versionString)
 
static std::shared_ptr< DataSourcecreate (const VocabularyPtr &vocabulary, const boost::property_tree::ptree &config)
 
static std::string getNameFromURI (const std::string &uriString)
 
static std::string getVersionFromURI (const std::string &uriString)
 
static bool isVersionString (const std::string &versionString)
 
static std::shared_ptr< DataSourcecreate (const VocabularyPtr &vocabulary, const boost::property_tree::ptree &config)
 

Detailed Description

The result of an ontology transformation as a new ontology source.

Definition at line 16 of file TransformedOntology.h.

Constructor & Destructor Documentation

◆ TransformedOntology() [1/2]

TransformedOntology::TransformedOntology ( const URI uri,
std::string_view  format 
)

Create a new transformed ontology.

Parameters
urithe URI of the original ontology.
formatthe format of the original ontology.

Definition at line 10 of file TransformedOntology.cpp.

12  storage_ = std::make_unique<RedlandModel>();
13  storage_->setStorageType(RedlandStorageType::MEMORY);
14  storage_->setOrigin(origin_);
15 }
const auto & format() const
Definition: DataSource.h:49
const auto & uri() const
Definition: DataSource.h:39
OntologySource(const URI &uri, std::string_view format)
std::unique_ptr< RedlandModel > storage_

◆ TransformedOntology() [2/2]

knowrob::TransformedOntology::TransformedOntology ( const URI uri,
std::string_view  format 
)

Create a new transformed ontology.

Parameters
urithe URI of the original ontology.
formatthe format of the original ontology.

Member Function Documentation

◆ load() [1/2]

bool TransformedOntology::load ( const TripleHandler callback)
overridevirtual

Load the transformed ontology.

Parameters
callbackthe callback to handle the triples.
Returns
true if the ontology was loaded successfully.

Implements knowrob::OntologySource.

Definition at line 17 of file TransformedOntology.cpp.

17  {
18  storage_->batch(callback);
19  return true;
20 }

◆ load() [2/2]

bool knowrob::TransformedOntology::load ( const TripleHandler callback)
overridevirtual

Load the transformed ontology.

Parameters
callbackthe callback to handle the triples.
Returns
true if the ontology was loaded successfully.

Implements knowrob::OntologySource.

◆ storage() [1/2]

auto& knowrob::TransformedOntology::storage ( )
inline
Returns
the storage of the transformed ontology.

Definition at line 35 of file TransformedOntology.h.

35 { return storage_; }

◆ storage() [2/2]

auto& knowrob::TransformedOntology::storage ( )
inline
Returns
the storage of the transformed ontology.

Definition at line 35 of file TransformedOntology.h.

35 { return storage_; }

Member Data Documentation

◆ storage_

std::unique_ptr< RedlandModel > knowrob::TransformedOntology::storage_
protected

Definition at line 38 of file TransformedOntology.h.


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