Search in sources :

Example 6 with Mapping

use of catdata.fql.decl.Mapping in project fql by CategoricalData.

the class LeftKanSigma method fullSigmaWithAttrs.

public static Quad<Instance, Map<Node, Map<Object, Integer>>, Map<Node, Map<Integer, Object>>, Map<Object, List<Pair<String, Object>>>> fullSigmaWithAttrs(PSMInterp inter, Mapping f, Instance i, Transform t, Instance JJJ, Integer xxx) throws FQLException {
    Mapping F = deAttr(f);
    Pair<Instance, Map<Attribute<Node>, Map<Object, Object>>> I = deAttr(inter, i, F.source);
    Integer kkk = inter.guid;
    Instance JJJ0 = null;
    Transform ttt = null;
    if (JJJ != null) {
        inter.guid = xxx;
        Pair<Instance, Map<Attribute<Node>, Map<Object, Object>>> JJJ0X = deAttr(inter, JJJ, F.target);
        Pair<Instance, Map<Attribute<Node>, Map<Object, Object>>> qqq = delta(f, F, JJJ0X);
        ttt = deAttr(f.source, I, qqq, t);
        JJJ0 = JJJ0X.first;
        inter.guid = kkk;
    }
    // System.out.println("!!!!!!!!!!!!!!!");
    LeftKan D = new LeftKan(inter.guid, F, I.first, ttt, JJJ0);
    Pair<Instance, Map<Object, List<Pair<String, Object>>>> hhh = sigma(D);
    inter.guid = D.fresh;
    Map<Node, Map<Object, Integer>> etables = makeE(D.ua);
    Instance j = hhh.first;
    Instance ret = reAttr(etables, f.target, j, I.second);
    return new Quad<>(ret, etables, D.utables, hhh.second);
}
Also used : Quad(catdata.Quad) Instance(catdata.fql.decl.Instance) Node(catdata.fql.decl.Node) Mapping(catdata.fql.decl.Mapping) Transform(catdata.fql.decl.Transform) HashMap(java.util.HashMap) Map(java.util.Map) Pair(catdata.Pair)

Example 7 with Mapping

use of catdata.fql.decl.Mapping in project fql by CategoricalData.

the class LeftKanSigma method deAttr.

private static Mapping deAttr(Mapping f) throws FQLException {
    Mapping ret = f.clone();
    deAttr(ret.source);
    deAttr(ret.target);
    for (Attribute<Node> k : ret.am.keySet()) {
        Attribute<Node> v = ret.am.get(k);
        Node src = new Node(k.name);
        Node dst = new Node(v.name);
        Edge srcE = new Edge(k.name + "_edge", k.source, src);
        Edge dstE = new Edge(v.name + "_edge", v.source, dst);
        ret.nm.put(src, dst);
        ret.em.put(srcE, new Path(ret.target, dstE));
    }
    ret.am.clear();
    return ret;
}
Also used : Path(catdata.fql.decl.Path) Node(catdata.fql.decl.Node) Mapping(catdata.fql.decl.Mapping) Edge(catdata.fql.decl.Edge)

Aggregations

Mapping (catdata.fql.decl.Mapping)7 Pair (catdata.Pair)3 Node (catdata.fql.decl.Node)3 Signature (catdata.fql.decl.Signature)3 FQLException (catdata.fql.FQLException)2 Attribute (catdata.fql.decl.Attribute)2 Edge (catdata.fql.decl.Edge)2 Instance (catdata.fql.decl.Instance)2 Path (catdata.fql.decl.Path)2 HashMap (java.util.HashMap)2 LinkedList (java.util.LinkedList)2 Map (java.util.Map)2 JPanel (javax.swing.JPanel)2 Quad (catdata.Quad)1 Triple (catdata.Triple)1 Unit (catdata.Unit)1 Fn (catdata.fql.Fn)1 FullQuery (catdata.fql.decl.FullQuery)1 FullQueryExp (catdata.fql.decl.FullQueryExp)1 InstExp (catdata.fql.decl.InstExp)1