Package org.jrdf.query.expression

Examples of org.jrdf.query.expression.Conjunction


        Expression tmpExpression = constructFilteredConjunction(lhs, rhs);
        if (tmpExpression == null) {
            tmpExpression = constructUnionedConjunction(lhs, rhs);
            if (tmpExpression == null) {
                if (EXPRESSION_COMPARATOR.compare(lhs, rhs) <= 0) {
                    tmpExpression = new Conjunction(lhs, rhs);
                } else {
                    tmpExpression = new Conjunction(rhs, lhs);
                }
            }
        }
        return tmpExpression;
    }
View Full Code Here


    private Expression constructFilteredConjunction(Expression lhs, Expression rhs) {
        Expression tmpExpression = null;
        if (lhs instanceof Filter && rhs instanceof Filter) {
            Expression llhs = ((Filter) lhs).getLhs();
            Expression lrhs = ((Filter) rhs).getLhs();
            tmpExpression = new Conjunction(llhs, lrhs);
            LogicExpression andExp = new LogicAndExpression(((Filter) lhs).getRhs(),
                ((Filter) rhs).getRhs());
            tmpExpression = new Filter(tmpExpression, andExp);
        } else if (lhs instanceof Filter) {
            tmpExpression = constructConjFilter((Filter) lhs, rhs);
View Full Code Here

    }

    private Expression constructConjFilter(Filter lhs, Expression rhs) {
        Expression result;
        Expression llhs = lhs.getLhs();
        result = new Conjunction(llhs, rhs);
        result = new Filter(result, lhs.getRhs());
        return result;
    }
View Full Code Here

    }

    private Expression distributeConjunctionWithUnion(Union lhs, Expression rhs) {
        Expression uLhs = lhs.getLhs();
        Expression uRhs = lhs.getRhs();
        Expression newConj1 = getNext(new Conjunction(rhs, uLhs));
        Expression newConj2 = getNext(new Conjunction(rhs, uRhs));
        return getNext(new Union(newConj1, newConj2));
    }
View Full Code Here

    private void handleExpressions(Expression lhs, Expression rhs) {
        if (lhs != null) {
            if (Optional.class.isAssignableFrom(rhs.getClass())) {
                handleOptional(lhs, rhs);
            } else if (Conjunction.class.isAssignableFrom(rhs.getClass())) {
                Conjunction conjunction = (Conjunction) rhs;
                if (conjunction.getLhs() != null) {
                    expression = new Conjunction(lhs, rhs);
                } else {
                    conjunction.setLhs(lhs);
                    expression = rhs;
                }
            } else if (Constraint.class.isAssignableFrom(rhs.getClass()) &&
                (Constraint.class.isAssignableFrom(lhs.getClass()))) {
                expression = new Conjunction(lhs, rhs);
            } else if (LogicExpression.class.isAssignableFrom(rhs.getClass())) {
                expression = new Filter(lhs, (LogicExpression) rhs);
            } else if (LogicExpression.class.isAssignableFrom(lhs.getClass())) {
                expression = new Filter(rhs, (LogicExpression) lhs);
            } else {
                expression = new Conjunction(lhs, rhs);
            }
        } else {
            expression = rhs;
        }
    }
View Full Code Here

                Expression rhs = getExpression((org.jrdf.sparql.parser.node.Node) pMoreTriples.clone());
                expressions.add(rhs);
            }
            Expression lhsSide = lhs;
            for (Expression currentExpression : expressions) {
                lhsSide = new Conjunction(lhsSide, currentExpression);
            }
            expression = lhsSide;
        } else {
            super.caseABlockOfTriples(node);
        }
View Full Code Here

    }

    private void handleOptional(Expression lhs, Expression rhs) {
        Optional rhsOptional = (Optional) rhs;
        if (rhsOptional.getLhs() != null) {
            expression = new Conjunction(lhs, rhsOptional);
        } else {
            rhsOptional.setLhs(lhs);
            expression = rhsOptional;
        }
    }
View Full Code Here

TOP

Related Classes of org.jrdf.query.expression.Conjunction

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.