OntologyIndexClient Class

The OntologyIndexClient class provides a common ROS service abstraction for all exploration service. More...

Header: #include "ontologenius/clientsIndex/ontologyClients/OntologyIndexClient.h"
Inherits: ClientBaseIndex
Inherited By: IndividualIndexClient, ClassIndexClient, DataPropertyIndexClient, ObjectPropertyIndexClient
Namespace: onto

Public Functions

OntologyIndexClient(const std::string& name)
std::vector<int64_t> getUp(int64_t index, int depth = -1, int64_t selector = 0)
bool isA(int64_t index, int64_t base_class)
std::string getName(int64_t index, bool take_id = true)
std::vector<std::string> getNames(int64_t index, bool take_id = true)
std::vector<std::string> getEveryNames(int64_t index, bool take_id = true)
std::vector<int64_t> find(const std::string& name, bool take_id = true, int64_t selector = 0)
std::vector<int64_t> findSub(const std::string& name, bool take_id = true, int64_t selector = 0)
std::vector<int64_t> findRegex(const std::string& regex, bool take_id = true, int64_t selector = 0)
std::vector<std::string> findFuzzy(const std::string& name, double threshold = 0.5, bool take_id = true, int64_t selector = 0)
bool exist(int64_t index)

Reimplemented Public Functions

Detailed Description

The OntologyIndexClient class provides an abstraction common to all ontologenius exploration ROS services.

The OntologyIndexClient implements the functions common to every ontologenius exploration based on indexes.

This class is based on ClientBaseIndex and so ensure a persistent connection with the service based on. The persistent connection ensures a minimal response time. A reconnection logic is implemented in the event that the persistent connection fails.

At the difference of the usual OntologyClient class, this one provides access to the interfaces based on indexes (integers) for better performances.

See also OntologyClient.

See also IndividualIndexClient, ClassIndexClient, DataPropertyIndexClient and ObjectPropertyIndexClient.

Public Function Documentation

OntologyIndexClient::OntologyIndexClient(const std::string& name)

Constructs an ontology client linked to the service ontologenius/name.

std::vector<int64_t> OntologyIndexClient::getUp(int64_t index, int depth = -1, int64_t selector = 0)

Gives all concepts below the one given in the parameter: index.

The optional depth parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.

The optional selector parameter can be set to only get results inheriting from the selector concept. The default value "" represents no restriction on the result.

bool OntologyIndexClient::isA(int64_t index, int64_t base_class)

Returns true if the concept index is or inherits of the concept base_class. This function corresponds to checking if class_base is part of the result of the function getUp applies to the concept index

std::string OntologyIndexClient::getName(int64_t index, bool take_id = true)

Gives one of the label of the concept index that is not muted.

The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.

The result of this function depends on the setting of the working language.

std::vector<std::string> OntologyIndexClient::getNames(int64_t index, bool take_id = true)

Gives all the labels of the concept index excepted the muted ones.

The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.

The result of this function depends on the setting of the working language.

std::vector<std::string> OntologyIndexClient::getEveryNames(int64_t index, bool take_id = true)

Gives all the labels of the concept index even the muted ones.

The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.

The result of this function depends on the setting of the working language.

std::vector<int64_t> OntologyIndexClient::find(const std::string& name, bool take_id = true, int64_t selector = 0)

Gives all the concepts having for label name.

The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.

The optional selector parameter can be set to only get results inheriting from the selector concept. The default value "" represents no restriction on the result.

The result of this function depends on the setting of the working language.

std::vector<int64_t> OntologyIndexClient::findSub(const std::string& name, bool take_id = true, int64_t selector = 0)

Gives all the concepts having for label a subset of name.

The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.

The optional selector parameter can be set to only get results inheriting from the selector concept. The default value "" represents no restriction on the result.

The result of this function depends on the setting of the working language.

std::vector<int64_t> OntologyIndexClient::findRegex(const std::string& regex, bool take_id = true, int64_t selector = 0)

Gives all concepts with a label matching the regular expression regex.

The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.

The optional selector parameter can be set to only get results inheriting from the selector concept. The default value "" represents no restriction on the result.

The result of this function depends on the setting of the working language.

std::vector<std::string> OntologyIndexClient::findFuzzy(const std::string& name, double threshold = 0.5, bool take_id = true, int64_t selector = 0)

Gives all the names of concepts with the lowest edit distance with parameter name.

The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.

The optional selector parameter can be set to only get results inheriting from the selector concept. The default value "" represents no restriction on the result.

The result of this function depends on the setting of the working language and does not correspond to the concept identifiers but to other labels known by ontologenius.

The minimum editing distance can be set with the threshold parameter. This value corresponds to the number of changes to be made to pass from one word to another divided by the length of the comparison word.

bool OntologyIndexClient::exist(int64_t index)

Returns true if the concept name exists in the subpart of the ontology managed by the client (i.e. class, individuals, object properties, data properties).

Muted labels

Ontologenius introduces the concept of muted label. They are written <onto:label> in an OWL file.

A muted label will be useful for adding labels with errors. These labels will allow you to find a concept with an error but will make sure you never use it in output (using getName).