SparqlIndexClient Class

The SparqlIndexClient class provides a ROS service to explore ontologenius with SPARQL-like queries. More...

Header: #include "ontologenius/clientsIndex/SparqlIndexClient.h"
Namespace: onto

Methods

SparqlIndexClient(const std::string& name)
std::pair<std::vector<std::string>, std::vector<OntologeniusSparqlIndexResponse>> call(const std::string& query)

Detailed Description

The SparqlIndexClient class provides a ROS service to explore ontologenius with SPARQL-like queries.

The variables start with the symbol ? (e.g. ?my_var) and each triplet is separated by a dot.

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

See also SparqlClient.

Methods Documentation

SparqlIndexClient(const std::string& name)

Constructs a sparql client.

Can be used in a multi-ontology mode by specifying the name of the ontology name. For classic use, name should be defined as "".

std::pair<std::vector<std::string>, std::vector<OntologeniusSparqlIndexResponse>> call(const std::string& query)

Basic query Examples

The general structure is always the same:

SELECT * // or ?x to get specific variables

WHERE {

// pattern

}

You can also add the DISTINCT keyword just after the SELECT to ensure unique results. The following blocks are examples of possible patterns.