Package org.jrdf.query.relation

Examples of org.jrdf.query.relation.EvaluatedRelation


    }

    @Override
    public EvaluatedRelation visitOptional(Optional optional) {
        clearCacheHandler();
        EvaluatedRelation lhs = getExpression(optional.getLhs());
        clearCacheHandler();
        EvaluatedRelation rhs = getExpression(optional.getRhs());
        return leftOuterJoin.join(lhs, rhs);
    }
View Full Code Here


    private EvaluatedRelation doCachedConstraint(SingleConstraint constraint, Attribute curAttr) {
        Set<Tuple> tuples = new HashSet<Tuple>();
        Set<Node> voSet = cacheHandler.getCachedValues(curAttr.getAttributeName());
        for (Node newVO : voSet) {
            constraint.setAttributeValue(curAttr, newVO);
            EvaluatedRelation tmpRelation = restrict.restrict(result, constraint.getAvo(allVariables));
            tuples.addAll(tmpRelation.getTuples());
            tmpRelation = null;
        }
        return RELATION_FACTORY.getRelation(constraint.getAvo(allVariables).keySet(), tuples);
    }
View Full Code Here

    // TODO (AN) Add tuple subsumption i.e. go through the results and remove the results for a given attribute binding
    // that have null values.  Or add it to a new time of join.  Or replace this with minimum union and tuple
    // subsumption.

    public EvaluatedRelation join(EvaluatedRelation relation1, EvaluatedRelation relation2) {
        EvaluatedRelation leftOuterJoinResult = leftOuterJoin.join(relation1, relation2);
        EvaluatedRelation antiJoinResult = antiJoin.join(relation2, relation1);
        return union.union(leftOuterJoinResult, antiJoinResult);
    }
View Full Code Here

        this.naturalJoin = newNaturalJoin;
        this.union = newUnion;
    }

    public EvaluatedRelation join(EvaluatedRelation relation1, EvaluatedRelation relation2) {
        EvaluatedRelation antiJoinResult = antiJoin.join(relation1, relation2);
        Set<EvaluatedRelation> relations = new HashSet<EvaluatedRelation>();
        relations.add(relation1);
        relations.add(relation2);
        EvaluatedRelation joinResult = naturalJoin.join(relations);
        return union.union(joinResult, antiJoinResult);
    }
View Full Code Here

        this.tupleEngine = newTupleEngine;
        this.relationProcessor = newRelationProcessor;
    }

    public EvaluatedRelation join(EvaluatedRelation relation1, EvaluatedRelation relation2) {
        EvaluatedRelation relation = isDeeDumOrSame(relation1, relation2);
        if (relation == null) {
            LinkedHashSet<EvaluatedRelation> relations = new LinkedHashSet<EvaluatedRelation>();
            relations.add(relation1);
            relations.add(relation2);
            relation = relationProcessor.processRelations(relations, tupleEngine);
View Full Code Here

        }
        return relation;
    }

    private EvaluatedRelation isDeeDumOrSame(EvaluatedRelation relation1, EvaluatedRelation relation2) {
        EvaluatedRelation relation = null;
        if (relation1 == RELATION_DUM || relation2 == RELATION_DUM) {
            relation = RELATION_DUM;
        } else if (relation1 == RELATION_DEE) {
            relation = RELATION_DEE;
        } else if (relation1 == relation2 || relation1.equals(relation2)) {
View Full Code Here

        this.semiJoin = newSemiJoin;
        this.semiDifference = newSemiDifference;
    }

    public EvaluatedRelation join(EvaluatedRelation relation1, EvaluatedRelation relation2) {
        EvaluatedRelation semiJoinResult = semiJoin.join(relation1, relation2);
        return semiDifference.minus(relation1, semiJoinResult);
    }
View Full Code Here

TOP

Related Classes of org.jrdf.query.relation.EvaluatedRelation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.