assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
/** * Unit test for SELECT query with a wildcard (<code>*</code>). * * <pre> * SELECT * where {?s ?p ?o} * </pre> */ public void test_select_star() throws MalformedQueryException, TokenMgrError, ParseException { final String sparql = "select * where {?s ?p ?o}"; final QueryRoot expected = new QueryRoot(QueryType.SELECT); { { final Map<String, String> prefixDecls = new LinkedHashMap<String, String>(PrefixDeclProcessor.defaultDecls); expected.setPrefixDecls(prefixDecls); } final ProjectionNode projection = new ProjectionNode(); projection.addProjectionVar(new VarNode("*")); expected.setProjection(projection); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS)); expected.setWhereClause(whereClause); } final QueryRoot actual = parse(sparql, baseURI); assertSameAST(sparql, expected, actual); }
assertSameAST(sparql, expected, actual);
/** * Unit test for simple SELECT query * * <pre> * SELECT ?s where {?s ?p ?o} * </pre> */ public void test_select_s_where_s_p_o() throws MalformedQueryException, TokenMgrError, ParseException { final String sparql = "select ?s where {?s ?p ?o}"; final QueryRoot expected = new QueryRoot(QueryType.SELECT); { { final Map<String, String> prefixDecls = new LinkedHashMap<String, String>(PrefixDeclProcessor.defaultDecls); expected.setPrefixDecls(prefixDecls); } final ProjectionNode projection = new ProjectionNode(); projection.addProjectionVar(new VarNode("s")); expected.setProjection(projection); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS)); expected.setWhereClause(whereClause); } final QueryRoot actual = parse(sparql, baseURI); assertSameAST(sparql, expected, actual); }
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
/** * Unit test for simple SELECT query * * <pre> * SELECT ?s where {?s ?p ?o} * </pre> */ public void test_select_s_where_s_p_o() throws MalformedQueryException, TokenMgrError, ParseException { final String sparql = "select ?s where {?s ?p ?o}"; final QueryRoot expected = new QueryRoot(QueryType.SELECT); { { final Map<String, String> prefixDecls = new LinkedHashMap<String, String>(PrefixDeclProcessor.defaultDecls); expected.setPrefixDecls(prefixDecls); } final ProjectionNode projection = new ProjectionNode(); projection.addProjectionVar(new VarNode("s")); expected.setProjection(projection); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS)); expected.setWhereClause(whereClause); } final QueryRoot actual = parse(sparql, baseURI); assertSameAST(sparql, expected, actual); }
/** * Unit test for SELECT query with a wildcard (<code>*</code>). * * <pre> * SELECT * where {?s ?p ?o} * </pre> */ public void test_select_star() throws MalformedQueryException, TokenMgrError, ParseException { final String sparql = "select * where {?s ?p ?o}"; final QueryRoot expected = new QueryRoot(QueryType.SELECT); { { final Map<String, String> prefixDecls = new LinkedHashMap<String, String>(PrefixDeclProcessor.defaultDecls); expected.setPrefixDecls(prefixDecls); } final ProjectionNode projection = new ProjectionNode(); projection.addProjectionVar(new VarNode("*")); expected.setProjection(projection); final JoinGroupNode whereClause = new JoinGroupNode(); whereClause.addChild(new StatementPatternNode(new VarNode("s"), new VarNode("p"), new VarNode("o"), null/* c */, Scope.DEFAULT_CONTEXTS)); expected.setWhereClause(whereClause); } final QueryRoot actual = parse(sparql, baseURI); assertSameAST(sparql, expected, actual); }
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);
assertSameAST(sparql, expected, actual);