Search in sources :

Example 1 with Chc

use of catdata.Chc in project fql by CategoricalData.

the class SchExpRaw method eval.

// TODO: aql printing of contexts broken when conitain choices
@SuppressWarnings("unused")
@Override
public synchronized Schema<Ty, En, Sym, Fk, Att> eval(AqlEnv env) {
    TypeSide<Ty, Sym> ts = typeSide.eval(env);
    Collage<Ty, En, Sym, Fk, Att, Void, Void> col = new Collage<>(ts.collage());
    Set<Triple<Pair<Var, En>, Term<Ty, En, Sym, Fk, Att, Void, Void>, Term<Ty, En, Sym, Fk, Att, Void, Void>>> eqs0 = new HashSet<>();
    for (String k : imports) {
        @SuppressWarnings("unchecked") Schema<Ty, En, Sym, Fk, Att> v = env.defs.schs.get(k);
        col.addAll(v.collage());
        eqs0.addAll(v.eqs);
    }
    col.ens.addAll(ens.stream().map(x -> new En(x)).collect(Collectors.toList()));
    col.fks.putAll(conv1(fks));
    col.atts.putAll(conv2(atts));
    for (Quad<String, String, RawTerm, RawTerm> eq : t_eqs) {
        try {
            Map<String, Chc<Ty, En>> ctx = Util.singMap(eq.first, eq.second == null ? null : Chc.inRight(new En(eq.second)));
            Triple<Ctx<Var, Chc<Ty, En>>, Term<Ty, En, Sym, Fk, Att, Gen, Sk>, Term<Ty, En, Sym, Fk, Att, Gen, Sk>> eq0 = RawTerm.infer1x(ctx, eq.third, eq.fourth, null, col.convert(), "", ts.js).first3();
            Chc<Ty, En> v = eq0.first.get(new Var(eq.first));
            if (v.left) {
                throw new RuntimeException(eq.first + " has type " + v.l + " which is not an entity");
            }
            En t = v.r;
            eqs0.add(new Triple<>(new Pair<>(new Var(eq.first), t), eq0.second.convert(), eq0.third.convert()));
        } catch (RuntimeException ex) {
            ex.printStackTrace();
            throw new LocException(find("obs equations", eq), "In equation " + eq.third + " = " + eq.fourth + ", " + ex.getMessage());
        }
    }
    for (Pair<List<String>, List<String>> eq : p_eqs) {
        try {
            String vv = "v";
            Var var = new Var(vv);
            Map<String, Chc<Ty, En>> ctx = Util.singMap(vv, null);
            RawTerm lhs = RawTerm.fold(col.fks.keySet(), col.ens, eq.first, vv);
            RawTerm rhs = RawTerm.fold(col.fks.keySet(), col.ens, eq.second, vv);
            Triple<Ctx<Var, Chc<Ty, En>>, Term<Ty, En, Sym, Fk, Att, Gen, Sk>, Term<Ty, En, Sym, Fk, Att, Gen, Sk>> eq0 = RawTerm.infer1x(ctx, lhs, rhs, null, col.convert(), "", ts.js).first3();
            Chc<Ty, En> v = eq0.first.get(var);
            if (v.left) {
                throw new RuntimeException("the equation's source " + eq.first + " is type " + v.l + " which is not an entity");
            }
            En t = v.r;
            if (eq0.first.size() != 1) {
                throw new RuntimeException("java constants cannot be used ");
            }
            eqs0.add(new Triple<>(new Pair<>(var, t), eq0.second.convert(), eq0.third.convert()));
        } catch (RuntimeException ex) {
            ex.printStackTrace();
            throw new LocException(find("path equations", eq), "In equation " + Util.sep(eq.first, ".") + " = " + Util.sep(eq.second, ".") + ", " + ex.getMessage());
        }
    }
    for (Triple<Pair<Var, En>, Term<Ty, En, Sym, Fk, Att, Void, Void>, Term<Ty, En, Sym, Fk, Att, Void, Void>> eq : eqs0) {
        col.eqs.add(new Eq<>(new Ctx<>(eq.first).inRight(), eq.second, eq.third));
    }
    AqlOptions strat = new AqlOptions(options, col, env.defaults);
    AqlOptions s = new AqlOptions(Util.singMap(AqlOption.prover.toString(), ProverName.fail.toString()), col, env.defaults);
    // forces type checking before prover construction
    new Schema<>(ts, col.ens, col.atts.map, col.fks.map, eqs0, AqlProver.create(s, col, ts.js), false);
    Schema<Ty, En, Sym, Fk, Att> ret = new Schema<>(ts, col.ens, col.atts.map, col.fks.map, eqs0, AqlProver.create(strat, col, ts.js), !((Boolean) strat.getOrDefault(AqlOption.allow_java_eqs_unsafe)));
    return ret;
}
Also used : Att(catdata.aql.exp.SchExpRaw.Att) Var(catdata.aql.Var) Ctx(catdata.Ctx) Schema(catdata.aql.Schema) En(catdata.aql.exp.SchExpRaw.En) LinkedList(java.util.LinkedList) List(java.util.List) HashSet(java.util.HashSet) Pair(catdata.Pair) Ty(catdata.aql.exp.TyExpRaw.Ty) Fk(catdata.aql.exp.SchExpRaw.Fk) Sym(catdata.aql.exp.TyExpRaw.Sym) RawTerm(catdata.aql.RawTerm) Term(catdata.aql.Term) RawTerm(catdata.aql.RawTerm) Triple(catdata.Triple) AqlOptions(catdata.aql.AqlOptions) Collage(catdata.aql.Collage) Chc(catdata.Chc)

