Package org.jrdf.query.expression

Examples of org.jrdf.query.expression.Expression


        return expression;
    }

    @Override
    public void caseAFilteredBasicGraphPatternGraphPattern(AFilteredBasicGraphPatternGraphPattern node) {
        Expression lhs = getExpression((org.jrdf.sparql.parser.node.Node) node.getFilteredBasicGraphPattern().clone());
        if (node.getOperationPattern() != null) {
            expression = lhs;
            LinkedList<POperationPattern> list = node.getOperationPattern();
            for (POperationPattern pOperationPattern : list) {
                Expression rhs = getExpression((org.jrdf.sparql.parser.node.Node) pOperationPattern.clone());
                handleExpressions(expression, rhs);
            }
        } else {
            super.caseAFilteredBasicGraphPatternGraphPattern(node);
        }
View Full Code Here


    }

    @Override
    public void caseABlockOfTriples(ABlockOfTriples node) {
        if (!node.getMoreTriples().isEmpty()) {
            Expression lhs = getExpression((org.jrdf.sparql.parser.node.Node) node.getTriple().clone());
            LinkedList<PMoreTriples> moreTriples = node.getMoreTriples();
            List<Expression> expressions = new ArrayList<Expression>();
            for (PMoreTriples pMoreTriples : moreTriples) {
                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 {
View Full Code Here

    }

    @Override
    public void caseAGraphPatternOrFilterGraphPatternOperationPattern(
        AGraphPatternOrFilterGraphPatternOperationPattern node) {
        Expression lhs = getExpression((org.jrdf.sparql.parser.node.Node) node.getGraphPatternOrFilter().clone());
        Expression rhs = getExpression((org.jrdf.sparql.parser.node.Node) node.getFilteredBasicGraphPattern().clone());
        if (lhs != null && rhs != null) {
            handleExpressions(rhs, lhs);
        } else if (lhs != null) {
            expression = lhs;
        } else if (rhs != null) {
View Full Code Here

    }

    @Override
    public void caseAGroupOrUnionGraphPattern(AGroupOrUnionGraphPattern node) {
        if (node.getUnionGraphPattern() != null) {
            Expression lhs = getExpressionWithEmptyConstraint(
                (org.jrdf.sparql.parser.node.Node) node.getGroupGraphPattern().clone());
            LinkedList<PUnionGraphPattern> unionGraphPattern = node.getUnionGraphPattern();
            List<Expression> expressions = new ArrayList<Expression>();
            for (PUnionGraphPattern pUnionGraphPattern : unionGraphPattern) {
                Expression rhs = getExpressionWithEmptyConstraint(
                    (org.jrdf.sparql.parser.node.Node) pUnionGraphPattern.clone());
                expressions.add(rhs);
            }
            Expression lhsSide = lhs;
            for (Expression currentExpression : expressions) {
                lhsSide = new Union(lhsSide, currentExpression);
            }
            expression = lhsSide;
        } else {
View Full Code Here

        }
    }

    @Override
    public void caseAOptionalGraphPattern(AOptionalGraphPattern node) {
        Expression rhs = getExpression((PGroupGraphPattern) node.getGroupGraphPattern().clone());
        expression = new Optional(rhs);
    }
View Full Code Here

            expression = rhsOptional;
        }
    }

    private Expression getExpressionWithEmptyConstraint(org.jrdf.sparql.parser.node.Node node) {
        Expression result = getExpression(node);
        if (result == null) {
            return EMPTY_CONSTRAINT;
        } else {
            return result;
        }
View Full Code Here

    @Override
    public void caseAWildcardSelectClause(AWildcardSelectClause node) {
        try {
            WhereAnalyser analyser = analyseWhereClause(node.parent());
            Expression nextExpression = analyser.getExpression();
            declaredVariables.addAll(variableCollector.getAttributes().keySet());
            expression = new Projection(variableCollector, declaredVariables, nextExpression);
        } catch (ParserException e) {
            exception = e;
        }
View Full Code Here

    @Override
    public void caseAVariableListSelectClause(AVariableListSelectClause node) {
        try {
            WhereAnalyser analyser = analyseWhereClause(node.parent());
            Expression nextExpression = analyser.getExpression();
            super.caseAVariableListSelectClause(node);
            expression = new Projection(variableCollector, declaredVariables, nextExpression);
        } catch (ParserException e) {
            exception = e;
        }
View Full Code Here

TOP

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

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.