Search in sources :

Example 11 with XSchema

use of catdata.fpql.XExp.XSchema in project fql by CategoricalData.

the class EnrichViewer method merge.

private static Triple<XSchema, XPoly<String, String>, XPoly<String, String>> merge(XSchema isa, XSchema mat, String isa0, String mat0, String merged) {
    Set<String> nodes = new HashSet<>();
    Set<Triple<String, String, String>> arrows = new HashSet<>();
    Set<Pair<List<String>, List<String>>> eqs = new HashSet<>();
    nodes.addAll(isa.nodes);
    nodes.addAll(mat.nodes);
    arrows.addAll(isa.arrows);
    arrows.addAll(mat.arrows);
    eqs.addAll(isa.eqs);
    eqs.addAll(mat.eqs);
    XSchema ret1 = new XSchema(new LinkedList<>(nodes), new LinkedList<>(arrows), new LinkedList<>(eqs));
    return new Triple<>(ret1, idPoly(isa, isa0, merged), idPoly(mat, mat0, merged));
}
Also used : Triple(catdata.Triple) XSchema(catdata.fpql.XExp.XSchema) HashSet(java.util.HashSet) Pair(catdata.Pair)

Aggregations

XSchema (catdata.fpql.XExp.XSchema)11 Pair (catdata.Pair)9 Triple (catdata.Triple)9 LinkedList (java.util.LinkedList)6 List (java.util.List)4 Tuple3 (org.jparsec.functors.Tuple3)4 Tuple5 (org.jparsec.functors.Tuple5)4 Var (catdata.fpql.XExp.Var)3 XInst (catdata.fpql.XExp.XInst)3 HashSet (java.util.HashSet)3 Util (catdata.Util)2 XMapConst (catdata.fpql.XExp.XMapConst)2 XPair (catdata.fpql.XExp.XPair)2 CodeTextPanel (catdata.ide.CodeTextPanel)2 Example (catdata.ide.Example)2 BorderLayout (java.awt.BorderLayout)2 Dimension (java.awt.Dimension)2 GridLayout (java.awt.GridLayout)2 ActionEvent (java.awt.event.ActionEvent)2 HashMap (java.util.HashMap)2