use of org.hypertrace.entity.data.service.v1.Query in project packages-jpl by SWI-Prolog.
the class TestOLD method test10.
private static void test10() {
System.err.println("test10:");
System.err.println(" java_lib_version = " + JPL.version_string());
System.err.println(" c_lib_version = " + org.jpl7.fli.Prolog.get_c_lib_version());
System.err.println(" pl_lib_version = " + new Query(new Compound("jpl_pl_lib_version", new Term[] { new Variable("V") })).oneSolution().get("V"));
System.err.println(" java.version = " + System.getProperty("java.version"));
System.err.println(" os.name = " + System.getProperty("os.name"));
System.err.println(" os.arch = " + System.getProperty("os.arch"));
System.err.println(" os.version = " + System.getProperty("os.version"));
System.err.println();
}
use of org.hypertrace.entity.data.service.v1.Query in project packages-jpl by SWI-Prolog.
the class TestOLD method test10o.
private static void test10o() {
System.err.println("test10o:");
Term l2b = Util.termArrayToList(new Term[] { new Variable("A"), new Variable("B"), new Variable("C"), new Variable("D"), new Variable("E") });
Query q9b = new Query(new Compound("append", new Term[] { new Variable("Xs"), new Variable("Ys"), l2b }));
Map<String, Term>[] s9bs = q9b.allSolutions();
for (int i = 0; i < s9bs.length; i++) {
System.err.println(" append(Xs,Ys,[A,B,C,D,E]) -> " + Util.toString(s9bs[i]));
}
System.err.println();
}
use of org.hypertrace.entity.data.service.v1.Query in project packages-jpl by SWI-Prolog.
the class TestOLD method test10m.
private static void test10m() {
String text = "append(Xs,Ys,[_,_,_,_,_])";
Query q = new Query(text);
Map<String, Term>[] ss = q.allSolutions();
System.err.println("test10m:");
System.err.println(" all solutions of " + text);
for (int i = 0; i < ss.length; i++) {
System.err.println(" " + Util.toString(ss[i]));
}
System.err.println();
}
use of org.hypertrace.entity.data.service.v1.Query in project packages-jpl by SWI-Prolog.
the class TestJUnit method testOpenGetClose1.
public void testOpenGetClose1() {
StringBuffer sb = new StringBuffer();
Query q = new Query("atom_chars(prolog, Cs), member(C, Cs)");
Map<String, Term> soln;
q.open();
while ((soln = q.getSolution()) != null) {
sb.append(((Atom) soln.get("C")).name());
}
q.close();
assertEquals("prolog", sb.toString());
}
use of org.hypertrace.entity.data.service.v1.Query in project packages-jpl by SWI-Prolog.
the class AddWithThreads method run.
public void run() {
for (int i = 0; i < REPS; i++) {
// System.out.println("Asserting test('" + i + "')");
Query queryA = new Query("assert(" + namespace + "(test('" + i + "')))");
Thread.yield();
// System.out.println("adding query: " + queryA);
// boolean retA = queryA.hasMoreElements();
queryA.close();
}
latch.countDown();
}
Aggregations