Example 2 with Chc

use of catdata.Chc in project fql by CategoricalData.

the class QueryExpRaw method eval.

@Override
public Query<Ty, En, Sym, Fk, Att, En, Fk, Att> eval(AqlEnv env) {
    Schema<Ty, En, Sym, Fk, Att> src0 = src.eval(env);
    Schema<Ty, En, Sym, Fk, Att> dst0 = dst.eval(env);
    Ctx<En, Triple<Ctx<Var, En>, Collection<Eq<Ty, En, Sym, Fk, Att, Var, Var>>, AqlOptions>> ens0 = new Ctx<>();
    Ctx<Att, Term<Ty, En, Sym, Fk, Att, Var, Var>> atts0 = new Ctx<>();
    Ctx<Fk, Pair<Ctx<Var, Term<Void, En, Void, Fk, Void, Var, Void>>, Boolean>> fks0 = new Ctx<>();
    Ctx<Var, Ty> xxx = new Ctx<>();
    Ctx<Var, Term<Ty, Void, Sym, Void, Void, Void, Void>> yyy = new Ctx<>();
    for (String k : imports) {
        @SuppressWarnings("unchecked") Query<Ty, En, Sym, Fk, Att, En, Fk, Att> v = env.defs.qs.get(k);
        for (Var var : v.params.keySet()) {
            // allow benign collisions
            xxx.map.put(var, v.params.get(var));
        }
        for (Var var : v.consts.keySet()) {
            yyy.map.put(var, v.consts.get(var));
        }
        for (En En : v.ens.keySet()) {
            ens0.put(En, new Triple<>(v.ens.get(En).gens, v.ens.get(En).eqs, v.ens.get(En).options));
        }
        for (Att Att : v.atts.keySet()) {
            atts0.put(Att, v.atts.get(Att));
        }
        for (Fk Fk : v.fks.keySet()) {
            fks0.put(Fk, new Pair<>(v.fks.get(Fk).gens(), v.doNotValidate.get(Fk)));
        }
    }
    Ctx<En, Collage<Ty, En, Sym, Fk, Att, Var, Var>> cols = new Ctx<>();
    for (Block p : blocks) {
        try {
            if (!dst0.ens.contains(p.en)) {
                throw new RuntimeException("the proposed target entity " + p.en + " does not actually appear in the target schema");
            }
            processBlock(options, env, src0, ens0, cols, p, params);
        } catch (RuntimeException ex) {
            ex.printStackTrace();
            throw new LocException(b1.get(p.en), "In block for target entity " + p.en + ", " + ex.getMessage());
        }
        for (Pair<catdata.aql.exp.SchExpRaw.Att, RawTerm> pp : p.atts) {
            try {
                processAtt(src0, dst0, ens0, atts0, cols, pp, params);
            } catch (Exception ex) {
                ex.printStackTrace();
                throw new LocException(b3.get(pp.first), "In return clause for " + pp.first + ", " + ex.getMessage());
            }
        }
    }
    // two loops bc need stuff in en to do this part
    for (Block p : blocks) {
        for (Pair<catdata.aql.exp.SchExpRaw.Fk, Trans> pp : p.fks) {
            try {
                Ctx<Var, Term<Void, En, Void, Fk, Void, Var, Void>> trans = new Ctx<>();
                for (Pair<Var, RawTerm> v : pp.second.gens) {
                    Ctx<String, Chc<Ty, En>> ctx = unVar(ens0.get(dst0.fks.get(pp.first).first).first.inRight());
                    Collage<Ty, En, Sym, Fk, Att, Var, Var> col = cols.get(dst0.fks.get(pp.first).first);
                    Chc<Ty, En> required = Chc.inRight(ens0.get(dst0.fks.get(pp.first).second).first.get(v.first));
                    Term<catdata.aql.exp.TyExpRaw.Ty, catdata.aql.exp.SchExpRaw.En, catdata.aql.exp.TyExpRaw.Sym, catdata.aql.exp.SchExpRaw.Fk, catdata.aql.exp.SchExpRaw.Att, Gen, Sk> term = RawTerm.infer1x(ctx.map, v.second, null, required, col.convert(), "in foreign key " + pp.first.str + ", ", src0.typeSide.js).second;
                    trans.put(v.first, freeze(term.convert(), params).convert());
                }
                boolean doNotCheckEqs = (Boolean) new AqlOptions(pp.second.options, null, env.defaults).getOrDefault(AqlOption.dont_validate_unsafe);
                fks0.put(pp.first, new Pair<>(trans, doNotCheckEqs));
            } catch (RuntimeException ex) {
                ex.printStackTrace();
                throw new LocException(b2.get(pp.first), ex.getMessage());
            }
        }
    }
    boolean doNotCheckEqs = (Boolean) new AqlOptions(options, null, env.defaults).getOrDefault(AqlOption.dont_validate_unsafe);
    boolean elimRed = (Boolean) new AqlOptions(options, null, env.defaults).getOrDefault(AqlOption.query_remove_redundancy);
    for (String s : params.keySet()) {
        xxx.put(new Var(s), new Ty(params.get(s)));
    }
    for (String s : consts.keySet()) {
        Chc<Ty, En> required = Chc.inLeft(xxx.get(new Var(s)));
        Term<catdata.aql.exp.TyExpRaw.Ty, catdata.aql.exp.SchExpRaw.En, catdata.aql.exp.TyExpRaw.Sym, catdata.aql.exp.SchExpRaw.Fk, catdata.aql.exp.SchExpRaw.Att, Gen, Sk> term = RawTerm.infer1x(new HashMap<>(), consts.get(s), null, required, src0.collage().convert(), "", src0.typeSide.js).second;
        yyy.put(new Var(s), term.convert());
    }
    return Query.makeQuery2(xxx, yyy, ens0, atts0, fks0, src0, dst0, doNotCheckEqs, elimRed);
}
Also used : Att(catdata.aql.exp.SchExpRaw.Att) HashMap(java.util.HashMap) Var(catdata.aql.Var) Ctx(catdata.Ctx) En(catdata.aql.exp.SchExpRaw.En) Eq(catdata.aql.Eq) Trans(catdata.aql.exp.QueryExpRaw.Trans) Pair(catdata.Pair) Ty(catdata.aql.exp.TyExpRaw.Ty) Fk(catdata.aql.exp.SchExpRaw.Fk) Sym(catdata.aql.exp.TyExpRaw.Sym) RawTerm(catdata.aql.RawTerm) Term(catdata.aql.Term) RawTerm(catdata.aql.RawTerm) Triple(catdata.Triple) Gen(catdata.aql.exp.InstExpRaw.Gen) Sk(catdata.aql.exp.InstExpRaw.Sk) AqlOptions(catdata.aql.AqlOptions) Collage(catdata.aql.Collage) Chc(catdata.Chc)

