Search in sources :

Example 21 with Term

use of org.geotoolkit.sml.xml.v101.Term in project packages-jpl by SWI-Prolog.

the class TestOLD method test10l.

private static void test10l() {
    Query q5 = new Query(new Compound("length", new Term[] { new Variable("Zs"), new org.jpl7.Integer(5) }));
    Map<String, Term> s5 = q5.oneSolution();
    System.err.println("test10l:");
    System.err.println("  length(Zs,5)");
    System.err.println("  " + Util.toString(s5));
    System.err.println("  Zs = " + (Term) s5.get("Zs"));
    System.err.println();
}
Also used : Integer(org.jpl7.Integer) Variable(org.jpl7.Variable) Query(org.jpl7.Query) Compound(org.jpl7.Compound) Term(org.jpl7.Term)

Example 22 with Term

use of org.geotoolkit.sml.xml.v101.Term 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();
}
Also used : Variable(org.jpl7.Variable) Query(org.jpl7.Query) Compound(org.jpl7.Compound) Term(org.jpl7.Term)

Example 23 with Term

use of org.geotoolkit.sml.xml.v101.Term 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();
}
Also used : Variable(org.jpl7.Variable) Query(org.jpl7.Query) Compound(org.jpl7.Compound) Term(org.jpl7.Term) Map(java.util.Map)

Example 24 with Term

use of org.geotoolkit.sml.xml.v101.Term in project packages-jpl by SWI-Prolog.

the class TestOLD method test10q.

private static void test10q() {
    System.err.println("test10q:");
    System.err.println((new Compound("Bad Name", new Term[] { new Atom("3 3") })).toString());
    System.err.println();
}
Also used : Compound(org.jpl7.Compound) Term(org.jpl7.Term) Atom(org.jpl7.Atom)

Example 25 with Term

use of org.geotoolkit.sml.xml.v101.Term in project packages-jpl by SWI-Prolog.

the class TestJUnit method testStringXput2.

public void testStringXput2() {
    String s1 = "\u0000\u007F\u0080\u00FF";
    String s2 = "\u0100\u7FFF\u8000\uFFFF";
    // concatenate in Java
    String s = s1 + s2;
    // concatenate
    Term a = Query.oneSolution("string_concat(?,?,S)", new Term[] { new Atom(s1), new Atom(s2) }).get("S");
    // in
    // Prolog
    assertEquals(s, a.name());
    assertEquals("string", a.atomType());
}
Also used : Term(org.jpl7.Term) Atom(org.jpl7.Atom)

Aggregations

Term (org.jpl7.Term)86 Query (org.jpl7.Query)52 Variable (org.jpl7.Variable)29 Atom (org.jpl7.Atom)23 Compound (org.jpl7.Compound)23 Map (java.util.Map)19 BigInteger (java.math.BigInteger)5 InputStream (java.io.InputStream)4 ArrayList (java.util.ArrayList)4 Integer (org.jpl7.Integer)4 Term (org.apache.cassandra.cql3.Term)3 MarshalException (org.apache.cassandra.serializers.MarshalException)3 JAXBElement (javax.xml.bind.JAXBElement)2 Unmarshaller (javax.xml.bind.Unmarshaller)2 DefaultIdentifier (org.apache.sis.metadata.iso.DefaultIdentifier)2 CodeType (org.geotoolkit.gml.xml.v311.CodeType)2 TimePositionType (org.geotoolkit.gml.xml.v311.TimePositionType)2 Capabilities (org.geotoolkit.sml.xml.v100.Capabilities)2 Classification (org.geotoolkit.sml.xml.v100.Classification)2 Classifier (org.geotoolkit.sml.xml.v100.Classifier)2