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
Next revisionBoth sides next revision
interact_with_knowrob_via_ros [2013/01/09 21:13] – [Client libraries] tenorthinteract_with_knowrob_via_ros [2013/02/12 17:41] – external edit 127.0.0.1
Line 66: Line 66:
  
 </code> </code>
 +
 +==== Java client ====
 +
 +<code java> 
 +import edu.tum.cs.ias.knowrob.json_prolog.Prolog;
 +import edu.tum.cs.ias.knowrob.json_prolog.PrologBindings;
 +import edu.tum.cs.ias.knowrob.json_prolog.PrologQueryProxy;
 +
 +
 +public class JSONPrologTestClient {
 +
 + public static void main(String args[]) {
 +
 + Prolog pl = new Prolog();
 + PrologQueryProxy bdgs = pl.query("member(A, [1, 2, 3, 4]), B = ['x', A], C = foo(bar, A, B)");
 +
 +  
 + for(PrologBindings bdg : bdgs) {
 +
 +      System.out.println("Found solution: ");
 +      System.out.println("A = " + bdg.getBdgs_().get("A") );
 +      System.out.println("B = " + bdg.getBdgs_().get("B") );
 +      System.out.println("C = " + bdg.getBdgs_().get("C") );
 +    }
 +  }
 +}
 +</code>
 +