Search in sources :

Example 6 with PointingRelation

use of annis.sqlgen.model.PointingRelation in project ANNIS by korpling.

the class ComponentSearchRelationNormalizer method createJoinMap.

private Multimap<QueryNode, Join> createJoinMap(List<QueryNode> nodes) {
    Multimap<QueryNode, Join> result = HashMultimap.create();
    for (QueryNode n : nodes) {
        for (Join j : n.getOutgoingJoins()) {
            if (j instanceof Dominance || j instanceof PointingRelation) {
                if (j.getTarget() != null) {
                    result.put(n, j);
                    result.put(j.getTarget(), j);
                }
            }
        }
    }
    return result;
}
Also used : PointingRelation(annis.sqlgen.model.PointingRelation) QueryNode(annis.model.QueryNode) Join(annis.model.Join) Dominance(annis.sqlgen.model.Dominance)

Example 7 with PointingRelation

use of annis.sqlgen.model.PointingRelation in project ANNIS by korpling.

the class JoinListener method enterDirectPointing.

@Override
public void enterDirectPointing(AqlParser.DirectPointingContext ctx) {
    QueryNode left = relationChain.get(relationIdx);
    QueryNode right = relationChain.get(relationIdx + 1);
    String label = getLayerName(ctx.POINTING(), 2);
    Join j = new PointingRelation(right, label, 1);
    if (ctx.anno != null) {
        LinkedList<QueryAnnotation> annotations = fromRelationAnnotation(ctx.anno);
        for (QueryAnnotation a : annotations) {
            j.addEdgeAnnotation(a);
        }
    }
    left.addOutgoingJoin(addParsedLocation(ctx, j));
}
Also used : PointingRelation(annis.sqlgen.model.PointingRelation) QueryNode(annis.model.QueryNode) QueryAnnotation(annis.model.QueryAnnotation) Join(annis.model.Join)

Aggregations

PointingRelation (annis.sqlgen.model.PointingRelation)7 QueryNode (annis.model.QueryNode)5 Join (annis.model.Join)3 QueryAnnotation (annis.model.QueryAnnotation)2 SqlConstraints.sqlString (annis.sqlgen.SqlConstraints.sqlString)2 Dominance (annis.sqlgen.model.Dominance)2 TestUtils.uniqueString (annis.test.TestUtils.uniqueString)2 Theory (org.junit.experimental.theories.Theory)2 AnnisQLSemanticsException (annis.exceptions.AnnisQLSemanticsException)1 CommonAncestor (annis.sqlgen.model.CommonAncestor)1 EqualValue (annis.sqlgen.model.EqualValue)1 Identical (annis.sqlgen.model.Identical)1 Inclusion (annis.sqlgen.model.Inclusion)1 LeftAlignment (annis.sqlgen.model.LeftAlignment)1 LeftDominance (annis.sqlgen.model.LeftDominance)1 LeftOverlap (annis.sqlgen.model.LeftOverlap)1 Near (annis.sqlgen.model.Near)1 NotEqualValue (annis.sqlgen.model.NotEqualValue)1 Overlap (annis.sqlgen.model.Overlap)1 Precedence (annis.sqlgen.model.Precedence)1