- ClassIndexClient (ros::NodeHandle* n , const std::string& name )
+ ClassIndexClient (const std::string& name )
std::vector<int64_t> getDown (int64_t index , int depth = -1, int64_t selector = 0)
std::vector<int64_t> getDisjoint (int64_t index )
std::vector<int64_t> getOn (int64_t index , int64_t property , int64_t selector = 0)
@@ -179,8 +179,8 @@ Detailed Description
Public Function Documentation
-
ClassIndexClient::ClassIndexClient (ros::NodeHandle * n , const string & name )
-
Constructs a class client with a pointer to a NodeHandle n .
+
ClassIndexClient::ClassIndexClient (const string & name )
+
Constructs a class 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::vector<int64_t> ClassIndexClient::getDown (int64_t index , int depth = -1, int64_t selector = 0)
diff --git a/docs/cpp_API/ClientBase.html b/docs/cpp_API/ClientBase.html
index 257a0788..87ba94f6 100644
--- a/docs/cpp_API/ClientBase.html
+++ b/docs/cpp_API/ClientBase.html
@@ -1,7 +1,7 @@
-
ClientBase Class (cpp) | Ontologenius 0.3.1
+
ClientBase Class (cpp) | Ontologenius 0.3.2
@@ -47,8 +47,6 @@
Ontologenius Cpp API Documentation
Contents
@@ -135,22 +133,14 @@ Public Functions
-
-
- Protected Functions
-
-
-
- std::vector<std::string> call (ontologenius::OntologeniusService& srv )
- std::string callStr (ontologenius::OntologeniusService& srv )
- bool callNR (ontologenius::OntologeniusService& srv )
- bool callBool (ontologenius::OntologeniusService& srv )
+ int getErrorCode ()
+ std::vector<std::string> call (const std::string& action , const std::string& param )
+ std::string callStr (const std::string& action , const std::string& param )
+ bool callNR (const std::string& action , const std::string& param )
+ bool callBool (const std::string& action , const std::string& param )
@@ -165,8 +155,8 @@ Detailed Description
Public Function Documentation
-
ClientBase::ClientBase (ros::NodeHandle * n , const std::string & name )
-
Constructs a ROS client linked to the service name with a pointer to a NodeHandle n .
+
ClientBase::ClientBase (const std::string & name )
+
Constructs a ROS client linked to the service name .
size_t ClientBase::nb ()
Gives the total number of service calls from all ClientBase instances since the last reset.
@@ -174,22 +164,23 @@
size_t ClientB
ClientBase::resetNb ()
Reset Call Counter for all instances of ClientBase.
-
Protected Function Documentation
+
int ClientBase::getErrorCode ()
+
Gives the error code of the last service call. Code 0 corresponds to no error. Code -1 corresponds to service call error. Code 1 corresponds to an internal error. Code 2 corresponds to unknown query. Code 3 corresponds to unclosed ontology.
-
inline std::vector<std::string> ClientBase::call (ontologenius::OntologeniusService & srv )
-
Calls the service set up in the constructor of ClientBase with the request srv
-
If the service call fails, the first element of the returned vector is "ERR:SERVICE_FAIL".
+
inline std::vector<std::string> ClientBase::call (const std::string & action , const std::string & param )
+
Calls the service set up in the constructor of ClientBase with the request composed of an action action and parameters param
+
If the service call fails, the first element of the returned vector is "ERR:SERVICE_FAIL". Error detail can be queried using getError method.
-
inline std::string ClientBase::callStr (ontologenius::OntologeniusService & srv )
-
Calls the service set up in the constructor of ClientBase with the request srv
-
If the service call fails, the returned value is "ERR:SERVICE_FAIL".
+
inline std::string ClientBase::callStr (const std::string & action , const std::string & param )
+
Calls the service set up in the constructor of ClientBase with the request composed of an action action and parameters param
+
If the service call fails, the returned value is "ERR:SERVICE_FAIL". Error detail can be queried using getError method.
-
inline bool ClientBase::callNR (ontologenius::OntologeniusService & srv )
-
Calls the service set up in the constructor of ClientBase with the request srv
+
inline bool ClientBase::callNR (const std::string & action , const std::string & param )
+
Calls the service set up in the constructor of ClientBase with the request composed of an action action and parameters param
Returns false if the service call fails.
-
inline bool ClientBase::callBool (ontologenius::OntologeniusService & srv )
-
Calls the service set up in the constructor of ClientBase with the request srv
+
inline bool ClientBase::callBool (const std::string & action , const std::string & param )
+
Calls the service set up in the constructor of ClientBase with the request composed of an action action and parameters param
Returns false if the service call fails or the result code of the service is different from SUCCESS.
diff --git a/docs/cpp_API/ClientBaseIndex.html b/docs/cpp_API/ClientBaseIndex.html
index e72ab4d8..35644153 100644
--- a/docs/cpp_API/ClientBaseIndex.html
+++ b/docs/cpp_API/ClientBaseIndex.html
@@ -1,7 +1,7 @@
- ClientBaseIndex Class (cpp) | Ontologenius 0.3.1
+ ClientBaseIndex Class (cpp) | Ontologenius 0.3.2
@@ -47,8 +47,6 @@ Ontologenius Cpp API Documentation
Contents
@@ -135,24 +133,16 @@ Public Functions
-
-
- Protected Functions
-
-
-
- std::vector<std::string> call (ontologenius::OntologeniusIndexService& srv )
- std::vector<int64_t> callIndexes (ontologenius::OntologeniusIndexService& srv )
- std::string callStr (ontologenius::OntologeniusIndexService& srv )
- int64_t callIndex (ontologenius::OntologeniusIndexService& srv )
- bool callNR (ontologenius::OntologeniusIndexService& srv )
- bool callBool (ontologenius::OntologeniusIndexService& srv )
+ int getErrorCode ()
+ std::vector<std::string> call (const std::string& action , const std::string& param )
+ std::vector<int64_t> callIndexes (const std::string& action , const std::string& param )
+ std::string callStr (const std::string& action , const std::string& param )
+ int64_t callIndex (const std::string& action , const std::string& param )
+ bool callNR (const std::string& action , const std::string& param )
+ bool callBool (const std::string& action , const std::string& param )
@@ -169,8 +159,8 @@ Detailed Description
Public Function Documentation
-
ClientBaseIndex::ClientBaseIndex (ros::NodeHandle * n , const std::string & name )
-
Constructs a ROS client linked to the service name with a pointer to a NodeHandle n .
+
ClientBaseIndex::ClientBaseIndex (const std::string & name )
+
Constructs a ROS client linked to the service name .
size_t ClientBaseIndex::nb ()
Gives the total number of service calls from all ClientBaseIndex instances since the last reset.
@@ -178,30 +168,31 @@
size_t ClientB
ClientBaseIndex::resetNb ()
Reset Call Counter for all instances of ClientBaseIndex.
-
Protected Function Documentation
+
int ClientBaseIndex::getErrorCode ()
+
Gives the error code of the last service call. Code 0 corresponds to no error. Code -1 corresponds to service call error. Code 1 corresponds to an internal error. Code 2 corresponds to unknown query. Code 3 corresponds to unclosed ontology.
-
inline std::vector<std::string> ClientBaseIndex::call (ontologenius::OntologeniusIndexService & srv )
-
Calls the service set up in the constructor of ClientBaseIndex with the request srv
-
If the service call fails, the first element of the returned vector is "ERR:SERVICE_FAIL".
+
inline std::vector<std::string> ClientBaseIndex::call (const std::string & action , const std::string & param )
+
Calls the service set up in the constructor of ClientBaseIndex with the request composed of an action action and parameters param
+
If the service call fails, the first element of the returned vector is "ERR:SERVICE_FAIL". Error detail can be queried using getError method.
-
inline std::vector<int64_t> ClientBaseIndex::callIndexes (ontologenius::OntologeniusIndexService & srv )
-
Calls the service set up in the constructor of ClientBaseIndex with the request srv
+
inline std::vector<int64_t> ClientBaseIndex::callIndexes (const std::string & action , const std::string & param )
+
Calls the service set up in the constructor of ClientBaseIndex with the request composed of an action action and parameters param
If the service call fails, the first element of the returned vector is 0.
-
inline std::string ClientBaseIndex::callStr (ontologenius::OntologeniusIndexService & srv )
-
Calls the service set up in the constructor of ClientBaseIndex with the request srv
-
If the service call fails, the returned value is "ERR:SERVICE_FAIL".
+
inline std::string ClientBaseIndex::callStr (const std::string & action , const std::string & param )
+
Calls the service set up in the constructor of ClientBaseIndex with the request composed of an action action and parameters param
+
If the service call fails, the returned value is "ERR:SERVICE_FAIL". Error detail can be queried using getError method.
-
inline int64_t ClientBaseIndex::callIndex (ontologenius::OntologeniusIndexService & srv )
-
Calls the service set up in the constructor of ClientBaseIndex with the request srv
+
inline int64_t ClientBaseIndex::callIndex (const std::string & action , const std::string & param )
+
Calls the service set up in the constructor of ClientBaseIndex with the request composed of an action action and parameters param
If the service call fails or has no response, the returned value is 0.
-
inline bool ClientBaseIndex::callNR (ontologenius::OntologeniusIndexService & srv )
-
Calls the service set up in the constructor of ClientBaseIndex with the request srv
+
inline bool ClientBaseIndex::callNR (const std::string & action , const std::string & param )
+
Calls the service set up in the constructor of ClientBaseIndex with the request composed of an action action and parameters param
Returns false if the service call fails.
-
inline bool ClientBaseIndex::callBool (ontologenius::OntologeniusIndexService & srv )
-
Calls the service set up in the constructor of ClientBaseIndex with the request srv
+
inline bool ClientBaseIndex::callBool (const std::string & action , const std::string & param )
+
Calls the service set up in the constructor of ClientBaseIndex with the request composed of an action action and parameters param
Returns false if the service call fails or the result code of the service is different from SUCCESS.
diff --git a/docs/cpp_API/ConversionClient.html b/docs/cpp_API/ConversionClient.html
index 5d668da3..f00906ad 100644
--- a/docs/cpp_API/ConversionClient.html
+++ b/docs/cpp_API/ConversionClient.html
@@ -1,7 +1,7 @@
- ConversionClient Class (cpp) | Ontologenius 0.3.1
+ ConversionClient Class (cpp) | Ontologenius 0.3.2
@@ -134,7 +134,7 @@ Public Functions
- ConversionClient (ros::NodeHandle* n , const std::string& name )
+ ConversionClient (const std::string& name )
verbose (bool verbose)
std::vector<std::string> individualsIndex2Id (const std::vector<int64_t>& indexes)
std::vector<std::string> classesIndex2Id (const std::vector<int64_t>& indexes)
@@ -171,8 +171,8 @@ Detailed Description
Public Function Documentation
-
ConversionClient::ConversionClient (ros::NodeHandle * n , const std::string & name )
-
Constructs an conversion client with a pointer to a NodeHandle n .
+
ConversionClient::ConversionClient (const std::string & name )
+
Constructs an conversion 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 "".
void ConversionClient::verbose (bool verbose )
diff --git a/docs/cpp_API/CppAPI.html b/docs/cpp_API/CppAPI.html
index 9d198097..af009330 100644
--- a/docs/cpp_API/CppAPI.html
+++ b/docs/cpp_API/CppAPI.html
@@ -1,7 +1,7 @@
-
C++ API (cpp) | Ontologenius 0.3.1
+
C++ API (cpp) | Ontologenius 0.3.2
diff --git a/docs/cpp_API/DataPropertyClient.html b/docs/cpp_API/DataPropertyClient.html
index e795bb2b..2a84b4c3 100644
--- a/docs/cpp_API/DataPropertyClient.html
+++ b/docs/cpp_API/DataPropertyClient.html
@@ -1,7 +1,7 @@
-
DataPropertyClient Class (cpp) | Ontologenius 0.3.1
+
DataPropertyClient Class (cpp) | Ontologenius 0.3.2
@@ -134,7 +134,7 @@
Public Functions
- DataPropertyClient (ros::NodeHandle* n , const std::string& name )
+ DataPropertyClient (const std::string& name )
std::vector<std::string> getDown (const std::string& name , int depth = -1)
std::vector<std::string> getDisjoint (const std::string& name )
std::vector<std::string> getDomain (const std::string& name )
@@ -163,8 +163,8 @@ Detailed Description
Public Function Documentation
-
DataPropertyClient::DataPropertyClient (ros::NodeHandle * n , const std::string & name )
-
Constructs a data property client with a pointer to a NodeHandle n .
+
DataPropertyClient::DataPropertyClient (const std::string & name )
+
Constructs a data property 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::vector<std::string> DataPropertyClient::getDown (const std::string & name , int depth = -1)
diff --git a/docs/cpp_API/DataPropertyIndexClient.html b/docs/cpp_API/DataPropertyIndexClient.html
index 5168fdcb..cb24d4d1 100644
--- a/docs/cpp_API/DataPropertyIndexClient.html
+++ b/docs/cpp_API/DataPropertyIndexClient.html
@@ -1,7 +1,7 @@
-
DataPropertyIndexClient Class (cpp) | Ontologenius 0.3.1
+
DataPropertyIndexClient Class (cpp) | Ontologenius 0.3.2
@@ -134,7 +134,7 @@
Public Functions
- DataPropertyIndexClient (ros::NodeHandle* n , const std::string& name )
+ DataPropertyIndexClient (const std::string& name )
std::vector<int64_t> getDown (int64_t index , int depth = -1)
std::vector<int64_t> getDisjoint (int64_t index )
std::vector<int64_t> getDomain (int64_t index )
@@ -168,8 +168,8 @@ Detailed Description
Public Function Documentation
-
DataPropertyIndexClient::DataPropertyIndexClient (ros::NodeHandle * n , const std::string & name )
-
Constructs a data property client with a pointer to a NodeHandle n .
+
DataPropertyIndexClient::DataPropertyIndexClient (const std::string & name )
+
Constructs a data property 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::vector<int64_t> DataPropertyIndexClient::getDown (int64_t index , int depth = -1)
diff --git a/docs/cpp_API/FeederPublisher.html b/docs/cpp_API/FeederPublisher.html
index 6a1f1de2..c4a0896a 100644
--- a/docs/cpp_API/FeederPublisher.html
+++ b/docs/cpp_API/FeederPublisher.html
@@ -1,7 +1,7 @@
-
FeederPublisher Class (cpp) | Ontologenius 0.3.1
+
FeederPublisher Class (cpp) | Ontologenius 0.3.2
@@ -134,7 +134,7 @@
Public Functions
- FeederPublisher (ros::NodeHandle* n , const std::string& name )
+ FeederPublisher (const std::string& name )
addProperty (const std::string& from , const std::string& property , const std::string& on , const ros::Time& stamp = ros::Time::now())
addProperty (const std::string& from , const std::string& property , const std::string& type , const std::string& value , const ros::Time& stamp = ros::Time::now())
addInheritage (const std::string& from , const std::string& on , const ros::Time& stamp = ros::Time::now())
@@ -172,8 +172,8 @@ Detailed Description
Public Function Documentation
-
FeederPublisher::FeederPublisher (ros::NodeHandle * n , const std::string & name )
-
Constructs a FeederPublisher with a pointer to a NodeHandle n .
+
FeederPublisher::FeederPublisher (const std::string & name )
+
Constructs a FeederPublisher.
Can be used in a multi-ontology mode by specifying the name of the ontology name . For classic use, name should be defined as "".
FeederPublisher::addProperty (const std::string & from , const std::string & property , const std::string & on , const ros::Time & stamp = ros::Time::now())
diff --git a/docs/cpp_API/IndividualClient.html b/docs/cpp_API/IndividualClient.html
index e8b60f0d..9843cfe5 100644
--- a/docs/cpp_API/IndividualClient.html
+++ b/docs/cpp_API/IndividualClient.html
@@ -1,7 +1,7 @@
-
IndividualClient Class (cpp) | Ontologenius 0.3.1
+
IndividualClient Class (cpp) | Ontologenius 0.3.2
@@ -135,7 +135,7 @@
Public Functions
- IndividualClient (ros::NodeHandle* n , const std::string& name )
+ IndividualClient (const std::string& name )
std::vector<std::string> getType (const std::string& name )
std::vector<std::string> getSame (const std::string& name )
std::vector<std::string> getDistincts (const std::string& name )
@@ -174,8 +174,8 @@ Detailed Description
Public Function Documentation
-
IndividualClient::IndividualClient (ros::NodeHandle * n , const std::string & name )
-
Constructs an individual client with a pointer to a NodeHandle n .
+
IndividualClient::IndividualClient (const std::string & name )
+
Constructs an individual 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::vector<std::string> IndividualClient::getType (const std::string & name )
diff --git a/docs/cpp_API/IndividualIndexClient.html b/docs/cpp_API/IndividualIndexClient.html
index 2bda52bb..559d4fce 100644
--- a/docs/cpp_API/IndividualIndexClient.html
+++ b/docs/cpp_API/IndividualIndexClient.html
@@ -1,7 +1,7 @@
-
IndividualIndexClient Class (cpp) | Ontologenius 0.3.1
+
IndividualIndexClient Class (cpp) | Ontologenius 0.3.2
@@ -135,7 +135,7 @@
Public Functions
- IndividualIndexClient (ros::NodeHandle* n , const std::string& name )
+ IndividualIndexClient (const std::string& name )
std::vector<int64_t> getType (int64_t index )
std::vector<int64_t> getSame (int64_t index )
std::vector<int64_t> getDistincts (int64_t index )
@@ -178,8 +178,8 @@ Detailed Description
Public Function Documentation
-
IndividualIndexClient::IndividualIndexClient (ros::NodeHandle * n , const std::string & name )
-
Constructs an individual client with a pointer to a NodeHandle n .
+
IndividualIndexClient::IndividualIndexClient (const std::string & name )
+
Constructs an individual client with.
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::vector<int64_t> IndividualIndexClient::getType (int64_t index )
diff --git a/docs/cpp_API/ManagerClient.html b/docs/cpp_API/ManagerClient.html
index ac38bd3c..6e5f3ee7 100644
--- a/docs/cpp_API/ManagerClient.html
+++ b/docs/cpp_API/ManagerClient.html
@@ -1,7 +1,7 @@
-
ManagerClient Class (cpp) | Ontologenius 0.3.1
+
ManagerClient Class (cpp) | Ontologenius 0.3.2
@@ -138,7 +138,7 @@
Public Functions
- ManagerClient (ros::NodeHandle* n )
+ ManagerClient ()
std::vector<std::string> list ()
bool add (const std::string& name )
bool copy (const std::string& dest_name , const std::string& src_name )
@@ -165,8 +165,8 @@ Detailed Description
Public Function Documentation
-
ManagerClient::ManagerClient (ros::NodeHandle * n )
-
Constructs a manager client with a pointer to a NodeHandle n .
+
ManagerClient::ManagerClient ()
+
Constructs a manager client.
Can only be used in a multi-ontology mode.
std::vector<std::string> ManagerClient::list ()
diff --git a/docs/cpp_API/ObjectPropertyClient.html b/docs/cpp_API/ObjectPropertyClient.html
index e2bb84bd..c1116a02 100644
--- a/docs/cpp_API/ObjectPropertyClient.html
+++ b/docs/cpp_API/ObjectPropertyClient.html
@@ -1,7 +1,7 @@
-
ObjectPropertyClient Class (cpp) | Ontologenius 0.3.1
+
ObjectPropertyClient Class (cpp) | Ontologenius 0.3.2
@@ -136,7 +136,7 @@
Public Functions
- ObjectPropertyClient (ros::NodeHandle* n , const std::string& name )
+ ObjectPropertyClient (const std::string& name )
std::vector<std::string> getDown (const std::string& name , int depth = -1)
std::vector<std::string> getDisjoint (const std::string& name )
std::vector<std::string> getDomain (const std::string& name )
@@ -166,8 +166,8 @@ Detailed Description
Public Function Documentation
-
ObjectPropertyClient::ObjectPropertyClient (ros::NodeHandle * n , const std::string & name )
-
Constructs am object property client with a pointer to a NodeHandle n .
+
ObjectPropertyClient::ObjectPropertyClient (const std::string & name )
+
Constructs am object property 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::vector<std::string> ObjectPropertyClient::getDown (const std::string & name , int depth = -1)
diff --git a/docs/cpp_API/ObjectPropertyIndexClient.html b/docs/cpp_API/ObjectPropertyIndexClient.html
index a5da51f4..c638486e 100644
--- a/docs/cpp_API/ObjectPropertyIndexClient.html
+++ b/docs/cpp_API/ObjectPropertyIndexClient.html
@@ -1,7 +1,7 @@
-
ObjectPropertyIndexClient Class (cpp) | Ontologenius 0.3.1
+
ObjectPropertyIndexClient Class (cpp) | Ontologenius 0.3.2
@@ -136,7 +136,7 @@
Public Functions
- ObjectPropertyIndexClient (ros::NodeHandle* n , const std::string& name )
+ ObjectPropertyIndexClient (const std::string& name )
std::vector<int64_t> getDown (int64_t index , int depth = -1)
std::vector<int64_t> getDisjoint (int64_t; index )
std::vector<int64_t> getDomain (int64_t index )
@@ -170,8 +170,8 @@ Detailed Description
Public Function Documentation
-
ObjectPropertyIndexClient::ObjectPropertyIndexClient (ros::NodeHandle * n , const std::string & name )
-
Constructs am object property client with a pointer to a NodeHandle n .
+
ObjectPropertyIndexClient::ObjectPropertyIndexClient (const std::string & name )
+
Constructs am object property 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::vector<int64_t> ObjectPropertyIndexClient::getDown (int64_t index , int depth = -1)
diff --git a/docs/cpp_API/OntologiesManipulator.html b/docs/cpp_API/OntologiesManipulator.html
index 47c98ed2..0d82c77f 100644
--- a/docs/cpp_API/OntologiesManipulator.html
+++ b/docs/cpp_API/OntologiesManipulator.html
@@ -1,7 +1,7 @@
-
OntologiesManipulator Class (cpp) | Ontologenius 0.3.1
+
OntologiesManipulator Class (cpp) | Ontologenius 0.3.2
@@ -136,7 +136,7 @@
Public Functions
- OntologiesManipulator (ros::NodeHandle* n )
+ OntologiesManipulator ()
waitInit (int32_t timeout = -1)
OntologyManipulator* operator[] (const std::string& name )
OntologyManipulator* get (const std::string& name )
@@ -171,9 +171,8 @@ Detailed Description
Public Function Documentation
-
OntologiesManipulator::OntologiesManipulator (ros::NodeHandle * n )
-
Constructs a manipulator for several instance of ontologies with a pointer to a NodeHandle n .
- This pointer is necessary to create the ros services in the constructor.
+
OntologiesManipulator::OntologiesManipulator ()
+
Constructs a manipulator for several instance of ontologies.
OntologiesManipulator::waitInit (int32_t timeout = -1)
Wait for ontologenius services to be advertised and available for. Blocks until it is.
diff --git a/docs/cpp_API/OntologyClient.html b/docs/cpp_API/OntologyClient.html
index f9e39f39..d2a4150d 100644
--- a/docs/cpp_API/OntologyClient.html
+++ b/docs/cpp_API/OntologyClient.html
@@ -1,7 +1,7 @@
-
OntologyClient Class (cpp) | Ontologenius 0.3.1
+
OntologyClient Class (cpp) | Ontologenius 0.3.2
@@ -137,7 +137,7 @@
Public Functions
- OntologyClient (ros::NodeHandle* n , const std::string& name )
+ OntologyClient (const std::string& name )
std::vector<std::string> getUp (const std::string& name , int depth = -1, const std::string& selector = "")
bool isA (const std::string& name , const std::string& base_class )
std::string getName (const std::string& name , bool take_id = true)
@@ -171,8 +171,8 @@ Detailed Description
Public Function Documentation
-
OntologyClient::OntologyClient (ros::NodeHandle * n , const std::string & name )
-
Constructs an ontology client linked to the service ontologenius/name with a pointer to a NodeHandle n .
+
OntologyClient::OntologyClient (const std::string & name )
+
Constructs an ontology client linked to the service ontologenius/name .
std::vector<std::string> OntologyClient::getUp (const std::string & name , int depth = -1, const std::string & selector = "")
Gives all concepts below the one given in the parameter: name .
diff --git a/docs/cpp_API/OntologyIndexClient.html b/docs/cpp_API/OntologyIndexClient.html
index 78ee0668..0c1caf0d 100644
--- a/docs/cpp_API/OntologyIndexClient.html
+++ b/docs/cpp_API/OntologyIndexClient.html
@@ -1,7 +1,7 @@
-
OntologyIndexClient Class (cpp) | Ontologenius 0.3.1
+
OntologyIndexClient Class (cpp) | Ontologenius 0.3.2
@@ -137,7 +137,7 @@
Public Functions
- OntologyIndexClient (ros::NodeHandle* n , const std::string& name )
+ 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)
@@ -175,8 +175,8 @@ Detailed Description
Public Function Documentation
-
OntologyIndexClient::OntologyIndexClient (ros::NodeHandle * n , const std::string & name )
-
Constructs an ontology client linked to the service ontologenius/name with a pointer to a NodeHandle n .
+
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 .
diff --git a/docs/cpp_API/OntologyManipulator.html b/docs/cpp_API/OntologyManipulator.html
index 237f8f03..dc0ff0a3 100644
--- a/docs/cpp_API/OntologyManipulator.html
+++ b/docs/cpp_API/OntologyManipulator.html
@@ -1,7 +1,7 @@
-
OntologyManipulator Class (cpp) | Ontologenius 0.3.1
+
OntologyManipulator Class (cpp) | Ontologenius 0.3.2
diff --git a/docs/cpp_API/OntologyManipulatorIndex.html b/docs/cpp_API/OntologyManipulatorIndex.html
index 7b4894d9..56991d90 100644
--- a/docs/cpp_API/OntologyManipulatorIndex.html
+++ b/docs/cpp_API/OntologyManipulatorIndex.html
@@ -1,7 +1,7 @@
-
OntologyManipulatorIndex Class (cpp) | Ontologenius 0.3.1
+
OntologyManipulatorIndex Class (cpp) | Ontologenius 0.3.2
diff --git a/docs/cpp_API/ReasonerClient.html b/docs/cpp_API/ReasonerClient.html
index b93d798f..64cfea67 100644
--- a/docs/cpp_API/ReasonerClient.html
+++ b/docs/cpp_API/ReasonerClient.html
@@ -1,7 +1,7 @@
-
ReasonerClient Class (cpp) | Ontologenius 0.3.1
+
ReasonerClient Class (cpp) | Ontologenius 0.3.2
@@ -136,7 +136,7 @@
Public Functions
- ReasonerClient (ros::NodeHandle* n , const std::string& name )
+ ReasonerClient (const std::string& name )
std::vector<std::string> list ()
std::vector<std::string> activeList ()
bool activate (const std::string& name )
@@ -163,8 +163,8 @@ Detailed Description
Public Function Documentation
-
ReasonerClient::ReasonerClient (ros::NodeHandle * n , const std::string & name )
-
Constructs a reasoner client with a pointer to a NodeHandle n .
+
ReasonerClient::ReasonerClient (const std::string & name )
+
Constructs a reasoner 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::vector<std::string> ReasonerClient::list ()
diff --git a/docs/cpp_API/SparqlClient.html b/docs/cpp_API/SparqlClient.html
index 6ace0dab..b6d9fdca 100644
--- a/docs/cpp_API/SparqlClient.html
+++ b/docs/cpp_API/SparqlClient.html
@@ -1,7 +1,7 @@
-
SparqlClient Class (cpp) | Ontologenius 0.3.1
+
SparqlClient Class (cpp) | Ontologenius 0.3.2
@@ -134,7 +134,7 @@
Methods
- SparqlClient (ros::NodeHandle* n , const std::string& name )
+ SparqlClient (const std::string& name )
std::pair<std::vector<std::string>, std::vector<OntologeniusSparqlResponse>> call (const std::string& query )
@@ -150,7 +150,7 @@
Detailed Description
Methods Documentation
-
SparqlClient (ros::NodeHandle * n , const std::string & name )
+
SparqlClient (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 "".
diff --git a/docs/cpp_API/SparqlIndexClient.html b/docs/cpp_API/SparqlIndexClient.html
index a2dae137..f04255b0 100644
--- a/docs/cpp_API/SparqlIndexClient.html
+++ b/docs/cpp_API/SparqlIndexClient.html
@@ -1,7 +1,7 @@
-
SparqlIndexClient Class (cpp) | Ontologenius 0.3.1
+
SparqlIndexClient Class (cpp) | Ontologenius 0.3.2
@@ -134,7 +134,7 @@
Methods
- SparqlIndexClient (ros::NodeHandle* n , const std::string& name )
+ SparqlIndexClient (const std::string& name )
std::pair<std::vector<std::string>, std::vector<OntologeniusSparqlIndexResponse>> call (const std::string& query )
@@ -153,7 +153,7 @@
Detailed Description
Methods Documentation
-
SparqlIndexClient (ros::NodeHandle * n , const std::string & name )
+
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 "".
diff --git a/docs/cpp_Tutorials/Tutorials.html b/docs/cpp_Tutorials/Tutorials.html
index e5c28724..da9edb25 100644
--- a/docs/cpp_Tutorials/Tutorials.html
+++ b/docs/cpp_Tutorials/Tutorials.html
@@ -1,7 +1,7 @@
-
Cpp Tutorials | Ontologenius 0.3.1
+
Cpp Tutorials | Ontologenius 0.3.2
diff --git a/docs/index.html b/docs/index.html
index 31c9f2b3..6665bdee 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1,7 +1,7 @@
-
Ontologenius 0.3.1
+
Ontologenius 0.3.2
@@ -101,7 +101,7 @@
A long-term semantic memory for robotic agents
diff --git a/docs/overview/launchers.html b/docs/overview/launchers.html
index 23fbfecc..8508c96b 100644
--- a/docs/overview/launchers.html
+++ b/docs/overview/launchers.html
@@ -1,7 +1,7 @@
-
Launchers | Ontologenius 0.3.1
+
Launchers | Ontologenius 0.3.2
@@ -84,8 +84,8 @@
Ontologenius launchers
-
Ontologenius consists of three executables: the kernel, the REST module and a graphical interface (ontoloGUI).
- While the first two are mandatory, the only purpose of the latter is to quickly see the effect of queries.
+
Ontologenius consists of two executables: the kernel and a graphical interface (ontoloGUI).
+ While the first is mandatory, the only purpose of the latter is to quickly see the effect of queries.
Ontologenius core
An Ontologenius core needs at least three parameters to be able to run:
@@ -190,16 +190,6 @@
Ontologenius core
Arguments are passed to the executable as options (-l, -i, -c). If you do not set an option, the setting will take a default value.
-
Ontologenius REST
-
-
The REST executable is actually just a python node that provides Ontologenius with a way to access the Internet to download
- ontologies, for example.
-
This node does not need to be started if you do not want to load ontologies from the Internet.
-
-
-
<node name ="ontologenius_rest" pkg ="ontologenius" type ="REST.py" output ="screen" > </node >
-
-
OntoloGUI
OntoloGUI is the Ontologenius GUI. Its only purpose is to help you develop applications using Ontologenius. It is not
diff --git a/docs/overview/ontoloGUI.html b/docs/overview/ontoloGUI.html
index fa166f14..cef5f129 100644
--- a/docs/overview/ontoloGUI.html
+++ b/docs/overview/ontoloGUI.html
@@ -1,7 +1,7 @@
-
OntoloGUI | Ontologenius 0.3.1
+
OntoloGUI | Ontologenius 0.3.2
diff --git a/docs/overview/reasonersConfiguration.html b/docs/overview/reasonersConfiguration.html
index d024b730..0368f59d 100644
--- a/docs/overview/reasonersConfiguration.html
+++ b/docs/overview/reasonersConfiguration.html
@@ -1,7 +1,7 @@
-
Reasoners configuration | Ontologenius 0.3.1
+
Reasoners configuration | Ontologenius 0.3.2
diff --git a/docs/python_API/ActionClient.html b/docs/python_API/ActionClient.html
index 39150d17..2d55e363 100644
--- a/docs/python_API/ActionClient.html
+++ b/docs/python_API/ActionClient.html
@@ -1,7 +1,7 @@
-
ActionClient Class (python) | Ontologenius 0.3.1
+
ActionClient Class (python) | Ontologenius 0.3.2
@@ -169,7 +169,7 @@
__init__<
close (self)
Link all the concepts loaded from files and the Internet. Before closing an ontology, exploration requests are not allowed.
- Returns False if the service call fails.
+ Returns false ontology closure fails or if the service call fails. Use getErrorCode method to get the origin.
save (self, path)
Saves the current ontology in the absolute path (str) path. The path (str) parameter must be of the form: my/path/to/ontology.owl
diff --git a/docs/python_API/ClassClient.html b/docs/python_API/ClassClient.html
index ba97321e..faad5bde 100644
--- a/docs/python_API/ClassClient.html
+++ b/docs/python_API/ClassClient.html
@@ -1,7 +1,7 @@
- ClassClient Class (python) | Ontologenius 0.3.1
+ ClassClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/ClassIndexClient.html b/docs/python_API/ClassIndexClient.html
index 7a7cd385..c8249272 100644
--- a/docs/python_API/ClassIndexClient.html
+++ b/docs/python_API/ClassIndexClient.html
@@ -1,7 +1,7 @@
- ClassIndexClient Class (python) | Ontologenius 0.3.1
+ ClassIndexClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/ClientBase.html b/docs/python_API/ClientBase.html
index 10213621..0374aaba 100644
--- a/docs/python_API/ClientBase.html
+++ b/docs/python_API/ClientBase.html
@@ -1,7 +1,7 @@
- ClientBase Class (python) | Ontologenius 0.3.1
+ ClientBase Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/ClientBaseIndex.html b/docs/python_API/ClientBaseIndex.html
index dc111209..bd974810 100644
--- a/docs/python_API/ClientBaseIndex.html
+++ b/docs/python_API/ClientBaseIndex.html
@@ -1,7 +1,7 @@
- ClientBaseIndex Class (python) | Ontologenius 0.3.1
+ ClientBaseIndex Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/ConversionClient.html b/docs/python_API/ConversionClient.html
index 19d04ddb..77fafb75 100644
--- a/docs/python_API/ConversionClient.html
+++ b/docs/python_API/ConversionClient.html
@@ -1,7 +1,7 @@
- ConversionClient Class (python) | Ontologenius 0.3.1
+ ConversionClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/DataPropertyClient.html b/docs/python_API/DataPropertyClient.html
index badb291d..0fb265aa 100644
--- a/docs/python_API/DataPropertyClient.html
+++ b/docs/python_API/DataPropertyClient.html
@@ -1,7 +1,7 @@
- DataPropertyClient Class (python) | Ontologenius 0.3.1
+ DataPropertyClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/DataPropertyIndexClient.html b/docs/python_API/DataPropertyIndexClient.html
index 3dffe37f..16c60e58 100644
--- a/docs/python_API/DataPropertyIndexClient.html
+++ b/docs/python_API/DataPropertyIndexClient.html
@@ -1,7 +1,7 @@
- DataPropertyIndexClient Class (python) | Ontologenius 0.3.1
+ DataPropertyIndexClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/FeederPublisher.html b/docs/python_API/FeederPublisher.html
index 1f0a91b6..1b63dabd 100644
--- a/docs/python_API/FeederPublisher.html
+++ b/docs/python_API/FeederPublisher.html
@@ -1,7 +1,7 @@
- FeederPublisher Class (python) | Ontologenius 0.3.1
+ FeederPublisher Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/IndividualClient.html b/docs/python_API/IndividualClient.html
index f9bfd7c1..4d583fa2 100644
--- a/docs/python_API/IndividualClient.html
+++ b/docs/python_API/IndividualClient.html
@@ -1,7 +1,7 @@
- IndividualClient Class (python) | Ontologenius 0.3.1
+ IndividualClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/IndividualIndexClient.html b/docs/python_API/IndividualIndexClient.html
index de43fd7e..9ebf9f68 100644
--- a/docs/python_API/IndividualIndexClient.html
+++ b/docs/python_API/IndividualIndexClient.html
@@ -1,7 +1,7 @@
- IndividualIndexClient Class (python) | Ontologenius 0.3.1
+ IndividualIndexClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/ManagerClient.html b/docs/python_API/ManagerClient.html
index 592b9f56..99baffeb 100644
--- a/docs/python_API/ManagerClient.html
+++ b/docs/python_API/ManagerClient.html
@@ -1,7 +1,7 @@
- ManagerClient Class (python) | Ontologenius 0.3.1
+ ManagerClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/ObjectPropertyClient.html b/docs/python_API/ObjectPropertyClient.html
index 108643b7..0430f01b 100644
--- a/docs/python_API/ObjectPropertyClient.html
+++ b/docs/python_API/ObjectPropertyClient.html
@@ -1,7 +1,7 @@
- ObjectPropertyClient Class (python) | Ontologenius 0.3.1
+ ObjectPropertyClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/ObjectPropertyIndexClient.html b/docs/python_API/ObjectPropertyIndexClient.html
index 7b522011..cb129d74 100644
--- a/docs/python_API/ObjectPropertyIndexClient.html
+++ b/docs/python_API/ObjectPropertyIndexClient.html
@@ -1,7 +1,7 @@
- ObjectPropertyIndexClient Class (python) | Ontologenius 0.3.1
+ ObjectPropertyIndexClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/OntologiesManipulator.html b/docs/python_API/OntologiesManipulator.html
index 6bd478ea..8442eb23 100644
--- a/docs/python_API/OntologiesManipulator.html
+++ b/docs/python_API/OntologiesManipulator.html
@@ -1,7 +1,7 @@
- OntologiesManipulator Class (python) | Ontologenius 0.3.1
+ OntologiesManipulator Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/OntologyClient.html b/docs/python_API/OntologyClient.html
index 50321074..c7ae2f60 100644
--- a/docs/python_API/OntologyClient.html
+++ b/docs/python_API/OntologyClient.html
@@ -1,7 +1,7 @@
- OntologyClient Class (python) | Ontologenius 0.3.1
+ OntologyClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/OntologyIndexClient.html b/docs/python_API/OntologyIndexClient.html
index b35e0252..717cdd7a 100644
--- a/docs/python_API/OntologyIndexClient.html
+++ b/docs/python_API/OntologyIndexClient.html
@@ -1,7 +1,7 @@
- OntologyIndexClient Class (python) | Ontologenius 0.3.1
+ OntologyIndexClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/OntologyManipulator.html b/docs/python_API/OntologyManipulator.html
index e2ab7127..574f845e 100644
--- a/docs/python_API/OntologyManipulator.html
+++ b/docs/python_API/OntologyManipulator.html
@@ -1,7 +1,7 @@
- OntologyManipulator Class (python) | Ontologenius 0.3.1
+ OntologyManipulator Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/OntologyManipulatorIndex.html b/docs/python_API/OntologyManipulatorIndex.html
index 6a8f41a0..3ecf5b2c 100644
--- a/docs/python_API/OntologyManipulatorIndex.html
+++ b/docs/python_API/OntologyManipulatorIndex.html
@@ -1,7 +1,7 @@
- OntologyManipulatorIndex Class (python) | Ontologenius 0.3.1
+ OntologyManipulatorIndex Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/PythonAPI.html b/docs/python_API/PythonAPI.html
index bef1425c..2c91f8d9 100644
--- a/docs/python_API/PythonAPI.html
+++ b/docs/python_API/PythonAPI.html
@@ -1,7 +1,7 @@
- Python API (python) | Ontologenius 0.3.1
+ Python API (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/ReasonerClient.html b/docs/python_API/ReasonerClient.html
index 01468782..1bc668cf 100644
--- a/docs/python_API/ReasonerClient.html
+++ b/docs/python_API/ReasonerClient.html
@@ -1,7 +1,7 @@
- ReasonerClient Class (python) | Ontologenius 0.3.1
+ ReasonerClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/SparqlClient.html b/docs/python_API/SparqlClient.html
index dbe0772b..f7572f3d 100644
--- a/docs/python_API/SparqlClient.html
+++ b/docs/python_API/SparqlClient.html
@@ -1,7 +1,7 @@
- SparqlClient Class (python) | Ontologenius 0.3.1
+ SparqlClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_API/SparqlIndexClient.html b/docs/python_API/SparqlIndexClient.html
index 304ed64e..7d2b6d27 100644
--- a/docs/python_API/SparqlIndexClient.html
+++ b/docs/python_API/SparqlIndexClient.html
@@ -1,7 +1,7 @@
- SparqlIndexClient Class (python) | Ontologenius 0.3.1
+ SparqlIndexClient Class (python) | Ontologenius 0.3.2
diff --git a/docs/python_Tutorials/Tutorials.html b/docs/python_Tutorials/Tutorials.html
index ea78055d..6a53428d 100644
--- a/docs/python_Tutorials/Tutorials.html
+++ b/docs/python_Tutorials/Tutorials.html
@@ -1,7 +1,7 @@
- Python Tutorials | Ontologenius 0.3.1
+ Python Tutorials | Ontologenius 0.3.2
diff --git a/files/attribute.owl b/files/attribute.owl
index 382d865f..c3b4581c 100644
--- a/files/attribute.owl
+++ b/files/attribute.owl
@@ -1,13 +1,16 @@
-
-
-
+
+
@@ -23,10 +26,10 @@
-
+
-
-
+
+
explain if an entity can move by it self
activity
activité
@@ -34,38 +37,38 @@
-
+
-
-
+
+
-
+
-
-
+
+
adult
-
+
-
-
-
+
+
+
affairs are every little non alive objects
affaire
-
+
-
-
+
+
approximated age description
age
âge
@@ -73,75 +76,75 @@
-
+
-
-
-
+
+
+
an agent is an animated entity
agent
-
+
-
-
-
+
+
+
animal
-
+
-
-
-
+
+
+
animé
-
+
-
-
+
+
zone
-
+
-
-
+
+
bras
-
+
-
+
attribut
-
+
-
-
+
+
-
+
-
-
+
+
black
musta
noir
@@ -149,10 +152,10 @@
-
+
-
-
+
+
bleu
blue
sininen
@@ -160,74 +163,74 @@
-
+
-
-
-
+
+
+
blue book
-
+
-
-
-
+
+
+
blue lamp
-
+
-
-
+
+
livre
-
+
-
-
+
+
boite
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
-
+
+
+
enfant
-
+
-
-
+
+
color
couleur
väri
@@ -235,62 +238,61 @@
-
+
-
-
+
+
-
+
-
-
-
+
+
cube
-
+
-
-
+
+
tasse
-
+
-
-
+
+
-
+
-
-
- 1
+
+
+ 1
-
+
-
-
+
+
-
+
-
-
+
+
entity can describe every physical things like human, robot, objetcs, ...
entity
entité
@@ -298,421 +300,421 @@
-
+
-
-
-
+
+
+
ventilateur
-
+
-
-
-
+
+
+
féminin
-
+
-
-
+
+
-
+
-
-
+
+
pied
-
+
-
-
-
+
+
+
meuble
-
+
-
-
+
+
gender
genre
-
+
-
-
-
-
+
+
+
+
herbe
-
+
-
-
+
+
vert
vihreä
-
+
-
-
-
+
+
+
green cup
-
+
-
-
+
+
main
-
+
-
-
+
+
tête
-
+
-
-
-
-
-
- 2
+
+
+
+
+
+ 2
humain
-
+
-
-
+
+
inanimé
-
+
-
-
-
+
+
+
indoor area
zone intérieure
-
+
-
-
-
+
+
+
joints are parts of agent
jointure
-
+
-
-
-
+
+
+
lampe
-
+
-
-
+
+
jambe
-
+
-
-
-
+
+
+
vivant
-
+
-
-
+
+
capteur de luminosité
luminosity sensor
-
+
-
-
+
+
masculin
-
+
-
-
-
-
- 0
+
+
+
+
+ 0
homme
-
+
-
-
+
+
capteur de mouvement
motion sensor
-
+
-
-
+
+
non vivant
non-living
-
+
-
-
-
+
+
+
an object is an inanimated entity
objet
-
+
-
-
+
+
vieux
-
+
-
-
+
+
outdoor area
zone extérieur
-
+
-
-
-
+
+
+
-
+
-
-
+
+
pinkki
rose
-
+
-
-
+
+
plante
-
+
-
-
+
+
-
+
-
-
+
+
capteur de présence
presence sensor
-
+
-
-
+
+
violet
violetti
-
+
-
-
+
+
punainen
rouge
-
+
-
-
-
+
+
+
red bed
-
+
-
-
-
+
+
+
red fan
-
+
-
-
-
+
+
+
red fish
-
+
-
-
-
+
+
+
robot
-
+
-
-
-
+
+
+
capteur
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
cassette
-
+
-
-
-
-
+
+
+
+
a technical object can also be an affair or a furniture
objet technique
technical object
@@ -722,58 +724,58 @@ furniture
-
+
-
-
+
+
capteur de température
temperature sensor
-
+
-
-
+
+
torse
-
+
-
-
+
+
poubelle
-
+
-
-
-
+
+
+
arbre
-
+
-
-
-
+
+
+
végétal
-
+
-
-
+
+
vitality describe if an entity is alive or not
vitality
vitalité
@@ -782,126 +784,126 @@ furniture
-
+
-
-
+
+
blanc
valkoinen
-
+
-
-
-
+
+
+
femme
-
+
-
-
+
+
jaune
keltainen
-
+
-
-
+
+
jeune
-
+
-
-
+
+
oiseau
-
+
-
-
- false
+
+
+ false
manchot
-
+
-
-
- false
+
+
+ false
autruche
-
+
-
-
- false
+
+
+ false
takahe
-
+
-
-
- false
+
+
+ false
kiwi
-
+
-
-
- false
+
+
+ false
-
+
-
-
- false
+
+
+ false
-
+
-
-
- true
+
+
+ true
canari
-
+
-
-
+
+
colombe
@@ -918,11 +920,11 @@ furniture
-
+
-
-
-
+
+
+
@@ -938,62 +940,62 @@ furniture
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/files/positionProperty.owl b/files/positionProperty.owl
index 4a212ef8..2270cffa 100644
--- a/files/positionProperty.owl
+++ b/files/positionProperty.owl
@@ -1,12 +1,14 @@
-
-
+
@@ -23,223 +25,223 @@
-
+
-
-
+
+
-
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
-
+
+
+
+
-
+
-
-
-
-
+
+
+
+
-
+
-
-
-
-
+
+
+
+
-
+
-
-
+
+
-
+
-
-
-
-
+
+
+
+
-
+
-
-
-
-
+
+
+
+
-
+
-
-
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
@@ -256,30 +258,30 @@
-
+
-
-
+
+
-
+
-
-
-
+
+
+
-
+
-
-
+
+
@@ -296,33 +298,33 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/include/ontologenius/API/ontologenius/ConversionClient.h b/include/ontologenius/API/ontologenius/ConversionClient.h
index 4668a88a..5e3a3ca3 100644
--- a/include/ontologenius/API/ontologenius/ConversionClient.h
+++ b/include/ontologenius/API/ontologenius/ConversionClient.h
@@ -13,9 +13,8 @@ class ConversionClient
{
public:
/// @brief Constructs a ROS conversion client.
- /// @param n is an initialized ROS node handle.
/// @param name is the name of the ontologenius service
- ConversionClient(ros::NodeHandle* n, const std::string& name);
+ explicit ConversionClient(const std::string& name);
void verbose(bool verbose) { verbose_ = verbose; }
@@ -45,7 +44,7 @@ class ConversionClient
private:
std::string name_;
- ros::NodeHandle* n_;
+ ros::NodeHandle n_;
bool verbose_;
ros::ServiceClient client_;
diff --git a/include/ontologenius/API/ontologenius/FeederPublisher.h b/include/ontologenius/API/ontologenius/FeederPublisher.h
index a5a67eea..fda87c8b 100644
--- a/include/ontologenius/API/ontologenius/FeederPublisher.h
+++ b/include/ontologenius/API/ontologenius/FeederPublisher.h
@@ -21,27 +21,28 @@ class FeederPublisher
public:
/// @brief Constructs a FeederPublisher.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- FeederPublisher(ros::NodeHandle* n, const std::string& name) :
- n_(n),
+ explicit FeederPublisher(const std::string& name) :
name_(name),
- pub_(n->advertise((name == "") ? "ontologenius/insert" : "ontologenius/insert/" + name, 1000)),
- stamped_pub_(n->advertise((name == "") ? "ontologenius/insert_stamped" : "ontologenius/insert_stamped/" + name, 1000))
+ notification_callback_([](auto& msg){ (void) msg; }),
+ pub_(n_.advertise((name == "") ? "ontologenius/insert" : "ontologenius/insert/" + name, 1000)),
+ stamped_pub_(n_.advertise((name == "") ? "ontologenius/insert_stamped" : "ontologenius/insert_stamped/" + name, 1000))
{
+
srand (time(NULL));
commit_nb_ = rand() % 100000 + 1;
- commit_sub_ = n_->subscribe(name_ == "" ? "ontologenius/end" : "ontologenius/end/" + name_, 1000, &FeederPublisher::commitCallback, this);
+ commit_sub_ = n_.subscribe(name_ == "" ? "ontologenius/end" : "ontologenius/end/" + name_, 1000, &FeederPublisher::commitCallback, this);
+ notif_sub_ = n_.subscribe(name_ == "" ? "ontologenius/feeder_notifications" : "ontologenius/feeder_notifications/" + name_, 1000, &FeederPublisher::notificationCallback, this);
updated_ = false;
}
FeederPublisher(FeederPublisher& other) :
- n_(other.n_),
name_(other.name_),
- pub_(other.n_->advertise((other.name_ == "") ? "ontologenius/insert" : "ontologenius/insert/" + other.name_, 1000)),
- stamped_pub_(other.n_->advertise((other.name_ == "") ? "ontologenius/insert_stamped" : "ontologenius/insert_stamped/" + other.name_, 1000))
+ pub_(n_.advertise((other.name_ == "") ? "ontologenius/insert" : "ontologenius/insert/" + other.name_, 1000)),
+ stamped_pub_(n_.advertise((other.name_ == "") ? "ontologenius/insert_stamped" : "ontologenius/insert_stamped/" + other.name_, 1000))
{
- commit_sub_ = n_->subscribe(name_ == "" ? "ontologenius/end" : "ontologenius/end/" + name_, 1000, &FeederPublisher::commitCallback, this);
+ commit_sub_ = n_.subscribe(name_ == "" ? "ontologenius/end" : "ontologenius/end/" + name_, 1000, &FeederPublisher::commitCallback, this);
+ notif_sub_ = n_.subscribe(name_ == "" ? "ontologenius/feeder_notifications" : "ontologenius/feeder_notifications/" + name_, 1000, &FeederPublisher::notificationCallback, this);
commit_nb_ = other.commit_nb_;
updated_ = false;
}
@@ -174,21 +175,29 @@ class FeederPublisher
/// @return Returns false if the function returns on a timeout.
bool checkout(const std::string& commit_name, int32_t timeout = -1);
+ /// @brief Register a callback function to get notifications from the feeder.
+ /// @param callback is the callback function taking a string.
+ void registerNotificationCallback(const std::function& callback) { notification_callback_ = callback; }
+
private:
- ros::NodeHandle* n_;
+ ros::NodeHandle n_;
std::string name_;
+ std::function notification_callback_;
+
ros::Publisher pub_;
ros::Publisher stamped_pub_;
ros::Subscriber commit_sub_;
+ ros::Subscriber notif_sub_;
std::atomic updated_;
size_t commit_nb_;
void sendNop();
-public:
+
void publish(const std::string& str);
void publishStamped(const std::string& str, const ros::Time& stamp);
void commitCallback(const std_msgs::String::ConstPtr& msg);
+ void notificationCallback(const std_msgs::String::ConstPtr& msg) { notification_callback_(msg->data); }
};
} // namespace onto
diff --git a/include/ontologenius/API/ontologenius/OntologiesManipulator.h b/include/ontologenius/API/ontologenius/OntologiesManipulator.h
index 396d9476..298799b2 100644
--- a/include/ontologenius/API/ontologenius/OntologiesManipulator.h
+++ b/include/ontologenius/API/ontologenius/OntologiesManipulator.h
@@ -4,8 +4,6 @@
#include
#include
-#include
-
#include "ontologenius/API/ontologenius/clients/ManagerClient.h"
#include "ontologenius/API/ontologenius/OntologyManipulator.h"
#include "ontologenius/API/ontologenius/OntologyManipulatorIndex.h"
@@ -18,15 +16,14 @@ namespace onto {
class OntologiesManipulator : public ManagerClient
{
public:
- /// @brief Constructs a manipulator for several instance of ontologies with a pointer to a NodeHandle n.
- /// This pointer is necessary to create the ros services in the constructor.
- /// @param n is an initialized ros node handle
+ /// @brief Constructs a manipulator for several instance of ontologies
explicit OntologiesManipulator(ros::NodeHandle* n);
+ OntologiesManipulator();
~OntologiesManipulator();
/// @brief Wait for ontologenius services to be advertised and available for. Blocks until it is.
/// @param timeout is the amount of time to wait for before timing out. If timeout is -1 (default), waits until the node is shutdown.
- void waitInit(int32_t timeout = -1);
+ bool waitInit(int32_t timeout = -1);
/// @brief Gets a pointer on the OntologyManipulator instance named name.
/// @param name is the name of the instance to get.
@@ -63,7 +60,7 @@ class OntologiesManipulator : public ManagerClient
}
private:
- ros::NodeHandle* n_; // do not move this line below
+ ros::NodeHandle n_; // do not move this line below
std::map manipulators_;
std::map manipulators_index_;
};
diff --git a/include/ontologenius/API/ontologenius/OntologyManipulator.h b/include/ontologenius/API/ontologenius/OntologyManipulator.h
index 77e71805..af436bbd 100644
--- a/include/ontologenius/API/ontologenius/OntologyManipulator.h
+++ b/include/ontologenius/API/ontologenius/OntologyManipulator.h
@@ -4,8 +4,6 @@
#include
#include
-#include
-
#include "ontologenius/API/ontologenius/clients/ontologyClients/IndividualClient.h"
#include "ontologenius/API/ontologenius/clients/ontologyClients/ObjectPropertyClient.h"
#include "ontologenius/API/ontologenius/clients/ontologyClients/DataPropertyClient.h"
diff --git a/include/ontologenius/API/ontologenius/OntologyManipulatorIndex.h b/include/ontologenius/API/ontologenius/OntologyManipulatorIndex.h
index cafc1cc3..c37bb303 100644
--- a/include/ontologenius/API/ontologenius/OntologyManipulatorIndex.h
+++ b/include/ontologenius/API/ontologenius/OntologyManipulatorIndex.h
@@ -4,8 +4,6 @@
#include
#include
-#include
-
#include "ontologenius/API/ontologenius/clientsIndex/ontologyClients/IndividualIndexClient.h"
#include "ontologenius/API/ontologenius/clientsIndex/ontologyClients/ObjectPropertyIndexClient.h"
#include "ontologenius/API/ontologenius/clientsIndex/ontologyClients/DataPropertyIndexClient.h"
diff --git a/include/ontologenius/API/ontologenius/clients/ActionClient.h b/include/ontologenius/API/ontologenius/clients/ActionClient.h
index 72bd4245..d536efc5 100644
--- a/include/ontologenius/API/ontologenius/clients/ActionClient.h
+++ b/include/ontologenius/API/ontologenius/clients/ActionClient.h
@@ -14,14 +14,13 @@ class ActionClient : public ClientBase
public:
/// @brief Constructs an action client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- ActionClient(ros::NodeHandle* n, const std::string& name) : ClientBase(n, (name == "") ? "actions" : "actions/" + name)
+ explicit ActionClient(const std::string& name) : ClientBase((name == "") ? "actions" : "actions/" + name)
{
}
/// @brief Link all the concepts loaded from files and the Internet. Before closing an ontology, exploration requests are not allowed.
- /// @return Returns false if the service call fails.
+ /// @return Returns false ontology closure fails or if the service call fails.
bool close();
/// @brief Saves the current ontology in an absolute path.
/// @param path is the path where the ontology will be saved. It must be of the form: my/path/to/ontology.owl
diff --git a/include/ontologenius/API/ontologenius/clients/ClientBase.h b/include/ontologenius/API/ontologenius/clients/ClientBase.h
index 5e6723a4..56c91c0f 100644
--- a/include/ontologenius/API/ontologenius/clients/ClientBase.h
+++ b/include/ontologenius/API/ontologenius/clients/ClientBase.h
@@ -31,12 +31,12 @@ class ClientBase
{
public:
/// @brief Constructs a ROS client.
- /// @param n is an initialized ROS node handle.
/// @param name is the name of the ontologenius service
- ClientBase(ros::NodeHandle* n, const std::string& name) : client(n->serviceClient("/ontologenius/" + name, true)), name_(name)
- {
- n_ = n;
- }
+ explicit ClientBase(const std::string& name) : name_(name),
+ error_code_(0),
+ client(n_.serviceClient("/ontologenius/" + name, true))
+
+ {}
/// @brief Gives the total number of service calls from all ClientBase instances since the last reset.
size_t nb() {return cpt;}
@@ -44,34 +44,42 @@ class ClientBase
void resetNb() {cpt = 0;}
static void verbose(bool verbose) { verbose_ = verbose; }
-protected:
- ros::ServiceClient client;
+ int getErrorCode() { return error_code_; }
/// @brief Calls the service set up in the constructor of ClientBase.
- /// @param srv is the request.
+ /// @param action the query action.
+ /// @param param the query parameters.
/// @return Returns a list of string. If the service call fails, the first element of the returned vector is "ERR:SERVICE_FAIL".
- inline std::vector call(ontologenius::OntologeniusService& srv)
+ inline std::vector call(const std::string& action, const std::string& param)
{
+ ontologenius::OntologeniusService srv;
+ srv.request.action = action;
+ srv.request.param = param;
std::vector res;
cpt++;
if(client.call(srv))
+ {
+ error_code_ = srv.response.code;
return srv.response.values;
+ }
else
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call ontologenius/" << name_ << COLOR_OFF << std::endl;
- client = n_->serviceClient("/ontologenius/" + name_, true);
+ client = n_.serviceClient("/ontologenius/" + name_, true);
if(client.call(srv))
{
if(verbose_)
std::cout << COLOR_GREEN << "Restored ontologenius/" << name_ << COLOR_OFF << std::endl;
+ error_code_ = srv.response.code;
return srv.response.values;
}
else
{
if(verbose_)
std::cout << COLOR_RED << "Failure of service restoration" << COLOR_OFF << std::endl;
+ error_code_ = -1;
res.push_back("ERR:SERVICE_FAIL");
return res;
}
@@ -79,15 +87,20 @@ class ClientBase
}
/// @brief Calls the service set up in the constructor of ClientBase.
- /// @param srv is the request.
+ /// @param action the query action.
+ /// @param param the query parameters.
/// @return Returns a single string. If the service call fails, the returned value is "ERR:SERVICE_FAIL".
- inline std::string callStr(ontologenius::OntologeniusService& srv)
+ inline std::string callStr(const std::string& action, const std::string& param)
{
+ ontologenius::OntologeniusService srv;
+ srv.request.action = action;
+ srv.request.param = param;
std::string res = "";
cpt++;
if(client.call(srv))
{
+ error_code_ = srv.response.code;
if(srv.response.values.size())
return srv.response.values[0];
else
@@ -97,11 +110,12 @@ class ClientBase
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call ontologenius/" << name_ << COLOR_OFF << std::endl;
- client = n_->serviceClient("/ontologenius/" + name_, true);
+ client = n_.serviceClient("/ontologenius/" + name_, true);
if(client.call(srv))
{
if(verbose_)
std::cout << COLOR_GREEN << "Restored ontologenius/" << name_ << COLOR_OFF << std::endl;
+ error_code_ = srv.response.code;
if(srv.response.values.size())
return srv.response.values[0];
else
@@ -111,6 +125,7 @@ class ClientBase
{
if(verbose_)
std::cout << COLOR_RED << "Failure of service restoration" << COLOR_OFF << std::endl;
+ error_code_ = -1;
res = "ERR:SERVICE_FAIL";
return res;
}
@@ -118,58 +133,76 @@ class ClientBase
}
/// @brief Calls the service set up in the constructor of ClientBase.
- /// @param srv is the request.
+ /// @param action the query action.
+ /// @param param the query parameters.
/// @return Returns false if the service call fails.
- inline bool callNR(ontologenius::OntologeniusService& srv)
+ inline bool callNR(const std::string& action, const std::string& param)
{
+ ontologenius::OntologeniusService srv;
+ srv.request.action = action;
+ srv.request.param = param;
cpt++;
if(client.call(srv))
+ {
+ error_code_ = srv.response.code;
return true;
+ }
else
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call ontologenius/" << name_ << COLOR_OFF << std::endl;
- client = n_->serviceClient("/ontologenius/" + name_, true);
+ client = n_.serviceClient("/ontologenius/" + name_, true);
if(client.call(srv))
{
if(verbose_)
std::cout << COLOR_GREEN << "Restored ontologenius/" << name_ << COLOR_OFF << std::endl;
+ error_code_ = srv.response.code;
return true;
}
else
{
if(verbose_)
std::cout << COLOR_RED << "Failure of service restoration" << COLOR_OFF << std::endl;
+ error_code_ = -1;
return false;
}
}
}
/// @brief Calls the service set up in the constructor of ClientBase.
- /// @param srv is the request.
+ /// @param action the query action.
+ /// @param param the query parameters.
/// @return Returns false if the service call fails or the result code of the service is different from SUCCESS.
- inline bool callBool(ontologenius::OntologeniusService& srv)
+ inline bool callBool(const std::string& action, const std::string& param)
{
+ ontologenius::OntologeniusService srv;
+ srv.request.action = action;
+ srv.request.param = param;
cpt++;
if(client.call(srv))
+ {
+ error_code_ = srv.response.code;
return (srv.response.code == 0);
+ }
else
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call ontologenius/" << name_ << COLOR_OFF << std::endl;
- client = n_->serviceClient("/ontologenius/" + name_, true);
+ client = n_.serviceClient("/ontologenius/" + name_, true);
if(client.call(srv))
{
if(verbose_)
std::cout << COLOR_GREEN << "Restored ontologenius/" << name_ << COLOR_OFF << std::endl;
+ error_code_ = srv.response.code;
return (srv.response.code == 0);
}
else
{
if(verbose_)
std::cout << COLOR_RED << "Failure of service restoration" << COLOR_OFF << std::endl;
+ error_code_ = -1;
return false;
}
}
@@ -177,9 +210,13 @@ class ClientBase
private:
std::string name_;
- ros::NodeHandle* n_;
+ ros::NodeHandle n_;
static size_t cpt;
static bool verbose_;
+ int error_code_;
+
+protected:
+ ros::ServiceClient client;
};
} // namespace onto
diff --git a/include/ontologenius/API/ontologenius/clients/ManagerClient.h b/include/ontologenius/API/ontologenius/clients/ManagerClient.h
index 8f3a592e..e8057ee2 100644
--- a/include/ontologenius/API/ontologenius/clients/ManagerClient.h
+++ b/include/ontologenius/API/ontologenius/clients/ManagerClient.h
@@ -18,11 +18,9 @@ class ManagerClient : public ClientBase
public:
/// @brief Constructs a manager client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- explicit ManagerClient(ros::NodeHandle* n) : ClientBase(n, "manage")
- {
- }
+ explicit ManagerClient() : ClientBase("manage")
+ { }
/// @brief Gets the name of the instantiated ontologies.
/// @return the list as the instantiated ontologies in the form of a verctor of string.
diff --git a/include/ontologenius/API/ontologenius/clients/ReasonerClient.h b/include/ontologenius/API/ontologenius/clients/ReasonerClient.h
index 4afed6b1..cbd3685e 100644
--- a/include/ontologenius/API/ontologenius/clients/ReasonerClient.h
+++ b/include/ontologenius/API/ontologenius/clients/ReasonerClient.h
@@ -16,11 +16,9 @@ class ReasonerClient : public ClientBase
public:
/// @brief Constructs a reasoner client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- ReasonerClient(ros::NodeHandle* n, const std::string& name) : ClientBase(n, (name == "") ? "reasoner" : "reasoner/" + name)
- {
- }
+ explicit ReasonerClient(const std::string& name) : ClientBase((name == "") ? "reasoner" : "reasoner/" + name)
+ {}
/// @brief Gets the name of the plugins available.
/// @return the list as the available plugins in the form of a verctor of string.
diff --git a/include/ontologenius/API/ontologenius/clients/SparqlClient.h b/include/ontologenius/API/ontologenius/clients/SparqlClient.h
index 131dee43..bced2bc1 100644
--- a/include/ontologenius/API/ontologenius/clients/SparqlClient.h
+++ b/include/ontologenius/API/ontologenius/clients/SparqlClient.h
@@ -15,20 +15,17 @@ class SparqlClient
public:
/// @brief Constructs a sparql client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- SparqlClient(ros::NodeHandle* n, const std::string& name) : client(n->serviceClient((name == "") ? "ontologenius/sparql" : "ontologenius/sparql/" + name, true)),
- name_((name == "") ? "sparql" : "sparql/" + name)
- {
- n_ = n;
- }
+ explicit SparqlClient(const std::string& name) : client(n_.serviceClient((name == "") ? "ontologenius/sparql" : "ontologenius/sparql/" + name, true)),
+ name_((name == "") ? "sparql" : "sparql/" + name)
+ {}
std::pair, std::vector> call(const std::string& query);
private:
+ ros::NodeHandle n_;
ros::ServiceClient client;
std::string name_;
- ros::NodeHandle* n_;
};
} // namespace onto
diff --git a/include/ontologenius/API/ontologenius/clients/ontologyClients/ClassClient.h b/include/ontologenius/API/ontologenius/clients/ontologyClients/ClassClient.h
index b02b90b1..2c159676 100644
--- a/include/ontologenius/API/ontologenius/clients/ontologyClients/ClassClient.h
+++ b/include/ontologenius/API/ontologenius/clients/ontologyClients/ClassClient.h
@@ -15,11 +15,9 @@ class ClassClient : public OntologyClient
public:
/// @brief Constructs a class client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- ClassClient(ros::NodeHandle* n, const std::string& name) : OntologyClient(n, (name == "") ? "class" : "class/" + name)
- {
- }
+ explicit ClassClient(const std::string& name) : OntologyClient((name == "") ? "class" : "class/" + name)
+ {}
/// @brief Gives all classes below the one given in the specified parameter.
/// @param name is a class identifier.
diff --git a/include/ontologenius/API/ontologenius/clients/ontologyClients/DataPropertyClient.h b/include/ontologenius/API/ontologenius/clients/ontologyClients/DataPropertyClient.h
index 73c48998..7fc622ba 100644
--- a/include/ontologenius/API/ontologenius/clients/ontologyClients/DataPropertyClient.h
+++ b/include/ontologenius/API/ontologenius/clients/ontologyClients/DataPropertyClient.h
@@ -15,9 +15,8 @@ class DataPropertyClient : public OntologyClient
public:
/// @brief Constructs a data property client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- DataPropertyClient(ros::NodeHandle* n, const std::string& name) : OntologyClient(n, (name == "") ? "data_property" : "data_property/" + name)
+ explicit DataPropertyClient(const std::string& name) : OntologyClient((name == "") ? "data_property" : "data_property/" + name)
{
}
diff --git a/include/ontologenius/API/ontologenius/clients/ontologyClients/IndividualClient.h b/include/ontologenius/API/ontologenius/clients/ontologyClients/IndividualClient.h
index 3ea5b6a9..3871ce6c 100644
--- a/include/ontologenius/API/ontologenius/clients/ontologyClients/IndividualClient.h
+++ b/include/ontologenius/API/ontologenius/clients/ontologyClients/IndividualClient.h
@@ -15,9 +15,8 @@ class IndividualClient : public OntologyClient
public:
/// @brief Constructs an individual client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- IndividualClient(ros::NodeHandle* n, const std::string& name) : OntologyClient(n, (name == "")? "individual" : "individual/" + name)
+ explicit IndividualClient(const std::string& name) : OntologyClient((name == "")? "individual" : "individual/" + name)
{
}
diff --git a/include/ontologenius/API/ontologenius/clients/ontologyClients/ObjectPropertyClient.h b/include/ontologenius/API/ontologenius/clients/ontologyClients/ObjectPropertyClient.h
index acb87a91..0fb2f5e9 100644
--- a/include/ontologenius/API/ontologenius/clients/ontologyClients/ObjectPropertyClient.h
+++ b/include/ontologenius/API/ontologenius/clients/ontologyClients/ObjectPropertyClient.h
@@ -15,9 +15,8 @@ class ObjectPropertyClient : public OntologyClient
public:
/// @brief Constructs an object property client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- ObjectPropertyClient(ros::NodeHandle* n, const std::string& name) : OntologyClient(n, (name == "") ? "object_property" : "object_property/" + name)
+ explicit ObjectPropertyClient(const std::string& name) : OntologyClient((name == "") ? "object_property" : "object_property/" + name)
{
}
diff --git a/include/ontologenius/API/ontologenius/clients/ontologyClients/OntologyClient.h b/include/ontologenius/API/ontologenius/clients/ontologyClients/OntologyClient.h
index 94ddb643..689a2c06 100644
--- a/include/ontologenius/API/ontologenius/clients/ontologyClients/OntologyClient.h
+++ b/include/ontologenius/API/ontologenius/clients/ontologyClients/OntologyClient.h
@@ -15,9 +15,8 @@ class OntologyClient : public ClientBase
public:
/// @brief Constructs an ontology client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- OntologyClient(ros::NodeHandle* n, const std::string& name) : ClientBase(n, name)
+ explicit OntologyClient(const std::string& name) : ClientBase(name)
{
}
diff --git a/include/ontologenius/API/ontologenius/clientsIndex/ClientBaseIndex.h b/include/ontologenius/API/ontologenius/clientsIndex/ClientBaseIndex.h
index 163047a4..c9b7c796 100644
--- a/include/ontologenius/API/ontologenius/clientsIndex/ClientBaseIndex.h
+++ b/include/ontologenius/API/ontologenius/clientsIndex/ClientBaseIndex.h
@@ -31,12 +31,11 @@ class ClientBaseIndex
{
public:
/// @brief Constructs a ROS client.
- /// @param n is an initialized ROS node handle.
/// @param name is the name of the ontologenius service
- ClientBaseIndex(ros::NodeHandle* n, const std::string& name) : client(n->serviceClient("/ontologenius/" + name, true)), name_(name)
- {
- n_ = n;
- }
+ explicit ClientBaseIndex(const std::string& name) : name_(name),
+ error_code_(0),
+ client(n_.serviceClient("/ontologenius/" + name, true))
+ {}
/// @brief Gives the total number of service calls from all ClientBaseIndex instances since the last reset.
size_t nb() {return cpt;}
@@ -44,28 +43,35 @@ class ClientBaseIndex
void resetNb() {cpt = 0;}
static void verbose(bool verbose) { verbose_ = verbose; }
-protected:
- ros::ServiceClient client;
+ int getErrorCode() { return error_code_; }
/// @brief Calls the service set up in the constructor of ClientBaseIndex.
- /// @param srv is the request.
+ /// @param action the query action.
+ /// @param param the query parameters.
/// @return Returns a list of string. If the service call fails, the first element of the returned vector is "ERR:SERVICE_FAIL".
- inline std::vector call(ontologenius::OntologeniusIndexService& srv)
+ inline std::vector call(const std::string& action, const std::string& param)
{
+ ontologenius::OntologeniusIndexService srv;
+ srv.request.action = action;
+ srv.request.param = param;
std::vector res;
cpt++;
if(client.call(srv))
+ {
+ error_code_ = srv.response.code;
return srv.response.string_values;
+ }
else
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call ontologenius/" << name_ << COLOR_OFF << std::endl;
- client = n_->serviceClient("/ontologenius/" + name_, true);
+ client = n_.serviceClient("/ontologenius/" + name_, true);
if(client.call(srv))
{
if(verbose_)
std::cout << COLOR_GREEN << "Restored ontologenius/" << name_ << COLOR_OFF << std::endl;
+ error_code_ = srv.response.code;
return srv.response.string_values;
}
else
@@ -73,30 +79,39 @@ class ClientBaseIndex
if(verbose_)
std::cout << COLOR_RED << "Failure of service restoration" << COLOR_OFF << std::endl;
res.push_back("ERR:SERVICE_FAIL");
+ error_code_ = -1;
return res;
}
}
}
/// @brief Calls the service set up in the constructor of ClientBaseIndex.
- /// @param srv is the request.
+ /// @param action the query action.
+ /// @param param the query parameters.
/// @return Returns a list of int64. If the service call fails, the first element of the returned vector is "0".
- inline std::vector callIndexes(ontologenius::OntologeniusIndexService& srv)
+ inline std::vector callIndexes(const std::string& action, const std::string& param)
{
+ ontologenius::OntologeniusIndexService srv;
+ srv.request.action = action;
+ srv.request.param = param;
std::vector res;
cpt++;
if(client.call(srv))
+ {
+ error_code_ = srv.response.code;
return srv.response.index_values;
+ }
else
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call ontologenius/" << name_ << COLOR_OFF << std::endl;
- client = n_->serviceClient("/ontologenius/" + name_, true);
+ client = n_.serviceClient("/ontologenius/" + name_, true);
if(client.call(srv))
{
if(verbose_)
std::cout << COLOR_GREEN << "Restored ontologenius/" << name_ << COLOR_OFF << std::endl;
+ error_code_ = srv.response.code;
return srv.response.index_values;
}
else
@@ -104,20 +119,26 @@ class ClientBaseIndex
if(verbose_)
std::cout << COLOR_RED << "Failure of service restoration" << COLOR_OFF << std::endl;
res.push_back(0);
+ error_code_ = -1;
return res;
}
}
}
/// @brief Calls the service set up in the constructor of ClientBaseIndex.
- /// @param srv is the request.
+ /// @param action the query action.
+ /// @param param the query parameters.
/// @return Returns a single string. If the service call fails, the returned value is "ERR:SERVICE_FAIL".
- inline std::string callStr(ontologenius::OntologeniusIndexService& srv)
+ inline std::string callStr(const std::string& action, const std::string& param)
{
+ ontologenius::OntologeniusIndexService srv;
+ srv.request.action = action;
+ srv.request.param = param;
cpt++;
if(client.call(srv))
{
+ error_code_ = srv.response.code;
if(srv.response.string_values.size())
return srv.response.string_values[0];
else
@@ -127,11 +148,12 @@ class ClientBaseIndex
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call ontologenius/" << name_ << COLOR_OFF << std::endl;
- client = n_->serviceClient("/ontologenius/" + name_, true);
+ client = n_.serviceClient("/ontologenius/" + name_, true);
if(client.call(srv))
{
if(verbose_)
std::cout << COLOR_GREEN << "Restored ontologenius/" << name_ << COLOR_OFF << std::endl;
+ error_code_ = srv.response.code;
if(srv.response.string_values.size())
return srv.response.string_values[0];
else
@@ -141,20 +163,26 @@ class ClientBaseIndex
{
if(verbose_)
std::cout << COLOR_RED << "Failure of service restoration" << COLOR_OFF << std::endl;
+ error_code_ = -1;
return "ERR:SERVICE_FAIL";
}
}
}
/// @brief Calls the service set up in the constructor of ClientBaseIndex.
- /// @param srv is the request.
+ /// @param action the query action.
+ /// @param param the query parameters.
/// @return Returns a single int64. If the service call fails or has no response, the returned value is "0".
- inline int64_t callIndex(ontologenius::OntologeniusIndexService& srv)
+ inline int64_t callIndex(const std::string& action, const std::string& param)
{
+ ontologenius::OntologeniusIndexService srv;
+ srv.request.action = action;
+ srv.request.param = param;
cpt++;
if(client.call(srv))
{
+ error_code_ = srv.response.code;
if(srv.response.index_values.size())
return srv.response.index_values[0];
else
@@ -164,11 +192,12 @@ class ClientBaseIndex
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call ontologenius/" << name_ << COLOR_OFF << std::endl;
- client = n_->serviceClient("/ontologenius/" + name_, true);
+ client = n_.serviceClient("/ontologenius/" + name_, true);
if(client.call(srv))
{
if(verbose_)
std::cout << COLOR_GREEN << "Restored ontologenius/" << name_ << COLOR_OFF << std::endl;
+ error_code_ = srv.response.code;
if(srv.response.index_values.size())
return srv.response.index_values[0];
else
@@ -178,45 +207,59 @@ class ClientBaseIndex
{
if(verbose_)
std::cout << COLOR_RED << "Failure of service restoration" << COLOR_OFF << std::endl;
+ error_code_ = -1;
return 0;
}
}
}
/// @brief Calls the service set up in the constructor of ClientBaseIndex.
- /// @param srv is the request.
+ /// @param action the query action.
+ /// @param param the query parameters.
/// @return Returns false if the service call fails.
- inline bool callNR(ontologenius::OntologeniusIndexService& srv)
+ inline bool callNR(const std::string& action, const std::string& param)
{
+ ontologenius::OntologeniusIndexService srv;
+ srv.request.action = action;
+ srv.request.param = param;
cpt++;
if(client.call(srv))
+ {
+ error_code_ = srv.response.code;
return true;
+ }
else
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call ontologenius/" << name_ << COLOR_OFF << std::endl;
- client = n_->serviceClient("/ontologenius/" + name_, true);
+ client = n_.serviceClient("/ontologenius/" + name_, true);
if(client.call(srv))
{
if(verbose_)
std::cout << COLOR_GREEN << "Restored ontologenius/" << name_ << COLOR_OFF << std::endl;
+ error_code_ = srv.response.code;
return true;
}
else
{
if(verbose_)
std::cout << COLOR_RED << "Failure of service restoration" << COLOR_OFF << std::endl;
+ error_code_ = -1;
return false;
}
}
}
/// @brief Calls the service set up in the constructor of ClientBaseIndex.
- /// @param srv is the request.
+ /// @param action the query action.
+ /// @param param the query parameters.
/// @return Returns false if the service call fails or the result code of the service is different from SUCCESS.
- inline bool callBool(ontologenius::OntologeniusIndexService& srv)
+ inline bool callBool(const std::string& action, const std::string& param)
{
+ ontologenius::OntologeniusIndexService srv;
+ srv.request.action = action;
+ srv.request.param = param;
cpt++;
if(client.call(srv))
@@ -225,7 +268,7 @@ class ClientBaseIndex
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call ontologenius/" << name_ << COLOR_OFF << std::endl;
- client = n_->serviceClient("/ontologenius/" + name_, true);
+ client = n_.serviceClient("/ontologenius/" + name_, true);
if(client.call(srv))
{
if(verbose_)
@@ -243,9 +286,13 @@ class ClientBaseIndex
private:
std::string name_;
- ros::NodeHandle* n_;
+ ros::NodeHandle n_;
static size_t cpt;
static bool verbose_;
+ int error_code_;
+
+protected:
+ ros::ServiceClient client;
};
} // namespace onto
diff --git a/include/ontologenius/API/ontologenius/clientsIndex/SparqlIndexClient.h b/include/ontologenius/API/ontologenius/clientsIndex/SparqlIndexClient.h
index cd3eb316..86109891 100644
--- a/include/ontologenius/API/ontologenius/clientsIndex/SparqlIndexClient.h
+++ b/include/ontologenius/API/ontologenius/clientsIndex/SparqlIndexClient.h
@@ -15,20 +15,18 @@ class SparqlIndexClient
public:
/// @brief Constructs a sparql client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- SparqlIndexClient(ros::NodeHandle* n, const std::string& name) : client(n->serviceClient((name == "") ? "ontologenius/sparql_index" : "ontologenius/sparql_index/" + name, true)),
- name_((name == "") ? "sparql_index" : "sparql_index/" + name)
- {
- n_ = n;
- }
+ explicit SparqlIndexClient(const std::string& name) : name_((name == "") ? "sparql_index" : "sparql_index/" + name),
+ client(n_.serviceClient((name == "") ? "ontologenius/sparql_index" : "ontologenius/sparql_index/" + name, true))
+
+ {}
std::pair, std::vector> call(const std::string& query);
private:
- ros::ServiceClient client;
+ ros::NodeHandle n_;
std::string name_;
- ros::NodeHandle* n_;
+ ros::ServiceClient client;
};
} // namespace onto
diff --git a/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/ClassIndexClient.h b/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/ClassIndexClient.h
index 48455d87..ca5ab5bf 100644
--- a/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/ClassIndexClient.h
+++ b/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/ClassIndexClient.h
@@ -15,9 +15,8 @@ class ClassIndexClient : public OntologyIndexClient
public:
/// @brief Constructs a class client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- ClassIndexClient(ros::NodeHandle* n, const std::string& name) : OntologyIndexClient(n, (name == "") ? "class_index" : "class_index/" + name)
+ explicit ClassIndexClient(const std::string& name) : OntologyIndexClient((name == "") ? "class_index" : "class_index/" + name)
{
}
diff --git a/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/DataPropertyIndexClient.h b/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/DataPropertyIndexClient.h
index c67f2e48..bf3a0bc0 100644
--- a/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/DataPropertyIndexClient.h
+++ b/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/DataPropertyIndexClient.h
@@ -15,9 +15,8 @@ class DataPropertyIndexClient : public OntologyIndexClient
public:
/// @brief Constructs a data property client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- DataPropertyIndexClient(ros::NodeHandle* n, const std::string& name) : OntologyIndexClient(n, (name == "") ? "data_property_index" : "data_property_index/" + name)
+ explicit DataPropertyIndexClient(const std::string& name) : OntologyIndexClient((name == "") ? "data_property_index" : "data_property_index/" + name)
{
}
diff --git a/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/IndividualIndexClient.h b/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/IndividualIndexClient.h
index 1dfd4610..f843daaf 100644
--- a/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/IndividualIndexClient.h
+++ b/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/IndividualIndexClient.h
@@ -15,9 +15,8 @@ class IndividualIndexClient : public OntologyIndexClient
public:
/// @brief Constructs an individual client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- IndividualIndexClient(ros::NodeHandle* n, const std::string& name) : OntologyIndexClient(n, (name == "")? "individual_index" : "individual_index/" + name)
+ explicit IndividualIndexClient(const std::string& name) : OntologyIndexClient((name == "")? "individual_index" : "individual_index/" + name)
{
}
diff --git a/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/ObjectPropertyIndexClient.h b/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/ObjectPropertyIndexClient.h
index a12435a0..749b3477 100644
--- a/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/ObjectPropertyIndexClient.h
+++ b/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/ObjectPropertyIndexClient.h
@@ -15,9 +15,8 @@ class ObjectPropertyIndexClient : public OntologyIndexClient
public:
/// @brief Constructs an object property client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- ObjectPropertyIndexClient(ros::NodeHandle* n, const std::string& name) : OntologyIndexClient(n, (name == "") ? "object_property_index" : "object_property_index/" + name)
+ explicit ObjectPropertyIndexClient(const std::string& name) : OntologyIndexClient((name == "") ? "object_property_index" : "object_property_index/" + name)
{
}
diff --git a/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/OntologyIndexClient.h b/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/OntologyIndexClient.h
index 8924e99d..3227d1e1 100644
--- a/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/OntologyIndexClient.h
+++ b/include/ontologenius/API/ontologenius/clientsIndex/ontologyClients/OntologyIndexClient.h
@@ -15,9 +15,8 @@ class OntologyIndexClient : public ClientBaseIndex
public:
/// @brief Constructs an ontology client.
/// Can be used in a multi-ontology mode by specifying the name of the ontology name.
- /// @param n is an initialized ROS node handle.
/// @param name is the instance to be connected to. For classic use, name should be defined as "".
- OntologyIndexClient(ros::NodeHandle* n, const std::string& name) : ClientBaseIndex(n, name)
+ explicit OntologyIndexClient(const std::string& name) : ClientBaseIndex(name)
{
}
diff --git a/include/ontologenius/core/ontoGraphs/Graphs/Graph.h b/include/ontologenius/core/ontoGraphs/Graphs/Graph.h
index 6a5d15a8..79aa9fe0 100644
--- a/include/ontologenius/core/ontoGraphs/Graphs/Graph.h
+++ b/include/ontologenius/core/ontoGraphs/Graphs/Graph.h
@@ -64,6 +64,8 @@ class Graph
for(size_t i = 0; i < dictionary[lang].size();)
if(dictionary[lang][i] == word)
dictionary[lang].erase(dictionary[lang].begin() + i);
+ else
+ i++;
}
}
diff --git a/include/ontologenius/core/ontoGraphs/Ontology.h b/include/ontologenius/core/ontoGraphs/Ontology.h
index 130fcfae..5aa1c6b4 100644
--- a/include/ontologenius/core/ontoGraphs/Ontology.h
+++ b/include/ontologenius/core/ontoGraphs/Ontology.h
@@ -18,7 +18,7 @@ class Ontology
Ontology(const Ontology& other);
~Ontology();
- int close();
+ bool close();
int readFromUri(const std::string& uri);
int readFromFile(const std::string& file_name);
diff --git a/include/ontologenius/core/ontologyIO/OntologyLoader.h b/include/ontologenius/core/ontologyIO/OntologyLoader.h
index 246fc32b..6f27da9a 100644
--- a/include/ontologenius/core/ontologyIO/OntologyLoader.h
+++ b/include/ontologenius/core/ontologyIO/OntologyLoader.h
@@ -46,6 +46,7 @@ class OntologyLoader
bool isProtected(const std::string& page_content);
int downloadFile(const std::string& uri);
+ std::string downlaodFileCurl(const std::string& uri);
void loadImports(const std::vector& imports);
std::pair resolvePath(const std::string& raw_path);
diff --git a/include/ontologenius/core/ontologyIO/Owl/OntologyOwlReader.h b/include/ontologenius/core/ontologyIO/Owl/OntologyOwlReader.h
index 3b4a87c6..43d7939e 100644
--- a/include/ontologenius/core/ontologyIO/Owl/OntologyOwlReader.h
+++ b/include/ontologenius/core/ontologyIO/Owl/OntologyOwlReader.h
@@ -8,8 +8,6 @@
#include
-#include
-
#include "ontologenius/core/ontologyIO/OntologyReader.h"
#include "ontologenius/core/ontoGraphs/Graphs/ClassGraph.h"
diff --git a/include/ontologenius/core/reasoner/plugins/ReasonerChain.h b/include/ontologenius/core/reasoner/plugins/ReasonerChain.h
index 27f74a93..23e7cf19 100644
--- a/include/ontologenius/core/reasoner/plugins/ReasonerChain.h
+++ b/include/ontologenius/core/reasoner/plugins/ReasonerChain.h
@@ -219,8 +219,12 @@ class ChainTree
if(node->prev != nullptr)
{
for(size_t i = 0; i < node->prev->nexts.size(); )
+ {
if(node->prev->nexts[i] == node)
node->prev->nexts.erase(node->prev->nexts.begin() + i);
+ else
+ i++;
+ }
}
if(node == begin)
diff --git a/include/ontologenius/core/utility/utility.h b/include/ontologenius/core/utility/utility.h
deleted file mode 100644
index e6e8aa89..00000000
--- a/include/ontologenius/core/utility/utility.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef ONTOLOGENIUS_UTILITY_H
-#define ONTOLOGENIUS_UTILITY_H
-
-#include
-
-#include
-
-#include "ontologenius/REST.h"
-
-namespace ontologenius {
-
-inline int send_request(const std::string& method, const std::string& url, const std::string& body, std::string& response)
-{
- ros::NodeHandle n;
-
- ros::ServiceClient client = n.serviceClient("ontologenius/rest");
-
- ontologenius::REST srv;
- srv.request.method = method;
- srv.request.URL = url;
- srv.request.body = body;
-
- if(!client.call(srv))
- {
- ROS_ERROR("REST client call failed");
- return -1;
- }
- else
- {
- response = srv.response.text;
- return 0;
- }
-}
-
-} // namespace ontologenius
-
-#endif // ONTOLOGENIUS_UTILITY_H
diff --git a/include/ontologenius/graphical/ontoloGUI/ontologui.h b/include/ontologenius/graphical/ontoloGUI/ontologui.h
index 64757d0e..140a357a 100644
--- a/include/ontologenius/graphical/ontoloGUI/ontologui.h
+++ b/include/ontologenius/graphical/ontoloGUI/ontologui.h
@@ -5,12 +5,10 @@
#include "include/ontologenius/graphical/ontoloGUI/QCheckBoxExtended.h"
#include
-#include
+#include "ontologenius/OntologiesManipulator.h"
#include
#include
-#include "std_msgs/String.h"
-
namespace Ui {
class ontoloGUI;
}
@@ -23,17 +21,18 @@ class ontoloGUI : public QMainWindow
explicit ontoloGUI(QWidget *parent = 0);
~ontoloGUI();
- void init(ros::NodeHandle* n);
+ void init();
void wait();
void start();
void loadReasoners();
private:
Ui::ontoloGUI *ui;
- ros::NodeHandle* n_;
- std::map publishers_;
- std::map feeder_notifications_subs_;
+ onto::OntologiesManipulator ontos_;
+ onto::OntologyManipulator* onto_;
+ bool multi_usage_;
+
std::string feeder_notifications_;
std::vector reasoners_names_;
@@ -80,15 +79,17 @@ public slots:
void OntologyNameAddDelChangedSlot(const QString&);
void OntologyNameChangedSlot(const QString&);
- void feederCallback(const std_msgs::String& msg);
+ void feederCallback(const std::string& msg);
void feederAddSlot();
void feederDelSlot();
void feederCommitSlot();
void feederCheckoutSlot();
- void createPublisher(const std::string& onto_ns);
+
+ bool updateOntoPtr();
signals:
void feederSetHtmlSignal(QString);
+ void feederScrollSignal(QString);
};
#endif // ONTOLOGUI_H
diff --git a/include/ontologenius/interface/RosInterface.h b/include/ontologenius/interface/RosInterface.h
index 23fd1f67..d42bbc0a 100644
--- a/include/ontologenius/interface/RosInterface.h
+++ b/include/ontologenius/interface/RosInterface.h
@@ -59,7 +59,7 @@ class RosInterface
void stop();
/// @brief Closes the ontology to make it explorable. This is not mandatory to close it in this way. It is better to let the user do it by himself
- void close();
+ bool close();
/// @brief Tests if the interface is running. By running we meant that the threads and ROS subscribers are alive
/// @return true is the interface is running, false otherwise
diff --git a/include/ontologenius/utils/Commands.h b/include/ontologenius/utils/Commands.h
new file mode 100644
index 00000000..27ff0db0
--- /dev/null
+++ b/include/ontologenius/utils/Commands.h
@@ -0,0 +1,58 @@
+#include
+#include
+#include
+
+#include "ontologenius/utils/String.h"
+
+namespace ontologenius {
+
+std::string execCmd(std::string cmd)
+{
+ char buffer[128];
+ std::string result = "";
+ cmd.append(" 2>&1");
+ FILE* pipe = popen(cmd.c_str(), "r");
+ if (!pipe) throw std::runtime_error("popen() failed!");
+ try
+ {
+ while (fgets(buffer, sizeof buffer, pipe) != NULL)
+ result += buffer;
+ }
+ catch (...)
+ {
+ pclose(pipe);
+ return "";
+ }
+
+ pclose(pipe);
+ if(result.find("not found") != std::string::npos)
+ return "";
+
+ return result;
+}
+
+std::string findPackageRos1(const std::string& pkg_name)
+{
+ std::string results = execCmd("rospack find " + pkg_name);
+ if(results.size())
+ {
+ auto split_res = split(results, "\n");
+ return split_res.front();
+ }
+ else
+ return "";
+}
+
+std::vector listPackagesRos1()
+{
+ std::string results = execCmd("rospack list-names");
+ if(results.size())
+ {
+ auto split_res = split(results, "\n");
+ return split_res;
+ }
+ else
+ return {};
+}
+
+} // namespace ontologenius
\ No newline at end of file
diff --git a/launch/ontologenius.launch b/launch/ontologenius.launch
index 47926414..b2387f2b 100644
--- a/launch/ontologenius.launch
+++ b/launch/ontologenius.launch
@@ -15,5 +15,4 @@
-
diff --git a/launch/ontologenius_empty.launch b/launch/ontologenius_empty.launch
index 16d90202..e920877a 100644
--- a/launch/ontologenius_empty.launch
+++ b/launch/ontologenius_empty.launch
@@ -9,6 +9,5 @@
-
diff --git a/launch/ontologenius_full.launch b/launch/ontologenius_full.launch
index d163d528..5cae154f 100644
--- a/launch/ontologenius_full.launch
+++ b/launch/ontologenius_full.launch
@@ -15,6 +15,5 @@
-
diff --git a/launch/ontologenius_multi.launch b/launch/ontologenius_multi.launch
index d59b444e..2e2da222 100644
--- a/launch/ontologenius_multi.launch
+++ b/launch/ontologenius_multi.launch
@@ -17,5 +17,4 @@
-
diff --git a/launch/ontologenius_multi_empty.launch b/launch/ontologenius_multi_empty.launch
index 1db0e013..1c5b3820 100644
--- a/launch/ontologenius_multi_empty.launch
+++ b/launch/ontologenius_multi_empty.launch
@@ -11,5 +11,4 @@
-
diff --git a/launch/ontologenius_multi_full.launch b/launch/ontologenius_multi_full.launch
index 316f90bb..48580411 100644
--- a/launch/ontologenius_multi_full.launch
+++ b/launch/ontologenius_multi_full.launch
@@ -17,6 +17,5 @@
-
diff --git a/launch/ontologenius_sparql.launch b/launch/ontologenius_sparql.launch
index 9a5972c7..eff71779 100644
--- a/launch/ontologenius_sparql.launch
+++ b/launch/ontologenius_sparql.launch
@@ -13,6 +13,5 @@
-
diff --git a/launch/ontologenius_valgrind.launch b/launch/ontologenius_valgrind.launch
index 87c71630..cb59801a 100644
--- a/launch/ontologenius_valgrind.launch
+++ b/launch/ontologenius_valgrind.launch
@@ -11,5 +11,4 @@
-
diff --git a/ontopy/ontologenius/FeederPublisher.py b/ontopy/ontologenius/FeederPublisher.py
index b44ca9a5..8dce9b78 100644
--- a/ontopy/ontologenius/FeederPublisher.py
+++ b/ontopy/ontologenius/FeederPublisher.py
@@ -135,7 +135,7 @@ def removeLanguage(self, concept_from, lang, name, stamp = None):
"""Removes the label name(str) in the language lang(str) the class, individual, or property concept_from(str).
If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.
"""
- msg = '[add]' + concept_from + '|@' + lang + '|' + name
+ msg = '[del]' + concept_from + '|@' + lang + '|' + name
if stamp == None:
stamp = rospy.get_rostime()
self._publish_stamped(msg, stamp)
diff --git a/ontopy/ontologenius/clients/ActionClient.py b/ontopy/ontologenius/clients/ActionClient.py
index 1f6538ea..bb84c411 100644
--- a/ontopy/ontologenius/clients/ActionClient.py
+++ b/ontopy/ontologenius/clients/ActionClient.py
@@ -22,9 +22,12 @@ def __init__(self, name):
def close(self):
"""Link all the concepts loaded from files and the Internet.
Before closing an ontology, exploration requests are not allowed.
- Returns False if the service call fails.
+ Returns false ontology closure fails or if the service call fails.
"""
- return self.callNR("close", "")
+ if self.callNR("close", "") == False:
+ return False
+ else:
+ return self.error_code == 0
def save(self, path):
"""Saves the current ontology in the absolute path(str) path.
diff --git a/ontopy/ontologenius/clients/ClientBase.py b/ontopy/ontologenius/clients/ClientBase.py
index b4c9b4ca..9c0f4314 100644
--- a/ontopy/ontologenius/clients/ClientBase.py
+++ b/ontopy/ontologenius/clients/ClientBase.py
@@ -14,6 +14,7 @@ class ClientBase:
def __init__(self, name):
"""Constructs a ROS client linked to the service name(str)."""
self._name = name
+ self.error_code = 0
self._client = rospy.ServiceProxy('ontologenius/' + self._name, OntologeniusService, True)
def nb(self):
@@ -38,6 +39,7 @@ def call(self, action, param):
ClientBase._cpt += 1
try:
response = self._client(action, param)
+ self.error_code = response.code
return response.values
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBase._verbose == True:
@@ -45,12 +47,14 @@ def call(self, action, param):
self._client = rospy.ServiceProxy('ontologenius/' + self._name, OntologeniusService, True)
try:
response = self._client(action, param)
+ self.error_code = response.code
if ClientBase._verbose == True:
print("Restored ontologenius/" + self._name)
return response.values
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBase._verbose == True:
print("Failure of service restoration")
+ self.error_code = -1
return None
def callStr(self, action, param):
@@ -61,6 +65,7 @@ def callStr(self, action, param):
ClientBase._cpt += 1
try:
response = self._client(action, param)
+ self.error_code = response.code
if len(response.values) > 0:
return response.values[0]
else:
@@ -71,6 +76,7 @@ def callStr(self, action, param):
self._client = rospy.ServiceProxy('ontologenius/' + self._name, OntologeniusService, True)
try:
response = self._client(action, param)
+ self.error_code = response.code
if ClientBase._verbose == True:
print("Restored ontologenius/" + self._name)
if len(response.values) > 0:
@@ -80,6 +86,7 @@ def callStr(self, action, param):
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBase._verbose == True:
print("Failure of service restoration")
+ self.error_code = -1
return None
def callNR(self, action, param):
@@ -90,6 +97,7 @@ def callNR(self, action, param):
ClientBase._cpt += 1
try:
response = self._client(action, param)
+ self.error_code = response.code
return True
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBase._verbose == True:
@@ -97,12 +105,14 @@ def callNR(self, action, param):
self._client = rospy.ServiceProxy('ontologenius/' + self._name, OntologeniusService, True)
try:
response = self._client(action, param)
+ self.error_code = response.code
if ClientBase._verbose == True:
print("Restored ontologenius/" + self._name)
return True
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBase._verbose == True:
print("Failure of service restoration")
+ self.error_code = -1
return False
def callBool(self, action, param):
@@ -114,6 +124,7 @@ def callBool(self, action, param):
ClientBase._cpt += 1
try:
response = self._client(action, param)
+ self.error_code = response.code
return response.code == 0
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBase._verbose == True:
@@ -123,8 +134,10 @@ def callBool(self, action, param):
response = self._client(action, param)
if ClientBase._verbose == True:
print("Restored ontologenius/" + self._name)
+ self.error_code = response.code
return response.code == 0
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBase._verbose == True:
print("Failure of service restoration")
+ self.error_code = -1
return False
diff --git a/ontopy/ontologenius/clientsIndex/ClientBaseIndex.py b/ontopy/ontologenius/clientsIndex/ClientBaseIndex.py
index 62f12503..24a2c920 100644
--- a/ontopy/ontologenius/clientsIndex/ClientBaseIndex.py
+++ b/ontopy/ontologenius/clientsIndex/ClientBaseIndex.py
@@ -15,6 +15,7 @@ def __init__(self, name):
"""Constructs a ROS client linked to the service name(str)."""
self._name = name
self._client = rospy.ServiceProxy('ontologenius/' + self._name, OntologeniusIndexService, True)
+ self.error_code = 0
def nb(self):
"""Gives the total number (int) of service calls from all ClientBaseIndex instances since the last reset."""
@@ -38,6 +39,7 @@ def call(self, action, param):
ClientBaseIndex._cpt += 1
try:
response = self._client(action, param)
+ self.error_code = response.code
return response.string_values
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBaseIndex._verbose == True:
@@ -45,12 +47,14 @@ def call(self, action, param):
self._client = rospy.ServiceProxy('ontologenius/' + self._name, OntologeniusIndexService, True)
try:
response = self._client(action, param)
+ self.error_code = response.code
if ClientBaseIndex._verbose == True:
print("Restored ontologenius/" + self._name)
return response.string_values
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBaseIndex._verbose == True:
print("Failure of service restoration")
+ self.error_code = -1
return None
def callIndexes(self, action, param):
@@ -61,6 +65,7 @@ def callIndexes(self, action, param):
ClientBaseIndex._cpt += 1
try:
response = self._client(action, param)
+ self.error_code = response.code
return response.index_values
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBaseIndex._verbose == True:
@@ -68,12 +73,14 @@ def callIndexes(self, action, param):
self._client = rospy.ServiceProxy('ontologenius/' + self._name, OntologeniusIndexService, True)
try:
response = self._client(action, param)
+ self.error_code = response.code
if ClientBaseIndex._verbose == True:
print("Restored ontologenius/" + self._name)
return response.index_values
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBaseIndex._verbose == True:
print("Failure of service restoration")
+ self.error_code = -1
return None
def callStr(self, action, param):
@@ -84,6 +91,7 @@ def callStr(self, action, param):
ClientBaseIndex._cpt += 1
try:
response = self._client(action, param)
+ self.error_code = response.code
if len(response.string_values) > 0:
return response.string_values[0]
else:
@@ -94,6 +102,7 @@ def callStr(self, action, param):
self._client = rospy.ServiceProxy('ontologenius/' + self._name, OntologeniusIndexService, True)
try:
response = self._client(action, param)
+ self.error_code = response.code
if ClientBaseIndex._verbose == True:
print("Restored ontologenius/" + self._name)
if len(response.string_values) > 0:
@@ -103,6 +112,7 @@ def callStr(self, action, param):
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBaseIndex._verbose == True:
print("Failure of service restoration")
+ self.error_code = -1
return None
def callIndex(self, action, param):
@@ -113,6 +123,7 @@ def callIndex(self, action, param):
ClientBaseIndex._cpt += 1
try:
response = self._client(action, param)
+ self.error_code = response.code
if len(response.index_values) > 0:
return response.index_values[0]
else:
@@ -123,6 +134,7 @@ def callIndex(self, action, param):
self._client = rospy.ServiceProxy('ontologenius/' + self._name, OntologeniusIndexService, True)
try:
response = self._client(action, param)
+ self.error_code = response.code
if ClientBaseIndex._verbose == True:
print("Restored ontologenius/" + self._name)
if len(response.index_values) > 0:
@@ -132,6 +144,7 @@ def callIndex(self, action, param):
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBaseIndex._verbose == True:
print("Failure of service restoration")
+ self.error_code = -1
return None
def callNR(self, action, param):
@@ -142,6 +155,7 @@ def callNR(self, action, param):
ClientBaseIndex._cpt += 1
try:
response = self._client(action, param)
+ self.error_code = response.code
return True
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBaseIndex._verbose == True:
@@ -149,12 +163,14 @@ def callNR(self, action, param):
self._client = rospy.ServiceProxy('ontologenius/' + self._name, OntologeniusIndexService, True)
try:
response = self._client(action, param)
+ self.error_code = response.code
if ClientBaseIndex._verbose == True:
print("Restored ontologenius/" + self._name)
return True
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBaseIndex._verbose == True:
print("Failure of service restoration")
+ self.error_code = -1
return False
def callBool(self, action, param):
@@ -166,6 +182,7 @@ def callBool(self, action, param):
ClientBaseIndex._cpt += 1
try:
response = self._client(action, param)
+ self.error_code = response.code
return response.code == 0
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBaseIndex._verbose == True:
@@ -175,8 +192,10 @@ def callBool(self, action, param):
response = self._client(action, param)
if ClientBaseIndex._verbose == True:
print("Restored ontologenius/" + self._name)
+ self.error_code = response.code
return response.code == 0
except (rospy.ServiceException, rospy.exceptions.TransportTerminated) as e:
if ClientBaseIndex._verbose == True:
print("Failure of service restoration")
+ self.error_code = -1
return False
diff --git a/package.xml b/package.xml
index 04b087ad..798a0d1e 100644
--- a/package.xml
+++ b/package.xml
@@ -1,7 +1,7 @@
ontologenius
- 0.3.1
+ 0.3.2
The ontologenius package
srth
diff --git a/scripts/REST.py b/scripts/REST.py
deleted file mode 100755
index aef27717..00000000
--- a/scripts/REST.py
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/env python
-
-import rospy
-import requests
-
-from ontologenius.srv import REST
-import std_msgs.msg
-from ontologenius.msg import HTTP_headers
-
-
-def get_resource(url, headers):
- """
- Gets a resource at the given URL
- :param url: URL of the resource to get
- :return: (string) Body of the HTTP response
- """
- try:
- response = None
- response_code = None
- rospy.loginfo("[REST.get_resource()] GET " + url)
-
- req = requests.get(url, timeout=20)
-
- if req.status_code != requests.codes.ok:
- req.raise_for_status()
- if req.status_code == requests.codes.ok:
- response = req.text
-
- response_code = req.status_code
- return response_code, response
-
- except requests.exceptions.ConnectionError as err:
- rospy.logwarn("[REST.get_resource()] Connection error (network problem): " + str(err))
- except requests.exceptions.Timeout as err:
- rospy.logwarn("[REST.get_resource()] Timeout error: " + str(err))
- except requests.exceptions.HTTPError as err:
- rospy.logwarn("[REST.get_resource()] HTTP error: " + str(err))
- except requests.exceptions.RequestException as err:
- rospy.logwarn("[REST.get_resource()] Request error: " + str(err))
-
- return response_code, ""
-
-
-def delete_resource(url, headers):
- """
- Removes a resource at the given URL
- :param url: URL of the resource to remove
- :return: None
- """
- try:
- response_code = None
- rospy.loginfo("[REST.delete_resource()] DELETE " + url)
-
- req = requests.delete(url, headers=headers, timeout=8)
-
- if req.status_code != requests.codes.ok:
- req.raise_for_status()
-
- response_code = req.status_code
- return response_code, None
-
- except requests.exceptions.ConnectionError as err:
- rospy.logwarn("[REST.delete_resource()] Connection error (network problem): " + str(err))
- except requests.exceptions.Timeout as err:
- rospy.logwarn("[REST.delete_resource()] Timeout error: " + str(err))
- except requests.exceptions.HTTPError as err:
- rospy.logwarn("[REST.delete_resource()] HTTP error: " + str(err))
- except requests.exceptions.RequestException as err:
- rospy.logwarn("[REST.delete_resource()] Request error: " + str(err))
-
-
-def post_resource(url, headers, payload=None):
- """
- :param url: The URL where to put the new resource
- :param headers: The header of the POST request
- :param payload: The payload of the request
- :return: (int, string) Response code of the HTTP request, Response body
- """
- response_code = None
- response = None
- try:
-
- rospy.loginfo("[REST.post_resource()] POST " + url)
- if payload is not None:
- req = requests.post(url, headers=headers, data=payload, timeout=8)
- else:
- req = requests.post(url, headers=headers, timeout=8)
- if not (req.status_code == requests.codes.created or req.status_code == requests.codes.ok):
- req.raise_for_status()
- rospy.logwarn(str(req.status_code))
- else:
- response_code = req.status_code
- response = req.text
-
- except requests.exceptions.ConnectionError as err:
- rospy.logwarn("[REST.post_resource()] Connection error (network problem): " + str(err))
- except requests.exceptions.Timeout as err:
- rospy.logwarn("[REST.post_resource()] Timeout error: " + str(err))
- except requests.exceptions.HTTPError as err:
- rospy.logwarn("[REST.post_resource()] HTTP error: " + str(err))
- except requests.exceptions.RequestException as err:
- rospy.logwarn("[REST.post_resource()] Request error: " + str(err))
-
- return response_code, response
-
-def put_in_resource(url, header, payload=None):
- """
- Put a payload in the resource at the given URL
- :param url: URL of the resource to modify
- :param payload: The content we put in resource
- :return: None
- """
- try:
- rospy.loginfo("[REST.put_in_resource()] PUT " + payload + " in " + url)
- req = requests.put(url, data=payload, headers=header, timeout=8)
- if req.status_code != requests.codes.ok:
- req.raise_for_status()
- else:
- response_code = req.status_code
-
- except requests.exceptions.ConnectionError as err:
- rospy.logwarn("[REST.put_in_resource()] Connection error (network problem): " + str(err))
- except requests.exceptions.Timeout as err:
- rospy.logwarn("[REST.put_in_resource()] Timeout error: " + str(err))
- except requests.exceptions.HTTPError as err:
- rospy.logwarn("[REST.put_in_resource()] HTTP error: " + str(err))
- except requests.exceptions.RequestException as err:
- rospy.logwarn("[REST.put_in_resource()] Request error: " + str(err))
-
- return response_code, ""
-
-def handle_http(req):
- """
- Generic interface for http request
- :param req:
- :return: (int, string) Response code of the HTTP request, Response body
- """
- response = None
- response_code = None
- URL = req.URL
- names = req.headers.names.split(' ')
- values = req.headers.values.split(' ')
- headers = {}
- i = 0
-
- while i < len(names):
- headers.update({names[i]: values[i]})
- i = i + 1
-
- if req.method == "GET":
- response_code, response = get_resource(URL, headers)
- elif req.method == "DELETE":
- response_code, response = delete_resource(URL, headers)
- elif req.method == "POST":
- response_code, response = post_resource(URL, headers, req.body)
- elif req.method == "PUT":
- response_code, response = put_in_resource(URL, headers, req.body)
-
- if response_code != requests.codes.ok:
- return( None, -1)
- if response_code == requests.codes.ok:
- return(response, 0)
-
-def http_resquest():
- rospy.init_node('ontologenius_rest', anonymous=True)
-
- rospy.Service('ontologenius/rest', REST, handle_http)
- print("[ INFO] ready to make http request")
- rospy.spin()
-
-if __name__ == "__main__":
- http_resquest()
diff --git a/src/API/ontologenius/ConversionClient.cpp b/src/API/ontologenius/ConversionClient.cpp
index d88c44f5..bf3a2e97 100644
--- a/src/API/ontologenius/ConversionClient.cpp
+++ b/src/API/ontologenius/ConversionClient.cpp
@@ -15,9 +15,9 @@
namespace onto {
-ConversionClient::ConversionClient(ros::NodeHandle* n, const std::string& name) : name_((name == "") ? "/ontologenius/conversion" : "/ontologenius/conversion/" + name),
- n_(n), verbose_(false),
- client_(n->serviceClient(name_, true))
+ConversionClient::ConversionClient(const std::string& name) : name_((name == "") ? "/ontologenius/conversion" : "/ontologenius/conversion/" + name),
+ verbose_(false),
+ client_(n_.serviceClient(name_, true))
{}
std::vector ConversionClient::individualsIndex2Id(const std::vector& indexes)
@@ -172,7 +172,7 @@ bool ConversionClient::call(ontologenius::OntologeniusConversion& srv)
{
if(verbose_)
std::cout << COLOR_ORANGE << "Failure to call " << name_ << COLOR_OFF << std::endl;
- client_ = n_->serviceClient(name_, true);
+ client_ = n_.serviceClient(name_, true);
if(client_.call(srv))
{
if(verbose_)
diff --git a/src/API/ontologenius/OntologiesManipulator.cpp b/src/API/ontologenius/OntologiesManipulator.cpp
index e446147b..0f9cad7f 100644
--- a/src/API/ontologenius/OntologiesManipulator.cpp
+++ b/src/API/ontologenius/OntologiesManipulator.cpp
@@ -2,11 +2,14 @@
namespace onto {
-OntologiesManipulator::OntologiesManipulator(ros::NodeHandle* n) : ManagerClient(n)
+OntologiesManipulator::OntologiesManipulator(ros::NodeHandle* n) : ManagerClient()
{
- n_ = n;
+ (void)n;
}
+OntologiesManipulator::OntologiesManipulator() : ManagerClient()
+{}
+
OntologiesManipulator::~OntologiesManipulator()
{
for(auto& manipulator : manipulators_)
@@ -18,9 +21,9 @@ OntologiesManipulator::~OntologiesManipulator()
delete manipulator.second;
}
-void OntologiesManipulator::waitInit(int32_t timeout)
+bool OntologiesManipulator::waitInit(int32_t timeout)
{
- ros::service::waitForService("ontologenius/manage", timeout);
+ return ros::service::waitForService("ontologenius/manage", timeout);
}
OntologyManipulator* OntologiesManipulator::operator[](const std::string& name)
diff --git a/src/API/ontologenius/OntologyManipulator.cpp b/src/API/ontologenius/OntologyManipulator.cpp
index 539dcc24..f3a2da88 100644
--- a/src/API/ontologenius/OntologyManipulator.cpp
+++ b/src/API/ontologenius/OntologyManipulator.cpp
@@ -4,14 +4,14 @@
namespace onto {
OntologyManipulator::OntologyManipulator(ros::NodeHandle* n, const std::string& name) : name_(name),
- individuals(&n_, name),
- objectProperties(&n_, name),
- dataProperties(&n_, name),
- classes(&n_, name),
- actions(&n_, name),
- reasoners(&n_, name),
- feeder(&n_, name),
- sparql(&n_, name)
+ individuals(name),
+ objectProperties(name),
+ dataProperties(name),
+ classes(name),
+ actions(name),
+ reasoners(name),
+ feeder(name),
+ sparql(name)
{
(void)n;
ontologenius::Display::warning("OntologyManipulator(ros::NodeHandle* n, const std::string& name) is deprecated. Use OntologyManipulator(const std::string& name) instead.");
@@ -21,42 +21,42 @@ OntologyManipulator::OntologyManipulator(ros::NodeHandle* n, const std::string&
}
OntologyManipulator::OntologyManipulator(const std::string& name) : name_(name),
- individuals(&n_, name),
- objectProperties(&n_, name),
- dataProperties(&n_, name),
- classes(&n_, name),
- actions(&n_, name),
- reasoners(&n_, name),
- feeder(&n_, name),
- sparql(&n_, name)
+ individuals(name),
+ objectProperties(name),
+ dataProperties(name),
+ classes(name),
+ actions(name),
+ reasoners(name),
+ feeder(name),
+ sparql(name)
{
std::string service_name = (name == "") ? "ontologenius/sparql" : "ontologenius/sparql/" + name;
ros::service::waitForService(service_name);
}
OntologyManipulator::OntologyManipulator(const OntologyManipulator& other): name_(other.name_),
- individuals(&n_, other.name_),
- objectProperties(&n_, other.name_),
- dataProperties(&n_, other.name_),
- classes(&n_, other.name_),
- actions(&n_, other.name_),
- reasoners(&n_, other.name_),
- feeder(&n_, other.name_),
- sparql(&n_, other.name_)
+ individuals(other.name_),
+ objectProperties(other.name_),
+ dataProperties(other.name_),
+ classes(other.name_),
+ actions(other.name_),
+ reasoners(other.name_),
+ feeder(other.name_),
+ sparql(other.name_)
{
std::string service_name = (name_ == "") ? "ontologenius/sparql" : "ontologenius/sparql/" + name_;
ros::service::waitForService(service_name);
}
OntologyManipulator::OntologyManipulator(OntologyManipulator&& other): name_(other.name_),
- individuals(&n_, other.name_),
- objectProperties(&n_, other.name_),
- dataProperties(&n_, other.name_),
- classes(&n_, other.name_),
- actions(&n_, other.name_),
- reasoners(&n_, other.name_),
- feeder(&n_, other.name_),
- sparql(&n_, other.name_)
+ individuals(other.name_),
+ objectProperties(other.name_),
+ dataProperties(other.name_),
+ classes(other.name_),
+ actions(other.name_),
+ reasoners(other.name_),
+ feeder(other.name_),
+ sparql(other.name_)
{
std::string service_name = (name_ == "") ? "ontologenius/sparql" : "ontologenius/sparql/" + name_;
ros::service::waitForService(service_name);
diff --git a/src/API/ontologenius/OntologyManipulatorIndex.cpp b/src/API/ontologenius/OntologyManipulatorIndex.cpp
index c279d1ff..d89c3962 100644
--- a/src/API/ontologenius/OntologyManipulatorIndex.cpp
+++ b/src/API/ontologenius/OntologyManipulatorIndex.cpp
@@ -4,45 +4,45 @@
namespace onto {
OntologyManipulatorIndex::OntologyManipulatorIndex(const std::string& name) : name_(name),
- individuals(&n_, name),
- objectProperties(&n_, name),
- dataProperties(&n_, name),
- classes(&n_, name),
- actions(&n_, name),
- reasoners(&n_, name),
- feeder(&n_, name),
- sparql(&n_, name),
- conversion(&n_, name)
+ individuals(name),
+ objectProperties(name),
+ dataProperties(name),
+ classes(name),
+ actions(name),
+ reasoners(name),
+ feeder(name),
+ sparql(name),
+ conversion(name)
{
std::string service_name = (name == "") ? "ontologenius/conversion" : "ontologenius/conversion/" + name;
ros::service::waitForService(service_name);
}
OntologyManipulatorIndex::OntologyManipulatorIndex(const OntologyManipulatorIndex& other): name_(other.name_),
- individuals(&n_, other.name_),
- objectProperties(&n_, other.name_),
- dataProperties(&n_, other.name_),
- classes(&n_, other.name_),
- actions(&n_, other.name_),
- reasoners(&n_, other.name_),
- feeder(&n_, other.name_),
- sparql(&n_, other.name_),
- conversion(&n_, other.name_)
+ individuals(other.name_),
+ objectProperties(other.name_),
+ dataProperties(other.name_),
+ classes(other.name_),
+ actions(other.name_),
+ reasoners(other.name_),
+ feeder(other.name_),
+ sparql(other.name_),
+ conversion(other.name_)
{
std::string service_name = (name_ == "") ? "ontologenius/conversion" : "ontologenius/conversion/" + name_;
ros::service::waitForService(service_name);
}
OntologyManipulatorIndex::OntologyManipulatorIndex(OntologyManipulatorIndex&& other): name_(other.name_),
- individuals(&n_, other.name_),
- objectProperties(&n_, other.name_),
- dataProperties(&n_, other.name_),
- classes(&n_, other.name_),
- actions(&n_, other.name_),
- reasoners(&n_, other.name_),
- feeder(&n_, other.name_),
- sparql(&n_, other.name_),
- conversion(&n_, other.name_)
+ individuals(other.name_),
+ objectProperties(other.name_),
+ dataProperties(other.name_),
+ classes(other.name_),
+ actions(other.name_),
+ reasoners(other.name_),
+ feeder(other.name_),
+ sparql(other.name_),
+ conversion(other.name_)
{
std::string service_name = (name_ == "") ? "ontologenius/conversion" : "ontologenius/conversion/" + name_;
ros::service::waitForService(service_name);
diff --git a/src/API/ontologenius/clients/ActionClient.cpp b/src/API/ontologenius/clients/ActionClient.cpp
index 879cc4b4..993bc391 100644
--- a/src/API/ontologenius/clients/ActionClient.cpp
+++ b/src/API/ontologenius/clients/ActionClient.cpp
@@ -4,71 +4,45 @@ namespace onto {
bool ActionClient::close()
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "close";
-
- return callNR(srv);
+ if(callNR("close", "") == false)
+ return false;
+ else
+ return (getErrorCode() == 0);
}
bool ActionClient::save(const std::string& path)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "save";
- srv.request.param = path;
-
- return callNR(srv);
+ return callNR("save", path);
}
bool ActionClient::exportToXml(const std::string& path)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "export";
- srv.request.param = path;
-
- return callNR(srv);
+ return callNR("export", path);
}
bool ActionClient::setLang(const std::string& lang)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "setLang";
- srv.request.param = lang;
-
- return callNR(srv);
+ return callNR("setLang", lang);
}
std::string ActionClient::getLang()
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getLang";
-
- return callStr(srv);
+ return callStr("getLang", "");
}
bool ActionClient::add(const std::string& uri)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "add";
- srv.request.param = uri;
-
- return callNR(srv);
+ return callNR("add", uri);
}
bool ActionClient::fadd(const std::string& file)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "fadd";
- srv.request.param = file;
-
- return callNR(srv);
+ return callNR("fadd", file);
}
bool ActionClient::reset()
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "reset";
-
- return callNR(srv);
+ return callNR("reset", "");
}
} // namespace onto
\ No newline at end of file
diff --git a/src/API/ontologenius/clients/ManagerClient.cpp b/src/API/ontologenius/clients/ManagerClient.cpp
index ad7ae941..fd9fc077 100644
--- a/src/API/ontologenius/clients/ManagerClient.cpp
+++ b/src/API/ontologenius/clients/ManagerClient.cpp
@@ -4,46 +4,28 @@ namespace onto {
std::vector ManagerClient::list()
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "list";
-
- return call(srv);
+ return call("list", "");
}
bool ManagerClient::add(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "add";
- srv.request.param = name;
-
- return callNR(srv);
+ return callNR("add", name);
}
bool ManagerClient::copy(const std::string& dest_name, const std::string& src_name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "copy";
- srv.request.param = dest_name + "=" + src_name;
-
- return callBool(srv);
+ return callBool("copy", dest_name + "=" + src_name);
}
bool ManagerClient::del(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "delete";
- srv.request.param = name;
-
- return callNR(srv);
+ return callNR("delete", name);
}
std::vector ManagerClient::getDifference(const std::string& onto1, const std::string& onto2, const std::string& concept)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "difference";
- srv.request.param = onto1 + "|" + onto2 + "|" + concept;
-
- return call(srv);
+ std::string param = onto1 + "|" + onto2 + "|" + concept;
+ return call("difference", param);
}
} // namespace onto
\ No newline at end of file
diff --git a/src/API/ontologenius/clients/ReasonerClient.cpp b/src/API/ontologenius/clients/ReasonerClient.cpp
index 985d377f..53369f95 100644
--- a/src/API/ontologenius/clients/ReasonerClient.cpp
+++ b/src/API/ontologenius/clients/ReasonerClient.cpp
@@ -4,45 +4,27 @@ namespace onto {
std::vector ReasonerClient::list()
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "list";
-
- return call(srv);
+ return call("list", "");
}
std::vector ReasonerClient::activeList()
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "activeList";
-
- return call(srv);
+ return call("activeList", "");
}
bool ReasonerClient::activate(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "activate";
- srv.request.param = name;
-
- return callNR(srv);
+ return callNR("activate", name);
}
bool ReasonerClient::deactivate(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "deactivate";
- srv.request.param = name;
-
- return callNR(srv);
+ return callNR("deactivate", name);
}
std::string ReasonerClient::getDescription(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDescription";
- srv.request.param = name;
-
- return callStr(srv);
+ return callStr("getDescription", name);
}
} // namespace onto
\ No newline at end of file
diff --git a/src/API/ontologenius/clients/SparqlClient.cpp b/src/API/ontologenius/clients/SparqlClient.cpp
index 9e7cf5ab..ea280b65 100644
--- a/src/API/ontologenius/clients/SparqlClient.cpp
+++ b/src/API/ontologenius/clients/SparqlClient.cpp
@@ -11,7 +11,7 @@ std::pair, std::vectorserviceClient("ontologenius/" + name_, true);
+ client = n_.serviceClient("ontologenius/" + name_, true);
if(client.call(srv))
return {srv.response.names, srv.response.results};
else
diff --git a/src/API/ontologenius/clients/ontologyClients/ClassClient.cpp b/src/API/ontologenius/clients/ontologyClients/ClassClient.cpp
index 09fdf73a..071bc002 100644
--- a/src/API/ontologenius/clients/ontologyClients/ClassClient.cpp
+++ b/src/API/ontologenius/clients/ontologyClients/ClassClient.cpp
@@ -4,151 +4,115 @@ namespace onto {
std::vector ClassClient::getDown(const std::string& name, int depth, const std::string& selector)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDown";
- srv.request.param = name;
-
+ std::string param = name;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
- return call(srv);
+ return call("getDown", param);
}
std::vector ClassClient::getDisjoint(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDisjoint";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getDisjoint", param);
}
std::vector ClassClient::getOn(const std::string& name, const std::string& property, const std::string& selector)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getOn";
- srv.request.param = name + ":" + property;
+ std::string param = name + ":" + property;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
- return call(srv);
+ return call("getOn", param);
}
std::vector ClassClient::getFrom(const std::string& property, const std::string& name, const std::string& selector)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getFrom";
- srv.request.param = name + ":" + property;
+ std::string param = name + ":" + property;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
- return call(srv);
+ return call("getFrom", param);
}
std::vector ClassClient::getWith(const std::string& indiv_1, const std::string& indiv_2, const std::string& selector, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getWith";
- srv.request.param = indiv_1 + ":" + indiv_2;
+ std::string param = indiv_1 + ":" + indiv_2;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getWith", param);
}
std::vector ClassClient::getRelatedFrom(const std::string& property)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelatedFrom";
- srv.request.param = property;
-
- return call(srv);
+ std::string param = property;
+ return call("getRelatedFrom", param);
}
std::vector ClassClient::getRelatedOn(const std::string& property)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelatedOn";
- srv.request.param = property;
-
- return call(srv);
+ std::string param = property;
+ return call("getRelatedOn", param);
}
std::vector ClassClient::getRelatedWith(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelatedWith";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getRelatedWith", param);
}
std::vector ClassClient::getRelationFrom(const std::string& name, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelationFrom";
- srv.request.param = name;
-
+ std::string param = name;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getRelationFrom", param);
}
std::vector ClassClient::getRelationOn(const std::string& name, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelationOn";
- srv.request.param = name;
-
+ std::string param = name;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getRelationOn", param);
}
std::vector ClassClient::getRelationWith(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelationWith";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getRelationWith", param);
}
std::vector ClassClient::getDomainOf(const std::string& name, const std::string& selector, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDomainOf";
- srv.request.param = name;
-
+ std::string param = name;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getDomainOf", param);
}
std::vector ClassClient::getRangeOf(const std::string& name, const std::string& selector, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRangeOf";
- srv.request.param = name;
-
+ std::string param = name;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getRangeOf", param);
}
} // namespace onto
\ No newline at end of file
diff --git a/src/API/ontologenius/clients/ontologyClients/DataPropertyClient.cpp b/src/API/ontologenius/clients/ontologyClients/DataPropertyClient.cpp
index 3c0b02c2..6466bf78 100644
--- a/src/API/ontologenius/clients/ontologyClients/DataPropertyClient.cpp
+++ b/src/API/ontologenius/clients/ontologyClients/DataPropertyClient.cpp
@@ -4,41 +4,29 @@ namespace onto {
std::vector DataPropertyClient::getDown(const std::string& name, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDown";
- srv.request.param = name;
-
+ std::string param = name;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getDown", param);
}
std::vector DataPropertyClient::getDisjoint(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDisjoint";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getDisjoint", param);
}
std::vector DataPropertyClient::getDomain(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDomain";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getDomain", param);
}
std::vector DataPropertyClient::getRange(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRange";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getRange", param);
}
} // namespace onto
\ No newline at end of file
diff --git a/src/API/ontologenius/clients/ontologyClients/IndividualClient.cpp b/src/API/ontologenius/clients/ontologyClients/IndividualClient.cpp
index 11880416..67d5b485 100644
--- a/src/API/ontologenius/clients/ontologyClients/IndividualClient.cpp
+++ b/src/API/ontologenius/clients/ontologyClients/IndividualClient.cpp
@@ -4,155 +4,116 @@ namespace onto {
std::vector IndividualClient::getOn(const std::string& name, const std::string& property, const std::string& selector)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getOn";
- srv.request.param = name + ":" + property;
+ std::string param = name + ":" + property;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
- return call(srv);
+ return call("getOn", param);
}
std::vector IndividualClient::getFrom(const std::string& property, const std::string& name, const std::string& selector)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getFrom";
- srv.request.param = name + ":" + property;
+ std::string param = name + ":" + property;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
- return call(srv);
+ return call("getFrom", param);
}
std::vector IndividualClient::getWith(const std::string& indiv_from, const std::string& indiv_to, const std::string& selector, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getWith";
- srv.request.param = indiv_from + ":" + indiv_to;
+ std::string param = indiv_from + ":" + indiv_to;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getWith", param);
}
std::vector IndividualClient::getRelatedFrom(const std::string& property)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelatedFrom";
- srv.request.param = property;
-
- return call(srv);
+ std::string param = property;
+ return call("getRelatedFrom", param);
}
std::vector IndividualClient::getRelatedOn(const std::string& property)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelatedOn";
- srv.request.param = property;
-
- return call(srv);
+ std::string param = property;
+ return call("getRelatedOn", param);
}
std::vector IndividualClient::getRelatedWith(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelatedWith";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getRelatedWith", param);
}
std::vector IndividualClient::getRelationFrom(const std::string& name, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelationFrom";
- srv.request.param = name;
-
+ std::string param = name;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getRelationFrom", param);
}
std::vector IndividualClient::getRelationOn(const std::string& name, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelationOn";
- srv.request.param = name;
-
+ std::string param = name;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getRelationOn", param);
}
std::vector IndividualClient::getRelationWith(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRelationWith";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getRelationWith", param);
}
std::vector IndividualClient::getDomainOf(const std::string& name, const std::string& selector, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDomainOf";
- srv.request.param = name;
-
+ std::string param = name;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getDomainOf", param);
}
std::vector IndividualClient::getRangeOf(const std::string& name, const std::string& selector, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRangeOf";
- srv.request.param = name;
-
+ std::string param = name;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getRangeOf", param);
}
std::vector IndividualClient::getType(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getType";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getType", param);
}
std::vector IndividualClient::getSame(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getSame";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getSame", param);
}
std::vector IndividualClient::getDistincts(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDistincts";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getDistincts", param);
}
} // namespace onto
\ No newline at end of file
diff --git a/src/API/ontologenius/clients/ontologyClients/ObjectPropertyClient.cpp b/src/API/ontologenius/clients/ontologyClients/ObjectPropertyClient.cpp
index 96b9f71c..5af6dd7e 100644
--- a/src/API/ontologenius/clients/ontologyClients/ObjectPropertyClient.cpp
+++ b/src/API/ontologenius/clients/ontologyClients/ObjectPropertyClient.cpp
@@ -4,50 +4,35 @@ namespace onto {
std::vector ObjectPropertyClient::getDown(const std::string& name, int depth)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDown";
- srv.request.param = name;
-
+ std::string param = name;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getDown", param);
}
std::vector ObjectPropertyClient::getDisjoint(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDisjoint";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getDisjoint", param);
}
std::vector ObjectPropertyClient::getDomain(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getDomain";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getDomain", param);
}
std::vector ObjectPropertyClient::getRange(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getRange";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getRange", param);
}
std::vector ObjectPropertyClient::getInverse(const std::string& name)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getInverse";
- srv.request.param = name;
-
- return call(srv);
+ std::string param = name;
+ return call("getInverse", param);
}
} // namespace onto
\ No newline at end of file
diff --git a/src/API/ontologenius/clients/ontologyClients/OntologyClient.cpp b/src/API/ontologenius/clients/ontologyClients/OntologyClient.cpp
index 74685179..42d0a45e 100644
--- a/src/API/ontologenius/clients/ontologyClients/OntologyClient.cpp
+++ b/src/API/ontologenius/clients/ontologyClients/OntologyClient.cpp
@@ -4,16 +4,14 @@ namespace onto {
std::vector OntologyClient::getUp(const std::string& name, int depth, const std::string& selector)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getUp";
- srv.request.param = name;
+ std::string param = name;
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return call(srv);
+ return call("getUp", param);
}
bool OntologyClient::isA(const std::string& name, const std::string& base_class)
@@ -27,101 +25,79 @@ bool OntologyClient::isA(const std::string& name, const std::string& base_class)
std::string OntologyClient::getName(const std::string& name, bool take_id)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getName";
- srv.request.param = name;
+ std::string param = name;
if(take_id == false)
- srv.request.param += " -i false";
+ param += " -i false";
- return callStr(srv);
+ return callStr("getName", param);
}
std::vector OntologyClient::getNames(const std::string& name, bool take_id)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getNames";
- srv.request.param = name;
+ std::string param = name;
if(take_id == false)
- srv.request.param += " -i false";
+ param += " -i false";
- return call(srv);
+ return call("getNames", param);
}
std::vector OntologyClient::getEveryNames(const std::string& name, bool take_id)
{
- ontologenius::OntologeniusService srv;
- srv.request.action = "getEveryNames";
- srv.request.param = name;
+ std::string param = name;
if(take_id == false)
- srv.request.param += " -i false";
+ param += " -i false";
- return call(srv);
+ return call("getEveryNames", param);
}
std::vector OntologyClient::find(const std::string& name, bool take_id, const std::string& selector)
{
- ontologenius::OntologeniusService srv;
-
- srv.request.action = "find";
- srv.request.param = name;
+ std::string param = name;
if(take_id == false)
- srv.request.param += " -i false";
+ param += " -i false";
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
- return call(srv);
+ return call("find", param);
}
std::vector OntologyClient::findSub(const std::string& name, bool take_id, const std::string& selector)
{
- ontologenius::OntologeniusService srv;
-
- srv.request.action = "findSub";
- srv.request.param = name;
+ std::string param = name;
if(take_id == false)
- srv.request.param += " -i false";
+ param += " -i false";
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
- return call(srv);
+ return call("findSub", param);
}
std::vector OntologyClient::findRegex(const std::string& regex, bool take_id, const std::string& selector)
{
- ontologenius::OntologeniusService srv;
-
- srv.request.action = "findRegex";
- srv.request.param = regex;
+ std::string param = regex;
if(take_id == false)
- srv.request.param += " -i false";
+ param += " -i false";
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
- return call(srv);
+ return call("findRegex", param);
}
std::vector OntologyClient::findFuzzy(const std::string& name, double threshold, bool take_id, const std::string& selector)
{
- ontologenius::OntologeniusService srv;
-
- srv.request.action = "findFuzzy";
- srv.request.param = name + " -t " + std::to_string(threshold);
+ std::string param = name + " -t " + std::to_string(threshold);
if(take_id == false)
- srv.request.param += " -i false";
+ param += " -i false";
if(selector != "")
- srv.request.param += " -s " + selector;
+ param += " -s " + selector;
- return call(srv);
+ return call("findFuzzy", param);
}
bool OntologyClient::exist(const std::string& name)
{
- ontologenius::OntologeniusService srv;
-
- srv.request.action = "exist";
- srv.request.param = name;
-
- return (callStr(srv) != "");
+ std::string param = name;
+ return (callStr("exist", param) != "");
}
} // namespace onto
\ No newline at end of file
diff --git a/src/API/ontologenius/clientsIndex/SparqlIndexClient.cpp b/src/API/ontologenius/clientsIndex/SparqlIndexClient.cpp
index 64ada339..2bc18996 100644
--- a/src/API/ontologenius/clientsIndex/SparqlIndexClient.cpp
+++ b/src/API/ontologenius/clientsIndex/SparqlIndexClient.cpp
@@ -11,7 +11,7 @@ std::pair, std::vectorserviceClient("ontologenius/" + name_, true);
+ client = n_.serviceClient("ontologenius/" + name_, true);
if(client.call(srv))
return {srv.response.names, srv.response.results};
else
diff --git a/src/API/ontologenius/clientsIndex/ontologyClients/ClassIndexClient.cpp b/src/API/ontologenius/clientsIndex/ontologyClients/ClassIndexClient.cpp
index b211d6a5..55a7c4df 100644
--- a/src/API/ontologenius/clientsIndex/ontologyClients/ClassIndexClient.cpp
+++ b/src/API/ontologenius/clientsIndex/ontologyClients/ClassIndexClient.cpp
@@ -4,151 +4,115 @@ namespace onto {
std::vector ClassIndexClient::getDown(int64_t index, int depth, int64_t selector)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDown";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
- return callIndexes(srv);
+ return callIndexes("getDown", param);
}
std::vector ClassIndexClient::getDisjoint(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDisjoint";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getDisjoint", param);
}
std::vector ClassIndexClient::getOn(int64_t index, int64_t property, int64_t selector)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getOn";
- srv.request.param = std::to_string(index) + ":" + std::to_string(property);
+ std::string param = std::to_string(index) + ":" + std::to_string(property);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
- return callIndexes(srv);
+ return callIndexes("getOn", param);
}
std::vector ClassIndexClient::getFrom(int64_t property, int64_t index, int64_t selector)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getFrom";
- srv.request.param = std::to_string(index) + ":" + std::to_string(property);
+ std::string param = std::to_string(index) + ":" + std::to_string(property);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
- return callIndexes(srv);
+ return callIndexes("getFrom", param);
}
std::vector ClassIndexClient::getWith(int64_t indiv_1, int64_t indiv_2, int64_t selector, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getWith";
- srv.request.param = std::to_string(indiv_1) + ":" + std::to_string(indiv_2);
+ std::string param = std::to_string(indiv_1) + ":" + std::to_string(indiv_2);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getWith", param);
}
std::vector ClassIndexClient::getRelatedFrom(int64_t property)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelatedFrom";
- srv.request.param = std::to_string(property);
-
- return callIndexes(srv);
+ std::string param = std::to_string(property);
+ return callIndexes("getRelatedFrom", param);
}
std::vector ClassIndexClient::getRelatedOn(int64_t property)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelatedOn";
- srv.request.param = std::to_string(property);
-
- return callIndexes(srv);
+ std::string param = std::to_string(property);
+ return callIndexes("getRelatedOn", param);
}
std::vector ClassIndexClient::getRelatedWith(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelatedWith";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getRelatedWith", param);
}
std::vector ClassIndexClient::getRelationFrom(int64_t index, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelationFrom";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getRelationFrom", param);
}
std::vector ClassIndexClient::getRelationOn(int64_t index, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelationOn";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getRelationOn", param);
}
std::vector ClassIndexClient::getRelationWith(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelationWith";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getRelationWith", param);
}
std::vector ClassIndexClient::getDomainOf(int64_t index, int64_t selector, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDomainOf";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getDomainOf", param);
}
std::vector ClassIndexClient::getRangeOf(int64_t index, int64_t selector, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRangeOf";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getRangeOf", param);
}
} // namespace onto
\ No newline at end of file
diff --git a/src/API/ontologenius/clientsIndex/ontologyClients/DataPropertyIndexClient.cpp b/src/API/ontologenius/clientsIndex/ontologyClients/DataPropertyIndexClient.cpp
index c307ab46..3f38317e 100644
--- a/src/API/ontologenius/clientsIndex/ontologyClients/DataPropertyIndexClient.cpp
+++ b/src/API/ontologenius/clientsIndex/ontologyClients/DataPropertyIndexClient.cpp
@@ -4,41 +4,29 @@ namespace onto {
std::vector DataPropertyIndexClient::getDown(int64_t index, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDown";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getDown", param);
}
std::vector DataPropertyIndexClient::getDisjoint(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDisjoint";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getDisjoint", param);
}
std::vector DataPropertyIndexClient::getDomain(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDomain";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getDomain", param);
}
std::vector DataPropertyIndexClient::getRange(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRange";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getRange", param);
}
} // namespace onto
diff --git a/src/API/ontologenius/clientsIndex/ontologyClients/IndividualIndexClient.cpp b/src/API/ontologenius/clientsIndex/ontologyClients/IndividualIndexClient.cpp
index d9416f61..87a94e0f 100644
--- a/src/API/ontologenius/clientsIndex/ontologyClients/IndividualIndexClient.cpp
+++ b/src/API/ontologenius/clientsIndex/ontologyClients/IndividualIndexClient.cpp
@@ -4,155 +4,116 @@ namespace onto {
std::vector IndividualIndexClient::getOn(int64_t index, int64_t property, int64_t selector)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getOn";
- srv.request.param = std::to_string(index) + ":" + std::to_string(property);
+ std::string param = std::to_string(index) + ":" + std::to_string(property);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
- return callIndexes(srv);
+ return callIndexes("getOn", param);
}
std::vector IndividualIndexClient::getFrom(int64_t property, int64_t index, int64_t selector)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getFrom";
- srv.request.param = std::to_string(index) + ":" + std::to_string(property);
+ std::string param = std::to_string(index) + ":" + std::to_string(property);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
- return callIndexes(srv);
+ return callIndexes("getFrom", param);
}
std::vector IndividualIndexClient::getWith(int64_t indiv_from, int64_t indiv_to, int64_t selector, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getWith";
- srv.request.param = std::to_string(indiv_from) + ":" + std::to_string(indiv_to);
+ std::string param = std::to_string(indiv_from) + ":" + std::to_string(indiv_to);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getWith", param);
}
std::vector IndividualIndexClient::getRelatedFrom(int64_t property)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelatedFrom";
- srv.request.param = std::to_string(property);
-
- return callIndexes(srv);
+ std::string param = std::to_string(property);
+ return callIndexes("getRelatedFrom", param);
}
std::vector IndividualIndexClient::getRelatedOn(int64_t property)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelatedOn";
- srv.request.param = std::to_string(property);
-
- return callIndexes(srv);
+ std::string param = std::to_string(property);
+ return callIndexes("getRelatedOn", param);
}
std::vector IndividualIndexClient::getRelatedWith(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelatedWith";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getRelatedWith", param);
}
std::vector IndividualIndexClient::getRelationFrom(int64_t index, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelationFrom";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getRelationFrom", param);
}
std::vector IndividualIndexClient::getRelationOn(int64_t index, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelationOn";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getRelationOn", param);
}
std::vector IndividualIndexClient::getRelationWith(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRelationWith";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getRelationWith", param);
}
std::vector IndividualIndexClient::getDomainOf(int64_t index, int64_t selector, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDomainOf";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getDomainOf", param);
}
std::vector IndividualIndexClient::getRangeOf(int64_t index, int64_t selector, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRangeOf";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(selector != 0)
- srv.request.param += " -s " + std::to_string(selector);
+ param += " -s " + std::to_string(selector);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getRangeOf", param);
}
std::vector IndividualIndexClient::getType(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getType";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getType", param);
}
std::vector IndividualIndexClient::getSame(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getSame";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getSame", param);
}
std::vector IndividualIndexClient::getDistincts(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDistincts";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getDistincts", param);
}
} // namespace onto
\ No newline at end of file
diff --git a/src/API/ontologenius/clientsIndex/ontologyClients/ObjectPropertyIndexClient.cpp b/src/API/ontologenius/clientsIndex/ontologyClients/ObjectPropertyIndexClient.cpp
index de90615a..d2ee09e1 100644
--- a/src/API/ontologenius/clientsIndex/ontologyClients/ObjectPropertyIndexClient.cpp
+++ b/src/API/ontologenius/clientsIndex/ontologyClients/ObjectPropertyIndexClient.cpp
@@ -4,50 +4,35 @@ namespace onto {
std::vector ObjectPropertyIndexClient::getDown(int64_t index, int depth)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDown";
- srv.request.param = std::to_string(index);
-
+ std::string param = std::to_string(index);
if(depth >= 0)
- srv.request.param += " -d " + std::to_string(depth);
+ param += " -d " + std::to_string(depth);
- return callIndexes(srv);
+ return callIndexes("getDown", param);
}
std::vector ObjectPropertyIndexClient::getDisjoint(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDisjoint";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getDisjoint", param);
}
std::vector ObjectPropertyIndexClient::getDomain(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getDomain";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getDomain", param);
}
std::vector ObjectPropertyIndexClient::getRange(int64_t index)
{
- ontologenius::OntologeniusIndexService srv;
- srv.request.action = "getRange";
- srv.request.param = std::to_string(index);
-
- return callIndexes(srv);
+ std::string param = std::to_string(index);
+ return callIndexes("getRange", param);
}
std::vector