knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::OntologySource Class Referenceabstract

#include <OntologySource.h>

Inheritance diagram for knowrob::OntologySource:
Collaboration diagram for knowrob::OntologySource:

Public Member Functions

 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
 
virtual bool load (const TripleHandler &callback)=0
 
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
 
virtual bool load (const TripleHandler &callback)=0
 
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

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

An ontology source is a data source that contains triples.

Definition at line 17 of file OntologySource.h.

Constructor & Destructor Documentation

◆ OntologySource() [1/2]

knowrob::OntologySource::OntologySource ( const URI uri,
std::string_view  format 
)
inline

Definition at line 19 of file OntologySource.h.

DataSource(URI uri, std::string_view format, DataSourceType dataSourceType)
Definition: DataSource.cpp:30
static std::string getNameFromURI(const std::string &uriString)
Definition: DataSource.cpp:36
const auto & format() const
Definition: DataSource.h:49
const auto & uri() const
Definition: DataSource.h:39

◆ ~OntologySource() [1/2]

virtual knowrob::OntologySource::~OntologySource ( )
virtualdefault

◆ OntologySource() [2/2]

knowrob::OntologySource::OntologySource ( const URI uri,
std::string_view  format 
)
inline

◆ ~OntologySource() [2/2]

virtual knowrob::OntologySource::~OntologySource ( )
virtualdefault

Member Function Documentation

◆ frame() [1/2]

const auto& knowrob::OntologySource::frame ( ) const
inline

Definition at line 27 of file OntologySource.h.

27 { return frame_; }
GraphSelectorPtr frame_

◆ frame() [2/2]

const auto& knowrob::OntologySource::frame ( ) const
inline

Definition at line 27 of file OntologySource.h.

27 { return frame_; }

◆ imports() [1/2]

const auto& knowrob::OntologySource::imports ( ) const
inline
Returns
the imports of the ontology.

Definition at line 55 of file OntologySource.h.

55 { return imports_; }
std::vector< std::string > imports_

◆ imports() [2/2]

const auto& knowrob::OntologySource::imports ( ) const
inline
Returns
the imports of the ontology.

Definition at line 55 of file OntologySource.h.

55 { return imports_; }

◆ load() [1/2]

virtual bool knowrob::OntologySource::load ( const TripleHandler callback)
pure virtual

Load triples from the SPARQL endpoint.

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

Implemented in knowrob::TransformedOntology, knowrob::SPARQLService, knowrob::OntologyFile, knowrob::TransformedOntology, knowrob::SPARQLService, and knowrob::OntologyFile.

◆ load() [2/2]

virtual bool knowrob::OntologySource::load ( const TripleHandler callback)
pure virtual

Load triples from the SPARQL endpoint.

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

Implemented in knowrob::TransformedOntology, knowrob::SPARQLService, knowrob::OntologyFile, knowrob::TransformedOntology, knowrob::SPARQLService, and knowrob::OntologyFile.

◆ origin() [1/2]

std::string_view knowrob::OntologySource::origin ( ) const
inline
Returns
the origin identifier of the ontology.

Definition at line 43 of file OntologySource.h.

43 { return origin_; }

◆ origin() [2/2]

std::string_view knowrob::OntologySource::origin ( ) const
inline
Returns
the origin identifier of the ontology.

Definition at line 43 of file OntologySource.h.

43 { return origin_; }

◆ parentOrigin() [1/2]

auto& knowrob::OntologySource::parentOrigin ( ) const
inline
Returns
the origin of the parent ontology.

Definition at line 38 of file OntologySource.h.

38 { return parentOrigin_; }
std::optional< std::string > parentOrigin_

◆ parentOrigin() [2/2]

auto& knowrob::OntologySource::parentOrigin ( ) const
inline
Returns
the origin of the parent ontology.

Definition at line 38 of file OntologySource.h.

38 { return parentOrigin_; }

◆ setFrame() [1/2]

void knowrob::OntologySource::setFrame ( const GraphSelectorPtr frame)
inline

Definition at line 25 of file OntologySource.h.

25 { frame_ = frame; }
const auto & frame() const

◆ setFrame() [2/2]

void knowrob::OntologySource::setFrame ( const GraphSelectorPtr frame)
inline

Definition at line 25 of file OntologySource.h.

25 { frame_ = frame; }

◆ setImports() [1/2]

void knowrob::OntologySource::setImports ( const std::vector< std::string > &  imports)
inline
Parameters
importsthe imports of the ontology.

Definition at line 60 of file OntologySource.h.

60 { imports_ = imports; }
const auto & imports() const

◆ setImports() [2/2]

void knowrob::OntologySource::setImports ( const std::vector< std::string > &  imports)
inline
Parameters
importsthe imports of the ontology.

Definition at line 60 of file OntologySource.h.

60 { imports_ = imports; }

◆ setParentOrigin() [1/2]

void knowrob::OntologySource::setParentOrigin ( std::string_view  parentOrigin)
inline

The meaning is that parent origin imports this ontology file.

Parameters
parentOriginthe origin of the parent ontology.

Definition at line 33 of file OntologySource.h.

auto & parentOrigin() const

◆ setParentOrigin() [2/2]

void knowrob::OntologySource::setParentOrigin ( std::string_view  parentOrigin)
inline

The meaning is that parent origin imports this ontology file.

Parameters
parentOriginthe origin of the parent ontology.

Definition at line 33 of file OntologySource.h.

Member Data Documentation

◆ frame_

GraphSelectorPtr knowrob::OntologySource::frame_
protected

Definition at line 63 of file OntologySource.h.

◆ imports_

std::vector< std::string > knowrob::OntologySource::imports_
protected

Definition at line 66 of file OntologySource.h.

◆ origin_

std::string knowrob::OntologySource::origin_
protected

Definition at line 65 of file OntologySource.h.

◆ parentOrigin_

std::optional< std::string > knowrob::OntologySource::parentOrigin_
protected

Definition at line 64 of file OntologySource.h.


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