protected ExistsNode exists(VarNode v, GraphPatternGroup<IGroupMemberNode> jg) { v.setAnonymous(true); ExistsNode existsNode = new ExistsNode(v, jg); existsNode.setValueExpression(toValueExpression(v)); return existsNode; }
protected ExistsNode exists(VarNode v, GraphPatternGroup<IGroupMemberNode> jg) { v.setAnonymous(true); ExistsNode existsNode = new ExistsNode(v, jg); existsNode.setValueExpression(toValueExpression(v)); return existsNode; }
/** * Note: EXISTS is basically an ASK subquery. * * @see ExistsNode */ @Override final public ExistsNode visit(final ASTExistsFunc node, Object data) throws VisitorException { final VarNode anonvar = context.createAnonVar("-exists-"); /* * Use a new (empty) graph pattern to prevent the accept of the child * from being attached into the parent's graph pattern context. */ final GroupGraphPattern parentGP = graphPattern; graphPattern = scopedGroupGraphPattern(node); @SuppressWarnings("unchecked") final GraphPatternGroup<IGroupMemberNode> innerGraphPattern = (GraphPatternGroup<IGroupMemberNode>) node .jjtGetChild(0).jjtAccept(this/* visitor */, null); final ExistsNode fn = new ExistsNode(anonvar, innerGraphPattern); // Restore the parent's context. graphPattern = parentGP; return fn; }
/** * Note: EXISTS is basically an ASK subquery. * * @see ExistsNode */ @Override final public ExistsNode visit(final ASTExistsFunc node, Object data) throws VisitorException { final VarNode anonvar = context.createAnonVar("-exists-"); /* * Use a new (empty) graph pattern to prevent the accept of the child * from being attached into the parent's graph pattern context. */ final GroupGraphPattern parentGP = graphPattern; graphPattern = scopedGroupGraphPattern(node); @SuppressWarnings("unchecked") final GraphPatternGroup<IGroupMemberNode> innerGraphPattern = (GraphPatternGroup<IGroupMemberNode>) node .jjtGetChild(0).jjtAccept(this/* visitor */, null); final ExistsNode fn = new ExistsNode(anonvar, innerGraphPattern); // Restore the parent's context. graphPattern = parentGP; return fn; }
protected ExistsNode exists(VarNode v, GraphPatternGroup<IGroupMemberNode> jg) { v.setAnonymous(true); ExistsNode existsNode = new ExistsNode(v, jg); existsNode.setValueExpression(toValueExpression(v)); return existsNode; }
whereClause.addChild(new FilterNode(new ExistsNode(anonvar, existsPattern)));
whereClause.addChild(new FilterNode(new ExistsNode(anonvar, existsPattern)));
existsGroup.addChild(new StatementPatternNode(new VarNode("x"), new ConstantNode(grade), new VarNode("b"))); filterNode = new FilterNode(new ExistsNode(new VarNode( "anon-var-1"), existsGroup)); whereClause.addChild(filterNode);
existsGroup.addChild(new StatementPatternNode(new VarNode("x"), new ConstantNode(grade), new VarNode("b"))); filterNode = new FilterNode(new ExistsNode(new VarNode( "anon-var-1"), existsGroup)); whereClause.addChild(filterNode);
existsGroup.addChild(new StatementPatternNode(new VarNode("x"), new ConstantNode(grade), new VarNode("b"))); filterNode = new FilterNode(new ExistsNode(new VarNode( "anon-var-1"), existsGroup)); whereClause.addChild(filterNode);