Example 3 with Chc

use of catdata.Chc in project fql by CategoricalData.

the class ToJdbcPragmaInstance method deleteThenCreate.

private void deleteThenCreate(Connection conn) throws SQLException {
    Map<En, Triple<List<Chc<Fk, Att>>, List<String>, List<String>>> m = I.schema().toSQL(prefix, "integer", "id", truncate, Object::toString, len);
    Statement stmt = conn.createStatement();
    for (En en : I.schema().ens) {
        for (String x : m.get(en).second) {
            // TODO aql drop foreign keys here first
            // System.out.println(x);
            // .replace("Varchar", "Varchar(" + len + ")").replace("Nvarchar", "Nvarchar(" + len + ")").replace("varchar", "Varchar(" + len + ")"));
            stmt.execute(x);
        }
    }
    stmt.close();
}
Also used : Triple(catdata.Triple) Statement(java.sql.Statement) Chc(catdata.Chc)

Example 4 with Chc

use of catdata.Chc in project fql by CategoricalData.

the class TransExpRaw method eval.

@Override
public synchronized Transform<Ty, En, Sym, Fk, Att, Gen, Sk, Gen, Sk, String, String, String, String> eval(AqlEnv env) {
    Instance<Ty, En, Sym, Fk, Att, Gen, Sk, String, String> src0 = src.eval(env);
    Instance<Ty, En, Sym, Fk, Att, Gen, Sk, String, String> dst0 = dst.eval(env);
    // Collage<String, String, String, String, String, Void, Void> scol = new Collage<>(src0);
    Collage<Ty, En, Sym, Fk, Att, Gen, Sk> dcol = new Collage<>(dst0.collage());
    Map<Gen, Term<Void, En, Void, Fk, Void, Gen, Void>> gens0 = new HashMap<>();
    Map<Sk, Term<Ty, En, Sym, Fk, Att, Gen, Sk>> sks0 = new HashMap<>();
    for (String k : imports) {
        @SuppressWarnings("unchecked") Transform<Ty, En, Sym, Fk, Att, Gen, Sk, Gen, Sk, String, String, String, String> v = env.defs.trans.get(k);
        Util.putAllSafely(gens0, v.gens().map);
        Util.putAllSafely(sks0, v.sks().map);
    }
    for (Pair<String, RawTerm> gen : gens) {
        try {
            RawTerm term = gen.second;
            Map<String, Chc<Ty, En>> ctx = new HashMap<>();
            Chc<Ty, En> required;
            if (src0.gens().containsKey(new Gen(gen.first)) && src0.sks().containsKey(new Sk(gen.first))) {
                throw new RuntimeException(gen.first + " is ambiguous");
            } else if (src0.gens().containsKey(new Gen(gen.first))) {
                required = Chc.inRight(src0.gens().get(new Gen(gen.first)));
            } else if (src0.sks().containsKey(new Sk(gen.first))) {
                required = Chc.inLeft(src0.sks().get(new Sk(gen.first)));
            } else {
                throw new RuntimeException(gen.first + " is not a source generator/labelled null");
            }
            Term<Ty, En, Sym, Fk, Att, Gen, Sk> term0 = RawTerm.infer1x(ctx, term, null, required, dcol, "", src0.schema().typeSide.js).second;
            if (required.left) {
                Util.putSafely(sks0, new Sk(gen.first), term0.convert());
            } else {
                Util.putSafely(gens0, new Gen(gen.first), term0.convert());
            }
        } catch (RuntimeException ex) {
            ex.printStackTrace();
            throw new LocException(find("generators", gen), "In transform for " + gen.first + ", " + ex.getMessage());
        }
    }
    AqlOptions ops = new AqlOptions(options, null, env.defaults);
    LiteralTransform<Ty, En, Sym, Fk, Att, Gen, Sk, Gen, Sk, String, String, String, String> ret = new LiteralTransform<Ty, En, Sym, Fk, Att, Gen, Sk, Gen, Sk, String, String, String, String>(gens0, sks0, src0, dst0, (Boolean) ops.getOrDefault(AqlOption.dont_validate_unsafe));
    return ret;
}
Also used : Att(catdata.aql.exp.SchExpRaw.Att) HashMap(java.util.HashMap) En(catdata.aql.exp.SchExpRaw.En) Ty(catdata.aql.exp.TyExpRaw.Ty) Fk(catdata.aql.exp.SchExpRaw.Fk) Sym(catdata.aql.exp.TyExpRaw.Sym) RawTerm(catdata.aql.RawTerm) Term(catdata.aql.Term) RawTerm(catdata.aql.RawTerm) LiteralTransform(catdata.aql.fdm.LiteralTransform) Gen(catdata.aql.exp.InstExpRaw.Gen) Sk(catdata.aql.exp.InstExpRaw.Sk) AqlOptions(catdata.aql.AqlOptions) Collage(catdata.aql.Collage) Chc(catdata.Chc)

