I made a query with Org.JPL7 in Java, and I tried to do it several times in diferent ways but it gave to me a lot of wrong results. The code in .pl file is the next.
loco(eso,eso1).
loco(eso3,eso2).
and the Java code is the next.
Query q2= new Query(new Compound("loco", new Term[] {new Variable("X")}));
q2.open();
System.out.println(" "+Consulta1+(q2.next().get("X")));
The result:
_0
and I try this too.
for (Map soln : new Query("loco(X,Y)")) {
System.out.println(soln.get("X"));
}
The result:
_2
and this...
Query q2= new Query("loco(X,Y)");
q2.open();
System.out.println(q2.next().get("X"));
The result:
_0
I try with "q2.nextSolution()" and "q2.nextElement()" but the results were always the same "_N" where N is any number "0,1,2,3,4" and i don't know why.