RCL - RoboCLuedo  v1.0
Francesco Ganci - S4143910 - Experimental Robotics Lab - Assignment 1
test_armor_tools.cpp
Go to the documentation of this file.
1 
2 
18 #include "ros/ros.h"
21 
22 #include "armor_msgs/ArmorDirective.h"
23 #include "armor_msgs/ArmorDirectiveList.h"
24 #include "armor_msgs/ArmorDirectiveReq.h"
25 #include "armor_msgs/ArmorDirectiveRes.h"
26 #include "armor_msgs/QueryItem.h"
27 
28 #include <iostream>
29 #include <fstream>
30 #include <string>
31 #include <vector>
32 
33 #define ONTOLOGY_PARAM "cluedo_path_owlfile"
34 #define SERVICE_ARMOR_SINGLE_REQUEST "/armor_interface_srv"
35 #define SERVICE_ARMOR_MULTIPLE_REQUESTS "/armor_interface_serialized_srv"
36 #define ARMOR_CLIENT_NAME "robocluedo"
37 #define ARMOR_REFERENCE_NAME "cluedo_ontology"
38 #define OUTLABEL "[test_armor_tools] "
39 
40 
41 // check if a given file exists
42 bool fileExist( std::string path )
43 {
44  return (std::ifstream(path)).good();
45 }
46 
47 
48 
49 void printList( std::vector<std::string> list, std::string intro = "" )
50 {
51  if( intro != "" )
52  ROS_INFO_STREAM( OUTLABEL << intro );
53 
54  if( list.size() == 0 )
55  {
56  ROS_INFO_STREAM( OUTLABEL << "size==0" );
57  return;
58  }
59 
60  int idx = 1;
61  for( auto it = list.begin(); it != list.end( ); ++it )
62  {
63  ROS_INFO_STREAM( OUTLABEL << "\t" << "numero " << idx++ << " -> " << *it );
64  }
65 }
66 
67 
68 /*
69  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "ADD", "IND", "CLASS", armorGetArgs( "Jim", "PERSON" ) ) );
70  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "ADD", "OBJECTPROP", "IND", armorGetArgs( "who", "HP3", "Jim" ) ) );
71  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "ADD", "IND", "CLASS", armorGetArgs( "Gun", "WEAPON" ) ) );
72  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "ADD", "OBJECTPROP", "IND", armorGetArgs( "what", "HP3", "Gun" ) ) );
73  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "ADD", "IND", "CLASS", armorGetArgs( "Stadium", "PLACE" ) ) );
74  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "ADD", "OBJECTPROP", "IND", armorGetArgs( "where", "HP3", "Stadium" ) ) );
75  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "REASON", "", "", armorGetArgs( "" ) ) );
76  *
77  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "ADD", "IND", "CLASS", armorGetArgs( "Lounge", "PLACE" ) ) );
78  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "DISJOINT", "IND", "", armorGetArgs( "Lounge", "Stadium" ) ) );
79  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "ADD", "OBJECTPROP", "IND", armorGetArgs( "where", "HP3", "Lounge" ) ) );
80  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "REASON", "", "", armorGetArgs( "" ) ) );
81  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "SAVE", "INFERENCE", "", armorGetArgs( "/root/Desktop/ROBOCLUEDO_ONTOLOGY.owl" ) ) );
82  */
83  /*
84  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "QUERY", "IND", "CLASS", armorGetArgs( "COMPLETED" ) ) );
85  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "QUERY", "IND", "CLASS", armorGetArgs( "INCONSISTENT" ) ) );
86  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "QUERY", "OBJECTPROP", "IND", armorGetArgs( "who", "HP0" ) ) );
87  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "QUERY", "OBJECTPROP", "IND", armorGetArgs( "where", "HP0" ) ) );
88  directives.push_back( armorGetRequest( ARMOR_CLIENT_NAME, ARMOR_REFERENCE_NAME, "QUERY", "OBJECTPROP", "IND", armorGetArgs( "what", "HP0" ) ) );
89 */
90 /*
91  * disjoint di classe da un'altra
92  * "DISJOINT", "CLASS", "", "PERSON", "WEAPON"
93  * --
94  *
95  * disjoint individual qualunque da individual qualunque
96  * "DISJOINT", "IND", "", "Lounge", "HP3"
97  * --
98  *
99  * aggiungi un individual ad una classe
100  * "ADD", "IND", "CLASS", "Jim", "PERSON"
101  * --
102  *
103  * ritorna tutti gli individual appartenenti ad una classe
104  * "QUERY", "IND", "CLASS", "HYPOTHESIS"
105  * <uri#value>
106  *
107  * aggiungi una proprietà
108  * "ADD", "OBJECTPROP", "IND", "who", "HP3", "Jim"
109  * --
110  *
111  * query sulle proprietà di uno specifico individual
112  * (logica: "QUERY" - "su cosa voglio lavorare" - "cosa voglio ottenere")
113  * "QUERY", "IND", "OBJECTPROP", "HP3"
114  * <uri#property>
115  *
116  * update
117  * "REASON"
118  * --
119  *
120  * save
121  * "SAVE", "INFERENCE", "", "/root/Desktop/ROBOCLUEDO_ONTOLOGY.owl"
122  * --
123  *
124  * check ipotesi consistenti
125  * "QUERY", "IND", "CLASS", "COMPLETED"
126  * <uri#HP3>
127  *
128  * classe/i di un individual
129  * "QUERY", "CLASS", "IND", "HP3", "false"
130  * <uri#HYPOTHESIS>
131  *
132  * classe più profonda di un individual (caso bastardo, probabilmente bug)
133  * "QUERY", "CLASS", "IND", "HP3", "true"
134  * HYPOTHESIS
135  *
136  * Ritorna i valori associati ad una certa proprietà
137  * "QUERY", "OBJECTPROP", "IND", "where", "HP3"
138  * <http://www.emarolab.it/cluedo-ontology#Study>
139  * corrisponde a: (HP3, Study):where
140  *
141  */
143 {
144  armor.SendCommand( "DISJOINT", "CLASS", "", "PERSON", "WEAPON" );
145  armor.SendCommand( "DISJOINT", "CLASS", "", "WEAPON", "PLACE" );
146  armor.SendCommand( "DISJOINT", "CLASS", "", "PERSON", "PLACE" );
147  armor.UpdateOntology( );
148 
149  armor.SendCommand( "ADD", "IND", "CLASS", "Jim", "PERSON" );
150  armor.SendCommand( "ADD", "OBJECTPROP", "IND", "who", "HP3", "Jim" );
151  armor.SendCommand( "ADD", "IND", "CLASS", "Gun", "WEAPON" );
152  armor.SendCommand( "ADD", "OBJECTPROP", "IND", "what", "HP3", "Gun" );
153  armor.SendCommand( "ADD", "IND", "CLASS", "Stadium", "PLACE" );
154  armor.SendCommand( "ADD", "OBJECTPROP", "IND", "where", "HP3", "Stadium" );
155  armor.UpdateOntology( );
156  armor.SendCommand( "QUERY", "IND", "CLASS", "COMPLETED" );
157  ROS_INFO_STREAM( OUTLABEL << "(1) completed hypotheses:" );
158  armor.PrintLastRes( );
159  armor.SendCommand( "QUERY", "IND", "CLASS", "INCONSISTENT" );
160  ROS_INFO_STREAM( OUTLABEL << "(1) inconsistent hypotheses:" );
161  armor.PrintLastRes( );
162 
163  // NON VALE LA PROPRIETA' TRANSITIVA, PURTROPPO
164  armor.SendCommand( "ADD", "IND", "CLASS", "Lounge", "PLACE" );
165  // armor.SendCommand( "DISJOINT", "IND", "", "Lounge", "Stadium" );
166  armor.SendCommand( "ADD", "IND", "CLASS", "Study", "PLACE" );
167  // armor.SendCommand( "DISJOINT", "IND", "", "Lounge", "Study" );
168  // armor.SendCommand( "DISJOINT", "IND", "", "Stadium", "Study" );
169  armor.SendCommand( "DISJOINT", "IND" "CLASS" );
170  armor.PrintLastReq( ); armor.PrintLastRes( );
171  armor.SendCommand( "ADD", "OBJECTPROP", "IND", "where", "HP3", "Study" );
172  armor.UpdateOntology( );
173  ROS_INFO_STREAM( OUTLABEL << "(2) completed hypotheses:" );
174  armor.SendCommand( "QUERY", "IND", "CLASS", "COMPLETED" );
175  armor.PrintLastRes( );
176  ROS_INFO_STREAM( OUTLABEL << "(2) inconsistent hypotheses:" );
177  armor.SendCommand( "QUERY", "IND", "CLASS", "INCONSISTENT" );
178  armor.PrintLastRes( );
179 
180  // però si può fare disjoint di qualunque cosa nell'universo con qualunque altra cosa
181  // è possibile almeno una strategia di forza bruta
182  armor.SendCommand( "DISJOINT", "IND", "", "Lounge", "HP3" );
183  armor.UpdateOntology( );
184  ROS_INFO_STREAM( OUTLABEL << "(3) un disjoint strano:" );
185  armor.PrintLastRes( );
186  ROS_INFO_STREAM( OUTLABEL << "(3) inconsistent hypotheses:" );
187  armor.SendCommand( "QUERY", "IND", "CLASS", "INCONSISTENT" );
188  armor.PrintLastRes( );
189 
190  ROS_INFO_STREAM( OUTLABEL << "query elementi della classe PLACE" );
191  armor.SendCommand( "QUERY", "IND", "CLASS", "PLACE" );
192  armor.PrintLastRes( );
193  ROS_INFO_STREAM( OUTLABEL << "query proprieta' di hp3" );
194  armor.SendCommand( "QUERY", "IND", "OBJECTPROP", "HP3" );
195  armor.PrintLastRes( );
196  ROS_INFO_STREAM( OUTLABEL << "query di tutte le ipotesi" );
197  armor.SendCommand( "QUERY", "IND", "CLASS", "HYPOTHESIS" );
198  armor.PrintLastRes( );
199  ROS_INFO_STREAM( OUTLABEL << "query tutte le classi a cui HP3 apartiene" );
200  armor.SendCommand( "QUERY", "CLASS", "IND", "HP3", "false" );
201  armor.PrintLastRes( );
202  ROS_INFO_STREAM( OUTLABEL << "query solo la classe piu' profonda" );
203  armor.SendCommand( "QUERY", "CLASS", "IND", "HP3", "true" );
204  armor.PrintLastRes( );
205 
206  ROS_INFO_STREAM( OUTLABEL << "salvataggio" );
207  armor.SendCommand( "SAVE", "INFERENCE", "", "/root/Desktop/ROBOCLUEDO_ONTOLOGY.owl" );
208 }
209 
210 
211 
212 void armorTestSession2( std::string ontology_file_path )
213 {
214  ArmorCluedo armor( true );
215  armor.Init( ontology_file_path );
216 
217  armor.SendCommand( "DISJOINT", "CLASS", "", "PERSON", "WEAPON" );
218  armor.SendCommand( "DISJOINT", "CLASS", "", "WEAPON", "PLACE" );
219  armor.SendCommand( "DISJOINT", "CLASS", "", "PERSON", "PLACE" );
220  armor.UpdateOntology( );
221 
222  ROS_INFO_STREAM( OUTLABEL << "\n\n\n TEST COMANDI DIRETTI ARMOR \n\n\n" );
223 
224  armor.AddIndiv( "Jim", "PERSON" );
225  armor.AddIndiv( "Gun", "WEAPON" );
226  // armor.AddIndiv( "study", "PLACE" );
227  armor.AddIndiv( "HP3", "HYPOTHESIS" );
228  armor.SetObjectProperty( "who", "HP3", "Jim" );
229  armor.SetObjectProperty( "what", "HP3", "Gun" );
230  // armor.SetObjectProperty( "where", "HP3", "study" );
231  armor.UpdateOntology( );
232 
233  armor.SendCommand( "QUERY", "IND", "CLASS", "COMPLETED" );
234  ROS_INFO_STREAM( OUTLABEL << "(0) completed hypotheses: (dovrebbe essere vuoto)" );
235  armor.PrintLastRes( );
236  armor.SendCommand( "QUERY", "IND", "CLASS", "INCONSISTENT" );
237  ROS_INFO_STREAM( OUTLABEL << "(0) inconsistent hypotheses: (dovrebbe essere vuoto)" );
238  armor.PrintLastRes( );
239 
240 
241  armor.AddIndiv( "Stadium", "PLACE" );
242  armor.SetObjectProperty( "where", "HP3", "Stadium" );
243  armor.UpdateOntology( );
244 
245  armor.SendCommand( "QUERY", "IND", "CLASS", "COMPLETED" );
246  ROS_INFO_STREAM( OUTLABEL << "(1) completed hypotheses: (dovrebbe comparire un'ipotesi)" );
247  armor.PrintLastRes( );
248  armor.SendCommand( "QUERY", "IND", "CLASS", "INCONSISTENT" );
249  ROS_INFO_STREAM( OUTLABEL << "(1) inconsistent hypotheses: (la lista dovrebbe essere vuota)" );
250  armor.PrintLastRes( );
251 
252 
253  armor.AddIndiv( "Lounge", "PLACE" );
254  armor.AddIndiv( "Study", "PLACE" );
255  armor.SetObjectProperty( "where", "HP3", "Study" );
256  armor.UpdateOntology( );
257 
258  armor.SendCommand( "QUERY", "IND", "CLASS", "COMPLETED" );
259  ROS_INFO_STREAM( OUTLABEL << "(2) completed hypotheses: (sempre una sola ipotesi)" );
260  armor.PrintLastRes( );
261  armor.SendCommand( "QUERY", "IND", "CLASS", "INCONSISTENT" );
262  ROS_INFO_STREAM( OUTLABEL << "(2) inconsistent hypotheses: (dovrebbe spuntare un'ipotesi inconsistente)" );
263  armor.PrintLastRes( );
264 
265 
266  armor.GetValuedOfIndiv( "where", "HP3" );
267  ROS_INFO_STREAM( OUTLABEL << "proprieta' where dell'ipotesi HP3:" );
268  armor.PrintLastRes( );
269  /*
270  ROS_INFO_STREAM( OUTLABEL << "esiste HP3? -> " << ( armor.ExistsIndiv( "HP3" ) ? "yes" : "no" ) );
271  armor.PrintLastRes( );
272  */
273  ROS_INFO_STREAM( OUTLABEL << "test esistenza di HP3:" );
274  armor.SendCommand( "QUERY", "IND", "", "HP3", "", "", "", "", true );
275  ROS_INFO_STREAM( OUTLABEL << "esiste HP3? (atteso: yes) -> " << ( armor.ExistsIndiv( "HP3" ) ? "yes" : "no" ) );
276  armor.PrintLastRes( );
277 
278 
279 
280  ROS_INFO_STREAM( OUTLABEL << "\n\n\n TEST COMPLETO INTERFACCIA \n\n\n" );
281 
282  ROS_INFO_STREAM( OUTLABEL << "\n\n\t======\tTEST GetClassOfIndiv()" );
283  ROS_INFO_STREAM( OUTLABEL << "classe dell'individual " << "Stadium" << "(con la maiuscola, scritto correttamente, no deep search, atteso un solo elemento)" );
284  printList( armor.GetClassOfIndiv( "Stadium", false ) );
285  ROS_INFO_STREAM( "" );
286  ROS_INFO_STREAM( OUTLABEL << "classe dell'individual " << "Stadium" << "(con la maiuscola, scritto correttamente, usando la deep search, atteso un solo elemento)" );
287  printList( armor.GetClassOfIndiv( "Stadium", true ) );
288  ROS_INFO_STREAM( "" );
289  ROS_INFO_STREAM( OUTLABEL << "classe dell'individual " << "stadium" << "(senza la maiuscola, sbagliato, no deep search, atteso 0)" );
290  printList( armor.GetClassOfIndiv( "stadium", false ) );
291  ROS_INFO_STREAM( "" );
292 
293 
294 
295  ROS_INFO_STREAM( OUTLABEL << "\n\n\t======\tTEST ExistsIndiv()" );
296  ROS_INFO_STREAM( OUTLABEL << "esiste '" << "stadium" << "' senza la maiuscola? -> " << ( armor.ExistsIndiv( "stadium" ) ? "yes" : "no" ) );
297  ROS_INFO_STREAM( OUTLABEL << "esiste '" << "Stadium" << "' con la maiuscola? -> " << ( armor.ExistsIndiv( "Stadium" ) ? "yes" : "no" ) );
298  ROS_INFO_STREAM( OUTLABEL << "esiste '" << "HP0" << "' ? -> " << ( armor.ExistsIndiv( "HP0" ) ? "yes" : "no" ) );
299 
300 
301 
302  ROS_INFO_STREAM( OUTLABEL << "\n\n\t======\tTEST GetIndivOfClass()" );
303  ROS_INFO_STREAM( OUTLABEL << "tutti gli individuals della classe HYPOTHESIS" << "(attesa ... un bel po' di roba)" );
304  printList( armor.GetIndivOfClass( "HYPOTHESIS" ) );
305  ROS_INFO_STREAM( "" );
306  ROS_INFO_STREAM( OUTLABEL << "tutti gli individuals della classe PLACE" << "(attesi 3 elementi)" );
307  printList( armor.GetIndivOfClass( "PLACE" ) );
308  ROS_INFO_STREAM( "" );
309 
310 
311  ROS_INFO_STREAM( OUTLABEL << "\n\n\t======\tTEST GetValuedOfIndiv()" );
312  ROS_INFO_STREAM( OUTLABEL << "proprietà where dell'ipotesi HP3" << "(attesi due elementi)" );
313  printList( armor.GetValuedOfIndiv( "where", "HP3" ) );
314  ROS_INFO_STREAM( "" );
315 
316 
317 
318  ROS_INFO_STREAM( OUTLABEL << "\n\n\t======\tTEST RemoveHypothesis()" );
319  ROS_WARN_STREAM( OUTLABEL << "NOTA BENE: il comando REMOVE di aRMOR è buggato, non funziona. Per farlo funzionare occorre trovare un workaround nell'interfaccia" );
320 
321  ROS_INFO_STREAM( OUTLABEL << "aggiungo l'ipotesi HPtoremove (uso qui solo comandi dell'interfaccia, non i diretti di aRMOR)" );
322  armor.AddIndiv( "HPtoremove", "HYPOTHESIS", false );
323  armor.UpdateOntology( );
324  ROS_INFO_STREAM( OUTLABEL << "esiste '" << "HPtoremove" << "' ? -> " << ( armor.ExistsIndiv( "HPtoremove" ) ? "yes" : "no" ) );
325  ROS_INFO_STREAM( OUTLABEL << "classe dell'individual " << "HPtoremove" << "? (atteso un solo elemento)" );
326  printList( armor.GetClassOfIndiv( "HPtoremove", false ) );
327 
328  ROS_INFO_STREAM( OUTLABEL << "rimozione" );
329  // armor.SendCommand( "REMOVE", "IND", "CLASS", "HPtoremove", "HYPOTHESIS" );
330  // armor.PrintLastReq( );
331  // armor.PrintLastRes( );
332  ROS_INFO_STREAM( OUTLABEL << "RemoveHypothesis( ) = " << ( armor.RemoveHypothesis( "HPtoremove" ) ? "yes" : "no" ) );
333  armor.UpdateOntology( );
334  ROS_INFO_STREAM( OUTLABEL << "esiste ancora '" << "HPtoremove" << "' ? -> " << ( armor.ExistsIndiv( "HPtoremove" ) ? "yes" : "no" ) );
335 
336 
337 
338  ROS_INFO_STREAM( OUTLABEL << "\n\n\t======\tTEST FindCompleteHypotheses()" );
339  printList( armor.FindCompleteHypotheses( ), "ricerca delle ipotesi complete (atteso: una sola ipotesi, escludendo quella scartata" );
340 
341 
342 
343  ROS_INFO_STREAM( OUTLABEL << "\n\n\t======\tTEST FindInconsistentHypotheses()" );
344  printList( armor.FindCompleteHypotheses( ), "ricerca delle ipotesi inconsistenti (atteso: solo una, o anche due, includendo quella scartata)" );
345 
346 
347 
348  std::string save_path;
349  ros::param::get( "cluedo_path_owlfile_backup", save_path );
350  armor.SaveOntology( save_path );
351  return;
352 
353 }
354 
355 
356 // test section
357 int main( int argc, char* argv[] )
358 {
359  ros::init( argc, argv, "test_armor_tools" );
360  ros::NodeHandle nh;
361 
362  // path of the ontology file from parameter server
363  std::string ontology_file_path;
364  if( !ros::param::has( ONTOLOGY_PARAM ) )
365  {
366  ROS_INFO_STREAM( OUTLABEL << "ERROR: parameter '" << ONTOLOGY_PARAM << "' not defined." );
367  return 0;
368  }
369  ros::param::get( ONTOLOGY_PARAM, ontology_file_path );
370  if( !fileExist( ontology_file_path ) )
371  {
372  ROS_INFO_STREAM( OUTLABEL << "ERROR: the file '" << ONTOLOGY_PARAM << "' doesn't exist." );
373  return 0;
374  }
375  ROS_INFO_STREAM( OUTLABEL << "Ontology found! " << LOGSQUARE( ontology_file_path ) );
376 
377  // armorTestSession( tools );
378  armorTestSession2( ontology_file_path );
379 
380  ROS_INFO_STREAM( OUTLABEL << "THAT'S ALL FOLKS!" );
381  return 0;
382 }
ArmorTools::PrintLastRes
void PrintLastRes()
print the last response
Definition: armor_tools.cpp:403
ArmorCluedo::AddIndiv
bool AddIndiv(std::string indivname, std::string classname, bool makeDisjoint=true)
add an individual to the ontology
Definition: armor_cluedo.cpp:53
ONTOLOGY_PARAM
#define ONTOLOGY_PARAM
Definition: test_armor_tools.cpp:33
armor_cluedo.h
additional aRMOR C++ interface
ArmorCluedo::SetObjectProperty
bool SetObjectProperty(std::string prop, std::string Aelem, std::string Belem)
set a property true
Definition: armor_cluedo.cpp:131
ArmorCluedo::Init
bool Init(std::string ontologyPath)
initizalize the interface
Definition: armor_cluedo.cpp:34
ArmorCluedo::GetValuedOfIndiv
std::vector< std::string > GetValuedOfIndiv(std::string prop, std::string indivname)
get the values of a property related to a gven individual
Definition: armor_cluedo.cpp:150
armorTestSession2
void armorTestSession2(std::string ontology_file_path)
Definition: test_armor_tools.cpp:212
ArmorCluedo::GetIndivOfClass
std::vector< std::string > GetIndivOfClass(std::string classname)
find the individuals belonging to a class
Definition: armor_cluedo.cpp:97
LOGSQUARE
#define LOGSQUARE(str)
Definition: armor_tools.h:49
ArmorTools::UpdateOntology
bool UpdateOntology()
send the command REASON
Definition: armor_tools.cpp:246
ArmorTools::SendCommand
bool SendCommand(std::string command, std::string first_spec="", std::string second_spec="", std::string arg1="", std::string arg2="", std::string arg3="", std::string arg4="", std::string arg5="", bool printRequest=false)
fill in a command and send it to aRMOR
Definition: armor_tools.cpp:360
OUTLABEL
#define OUTLABEL
Definition: test_armor_tools.cpp:38
ArmorTools
A minimal C++ client for aRMOR.
Definition: armor_tools.h:90
main
int main(int argc, char *argv[])
Definition: test_armor_tools.cpp:357
ArmorCluedo::GetClassOfIndiv
std::vector< std::string > GetClassOfIndiv(std::string indivname, bool deep)
get the class of a given individual
Definition: armor_cluedo.cpp:81
ArmorTools::PrintLastReq
void PrintLastReq()
print the last request
Definition: armor_tools.cpp:413
fileExist
bool fileExist(std::string path)
Definition: test_armor_tools.cpp:42
ArmorCluedo
additional utilities for aRMOR
Definition: armor_cluedo.h:56
ArmorTools::SaveOntology
bool SaveOntology(std::string path)
save the ontology on file
Definition: armor_tools.cpp:231
ArmorCluedo::ExistsIndiv
bool ExistsIndiv(std::string indivname)
check if an individual exists
Definition: armor_cluedo.cpp:112
printList
void printList(std::vector< std::string > list, std::string intro="")
Definition: test_armor_tools.cpp:49
armor_tools.h
A minimal C++ client for aRMOR.
armorTestSession
void armorTestSession(ArmorTools &armor)
Definition: test_armor_tools.cpp:142
ArmorCluedo::RemoveHypothesis
bool RemoveHypothesis(std::string hypTag)
discard one hypothesis
Definition: armor_cluedo.cpp:192
ArmorCluedo::FindCompleteHypotheses
std::vector< std::string > FindCompleteHypotheses()
find all the complete hypotheses
Definition: armor_cluedo.cpp:165