Example 5 with Chc

use of catdata.Chc in project fql by CategoricalData.

the class CatOps method visit.

@Override
public Functor visit(FQLPPProgram env, FinalConst ic) {
    CatExp e = resolve(env, ic.src);
    if (!(e instanceof Const)) {
        throw new RuntimeException("Can only create functors from finitely-presented categories.");
    }
    Const c = (Const) e;
    Category cat = c.accept(env, this);
    Signature<String, String> sig = new Signature<>(c.nodes, c.arrows, c.eqs);
    Category target = ic.C.accept(env, this);
    Map<Node, Functor> nm = new HashMap<>();
    for (Node n : sig.nodes) {
        FunctorExp kkk = ic.nm.get(n.name);
        if (kkk == null) {
            throw new RuntimeException("Missing node mapping from " + n);
        }
        Functor F = kkk.accept(env, this);
        nm.put(n, F);
    }
    Map<Edge, Transform> em = new HashMap<>();
    for (Edge n : sig.edges) {
        TransExp chc = ic.em.get(n.name);
        if (chc == null) {
            throw new RuntimeException("Missing edge mapping from " + n);
        }
        em.put(n, chc.accept(env, this));
    }
    FUNCTION fff = p0 -> {
        Path p = (Path) p0;
        Object fn = target.identity(nm.get(p.source));
        for (Object nnn : p.path) {
            Edge n = (Edge) nnn;
            fn = target.compose(fn, em.get(n));
        }
        return fn;
    };
    return new Functor(cat, target, nm::get, fff);
}
Also used : PeterApply(catdata.fqlpp.TransExp.PeterApply) FiniteCategory(catdata.fqlpp.cat.FiniteCategory) Named(catdata.fqlpp.CatExp.Named) Edge(catdata.fqlpp.cat.Signature.Edge) Snd(catdata.fqlpp.FunctorExp.Snd) Comp(catdata.fqlpp.FunctorExp.Comp) ToInst(catdata.fqlpp.TransExp.ToInst) Id(catdata.fqlpp.FunctorExp.Id) Inr(catdata.fqlpp.FunctorExp.Inr) FF(catdata.fqlpp.FunctorExp.FF) Migrate(catdata.fqlpp.FunctorExp.Migrate) Colim(catdata.fqlpp.CatExp.Colim) Exp(catdata.fqlpp.CatExp.Exp) Pushout(catdata.fqlpp.FunctorExp.Pushout) FinCat(catdata.fqlpp.cat.FinCat) FunCat(catdata.fqlpp.cat.FunCat) Pair(catdata.Pair) CoMonad(catdata.fqlpp.cat.CoMonad) Iso(catdata.fqlpp.FunctorExp.Iso) ApplyPath(catdata.fqlpp.TransExp.ApplyPath) Inj(catdata.fqlpp.TransExp.Inj) Fn(catdata.fqlpp.cat.FinSet.Fn) Bool(catdata.fqlpp.TransExp.Bool) Case(catdata.fqlpp.FunctorExp.Case) ToMap(catdata.fqlpp.TransExp.ToMap) Zero(catdata.fqlpp.CatExp.Zero) Monad(catdata.fqlpp.cat.Monad) Plus(catdata.fqlpp.CatExp.Plus) Category(catdata.fqlpp.cat.Category) CatConst(catdata.fqlpp.FunctorExp.CatConst) Inst(catdata.fqlpp.cat.Inst) ToSet(catdata.fqlpp.TransExp.ToSet) Groth(catdata.fqlpp.cat.Groth) Mapping(catdata.fqlpp.cat.Mapping) Serializable(java.io.Serializable) Kleisli(catdata.fqlpp.CatExp.Kleisli) ApplyTrans(catdata.fqlpp.TransExp.ApplyTrans) SetSetConst(catdata.fqlpp.FunctorExp.SetSetConst) Dom(catdata.fqlpp.CatExp.Dom) Triple(catdata.Triple) Eval(catdata.fqlpp.FunctorExp.Eval) Var(catdata.fqlpp.FunctorExp.Var) Times(catdata.fqlpp.CatExp.Times) Const(catdata.fqlpp.CatExp.Const) java.util(java.util) Prod(catdata.fqlpp.FunctorExp.Prod) InstConst(catdata.fqlpp.FunctorExp.InstConst) Node(catdata.fqlpp.cat.Signature.Node) Chc(catdata.Chc) TT(catdata.fqlpp.FunctorExp.TT) Functor(catdata.fqlpp.cat.Functor) Proj(catdata.fqlpp.TransExp.Proj) Prop(catdata.fqlpp.FunctorExp.Prop) CatExpVisitor(catdata.fqlpp.CatExp.CatExpVisitor) Signature(catdata.fqlpp.cat.Signature) TransExpVisitor(catdata.fqlpp.TransExp.TransExpVisitor) Union(catdata.fqlpp.CatExp.Union) ToCat(catdata.fqlpp.TransExp.ToCat) One(catdata.fqlpp.CatExp.One) FDM(catdata.fqlpp.cat.FDM) Ker(catdata.fqlpp.TransExp.Ker) Fst(catdata.fqlpp.FunctorExp.Fst) Whisker(catdata.fqlpp.TransExp.Whisker) Curry(catdata.fqlpp.FunctorExp.Curry) Transform(catdata.fqlpp.cat.Transform) Apply(catdata.fqlpp.FunctorExp.Apply) Instance(catdata.fqlpp.cat.Instance) MapConst(catdata.fqlpp.FunctorExp.MapConst) Path(catdata.fqlpp.cat.Signature.Path) Pivot(catdata.fqlpp.FunctorExp.Pivot) Chr(catdata.fqlpp.TransExp.Chr) Cod(catdata.fqlpp.CatExp.Cod) FinSet(catdata.fqlpp.cat.FinSet) Uncurry(catdata.fqlpp.FunctorExp.Uncurry) FunctorExpVisitor(catdata.fqlpp.FunctorExp.FunctorExpVisitor) Adj(catdata.fqlpp.TransExp.Adj) SetSet(catdata.fqlpp.TransExp.SetSet) AndOrNotImplies(catdata.fqlpp.TransExp.AndOrNotImplies) FinalConst(catdata.fqlpp.FunctorExp.FinalConst) Inl(catdata.fqlpp.FunctorExp.Inl) CoProd(catdata.fqlpp.TransExp.CoProd) ApplyPath(catdata.fqlpp.TransExp.ApplyPath) Path(catdata.fqlpp.cat.Signature.Path) FiniteCategory(catdata.fqlpp.cat.FiniteCategory) Category(catdata.fqlpp.cat.Category) CatConst(catdata.fqlpp.FunctorExp.CatConst) SetSetConst(catdata.fqlpp.FunctorExp.SetSetConst) Const(catdata.fqlpp.CatExp.Const) InstConst(catdata.fqlpp.FunctorExp.InstConst) MapConst(catdata.fqlpp.FunctorExp.MapConst) FinalConst(catdata.fqlpp.FunctorExp.FinalConst) Node(catdata.fqlpp.cat.Signature.Node) Functor(catdata.fqlpp.cat.Functor) Signature(catdata.fqlpp.cat.Signature) Transform(catdata.fqlpp.cat.Transform) Edge(catdata.fqlpp.cat.Signature.Edge)

Aggregations

Chc (catdata.Chc)40 Pair (catdata.Pair)27 Triple (catdata.Triple)25 HashMap (java.util.HashMap)22 List (java.util.List)22 HashSet (java.util.HashSet)20 LinkedList (java.util.LinkedList)20 Ctx (catdata.Ctx)19 En (catdata.aql.exp.SchExpRaw.En)18 Ty (catdata.aql.exp.TyExpRaw.Ty)18 Sym (catdata.aql.exp.TyExpRaw.Sym)17 Att (catdata.aql.exp.SchExpRaw.Att)16 Fk (catdata.aql.exp.SchExpRaw.Fk)16 Map (java.util.Map)14 Gen (catdata.aql.exp.InstExpRaw.Gen)13 Sk (catdata.aql.exp.InstExpRaw.Sk)12 Collage (catdata.aql.Collage)11 RawTerm (catdata.aql.RawTerm)11 Util (catdata.Util)10 Term (catdata.aql.Term)10