AST2BOpContext getAST2BOpContext(QueryRoot given) { return new AST2BOpContext(new ASTContainer(given), store) { @Override public ISolutionSetStats getSolutionSetStats(final String localName) { if ("solutionSet".equals(localName)) { return sss; } return super.getSolutionSetStats(localName); } }; } }
AST2BOpContext getAST2BOpContext(QueryRoot given) { return new AST2BOpContext(new ASTContainer(given), store) { @Override public ISolutionSetStats getSolutionSetStats(final String localName) { if ("solutionSet".equals(localName)) { return sss; } return super.getSolutionSetStats(localName); } }; } }
AST2BOpContext getAST2BOpContext(QueryRoot given) { return new AST2BOpContext(new ASTContainer(given), store); }
AST2BOpContext getAST2BOpContext(QueryRoot given) { return new AST2BOpContext(new ASTContainer(given), store); }
AST2BOpContext getAST2BOpContext(QueryRoot given) { return new AST2BOpContext(new ASTContainer(given), store) { @Override public ISolutionSetStats getSolutionSetStats(final String localName) { if ("solutionSet".equals(localName)) { return sss; } return super.getSolutionSetStats(localName); } }; } }
AST2BOpContext getAST2BOpContext(QueryRoot given) { return new AST2BOpContext(new ASTContainer(given), store); }
/** * Creates a {@link StaticAnalysis} object for the nodes by setting up a * SELECT query with a single {@link JoinGroupNode} comprising the nodes * in its body to retrieve the {@link StaticAnalysis} object. */ StaticAnalysis statisAnalysisForNodes(List<IGroupMemberNode> nodes) { final IGroupMemberNode[] nodesArr = nodes.toArray(new IGroupMemberNode[nodes.size()]); final JoinGroupNode jgn = (JoinGroupNode) new Helper(){{ tmp = joinGroupNode((Object[])nodesArr); }}.getTmp(); final QueryRoot queryRoot = new QueryRoot(QueryType.SELECT); queryRoot.setWhereClause(jgn); return new StaticAnalysis( queryRoot, new AST2BOpContext(new ASTContainer(queryRoot), store)); }
/** * Creates a {@link StaticAnalysis} object for the nodes by setting up a * SELECT query with a single {@link JoinGroupNode} comprising the nodes * in its body to retrieve the {@link StaticAnalysis} object. */ StaticAnalysis statisAnalysisForNodes(List<IGroupMemberNode> nodes) { final IGroupMemberNode[] nodesArr = nodes.toArray(new IGroupMemberNode[nodes.size()]); final JoinGroupNode jgn = (JoinGroupNode) new Helper(){{ tmp = joinGroupNode((Object[])nodesArr); }}.getTmp(); final QueryRoot queryRoot = new QueryRoot(QueryType.SELECT); queryRoot.setWhereClause(jgn); return new StaticAnalysis( queryRoot, new AST2BOpContext(new ASTContainer(queryRoot), store)); }
/** * Creates a {@link StaticAnalysis} object for the nodes by setting up a * SELECT query with a single {@link JoinGroupNode} comprising the nodes * in its body to retrieve the {@link StaticAnalysis} object. */ StaticAnalysis statisAnalysisForNodes(List<IGroupMemberNode> nodes) { final IGroupMemberNode[] nodesArr = nodes.toArray(new IGroupMemberNode[nodes.size()]); final JoinGroupNode jgn = (JoinGroupNode) new Helper(){{ tmp = joinGroupNode((Object[])nodesArr); }}.getTmp(); final QueryRoot queryRoot = new QueryRoot(QueryType.SELECT); queryRoot.setWhereClause(jgn); return new StaticAnalysis( queryRoot, new AST2BOpContext(new ASTContainer(queryRoot), store)); }
final ASTContainer astContainer = new ASTContainer(BOp.NOARGS, BOp.NOANNS);
final ASTContainer astContainer = new ASTContainer(BOp.NOARGS, BOp.NOANNS);
final ASTContainer astContainer = new ASTContainer(queryRoot);
final ASTContainer astContainer = new ASTContainer(queryRoot);
@SuppressWarnings("serial") public void testNamedSubquery() { final NamedSubqueryInclude nsi = (NamedSubqueryInclude) new Helper() {{ tmp = namedSubQueryInclude("_set1"); }}.getTmp(); final QueryRoot query = (QueryRoot) new Helper(){{ tmp = select( varNodes(x,y,y), namedSubQuery("_set1",varNode(x),where(statementPatternNode(varNode(x), constantNode(a), constantNode(b),1))), where(nsi,statementPatternNode(varNode(x), constantNode(c), varNode(y),1,OPTIONAL) ) ); }}.getTmp(); final AST2BOpContext context = new AST2BOpContext(new ASTContainer(query), store); final StaticAnalysis sa = new StaticAnalysis(query, context); final Set<IVariable<?>> requiredBound = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBound = new HashSet<IVariable<?>>() {{ add(Var.var("x")); }}; assertEquals(requiredBound, nsi.getRequiredBound(sa)); assertEquals(desiredBound, nsi.getDesiredBound(sa)); }
@SuppressWarnings("serial") public void testNamedSubquery() { final NamedSubqueryInclude nsi = (NamedSubqueryInclude) new Helper() {{ tmp = namedSubQueryInclude("_set1"); }}.getTmp(); final QueryRoot query = (QueryRoot) new Helper(){{ tmp = select( varNodes(x,y,y), namedSubQuery("_set1",varNode(x),where(statementPatternNode(varNode(x), constantNode(a), constantNode(b),1))), where(nsi,statementPatternNode(varNode(x), constantNode(c), varNode(y),1,OPTIONAL) ) ); }}.getTmp(); final AST2BOpContext context = new AST2BOpContext(new ASTContainer(query), store); final StaticAnalysis sa = new StaticAnalysis(query, context); final Set<IVariable<?>> requiredBound = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBound = new HashSet<IVariable<?>>() {{ add(Var.var("x")); }}; assertEquals(requiredBound, nsi.getRequiredBound(sa)); assertEquals(desiredBound, nsi.getDesiredBound(sa)); }
new AST2BOpContext(new ASTContainer(query), store); final StaticAnalysis sa = new StaticAnalysis(query, context);
new AST2BOpContext(new ASTContainer(query), store); final StaticAnalysis sa = new StaticAnalysis(query, context);
final ASTContainer astContainer = new ASTContainer(queryRoot);
@SuppressWarnings("serial") public void testNamedSubquery() { final NamedSubqueryInclude nsi = (NamedSubqueryInclude) new Helper() {{ tmp = namedSubQueryInclude("_set1"); }}.getTmp(); final QueryRoot query = (QueryRoot) new Helper(){{ tmp = select( varNodes(x,y,y), namedSubQuery("_set1",varNode(x),where(statementPatternNode(varNode(x), constantNode(a), constantNode(b),1))), where(nsi,statementPatternNode(varNode(x), constantNode(c), varNode(y),1,OPTIONAL) ) ); }}.getTmp(); final AST2BOpContext context = new AST2BOpContext(new ASTContainer(query), store); final StaticAnalysis sa = new StaticAnalysis(query, context); final Set<IVariable<?>> requiredBound = new HashSet<IVariable<?>>(); final Set<IVariable<?>> desiredBound = new HashSet<IVariable<?>>() {{ add(Var.var("x")); }}; assertEquals(requiredBound, nsi.getRequiredBound(sa)); assertEquals(desiredBound, nsi.getDesiredBound(sa)); }
new AST2BOpContext(new ASTContainer(query), store); final StaticAnalysis sa = new StaticAnalysis(query, context);