Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:logging:tutorials-cpp [2014/09/19 07:44] – [Non-Default Contexts] winklerdoc:logging:tutorials-cpp [2014/09/19 15:19] (current) – [Non-Default Contexts] winkler
Line 162: Line 162:
 The same accounts for the ''end'' call: The same accounts for the ''end'' call:
 <code pseudo> <code pseudo>
-void Context::end(context-name, optional success-flag, optional end-timestamp)+void Context::end(optional success-flag, optional end-timestamp)
 </code> </code>
 The success flag is by default set to ''true''. For the ''endTime'' timestamp, the same rules apply as for the ''startTime'' timestamp. The success flag is by default set to ''true''. For the ''endTime'' timestamp, the same rules apply as for the ''startTime'' timestamp.
Line 188: Line 188:
 <code cpp> <code cpp>
 Context* ctxContext = ctxMain->startContext("Task-Ctx-1", "&knowrob;", "CustomClass", 0); Context* ctxContext = ctxMain->startContext("Task-Ctx-1", "&knowrob;", "CustomClass", 0);
-ctxContext->endContext(true, 10)+ctxContext->end(true, 10)
 </code> </code>
  
Line 298: Line 298:
 </code> </code>
 produces the actual addition of the object reference to the current context (and creation of the object individual). The optional ''property'' parameter specifies the property tag in the OWL context individual. If left out, it defaults to ''knowrob:objectActedOn''. You have to specify it along its namespace. produces the actual addition of the object reference to the current context (and creation of the object individual). The optional ''property'' parameter specifies the property tag in the OWL context individual. If left out, it defaults to ''knowrob:objectActedOn''. You have to specify it along its namespace.
 +
 +
 +=== Registering custom OWL namespaces ===
 +
 +When using custom namespaces in the entity class definitions, these namespaces need to be registered properly in the OWL file when exporting it. In order to do that, add this line to your program before exporting your logged data:
 +<code cpp>
 +bscl->registerOWLNamespace("sim", "http://some-namespace.org/#");
 +</code>
 +with both parameters representing your use-case, of course.
 +
 +Custom namespaces can therefore be registered by calling
 +''void BeliefstateClient::registerOWLNamespace(std::string strShortcut, std::string strIRI);''
 +where the shortcut is the short version of the namespace, i.e. ''sim'', and the IRI is the actual URL you want to have associated.
 +==== Sample Program ====
 +
 +A complete sample program depicting the ''beliefstate_client'' usage can be found [[doc:logging:tutorials-cpp:sample-program|here]].