/** * {@inheritDoc} * * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/448"> * SPARQL 1.1 Update </a> */ @Override public ParsedUpdate parseUpdate(final String updateStr, final String baseURI) throws MalformedQueryException { return new BigdataParsedUpdate(parseUpdate2(updateStr, baseURI)); }
/** * {@inheritDoc} * <p> * The use of the alternative {@link #parseQuery2(String, String)} is * strongly encouraged. * * @return An object which aligns the {@link ASTContainer} with the * {@link ParsedQuery} interface. */ @Override public BigdataParsedQuery parseQuery(final String queryStr, final String baseURI) throws MalformedQueryException { return new BigdataParsedQuery(parseQuery2(queryStr, baseURI)); }
/** grouping by expression, done wrong */ public void test_agg08() throws MalformedQueryException { final String query = "PREFIX : <http://www.example.org/>\n" + "SELECT ((?O1 + ?O2) AS ?O12) (COUNT(?O1) AS ?C)\n" + "WHERE { ?S :p ?O1; :q ?O2 } GROUP BY (?O1 + ?O2)\n" + "ORDER BY ?O12"; negativeTest(query); }
/** * {@inheritDoc} * * This uses the {@link Bigdata2ASTSPARQLParser}. */ @Override protected void parseQuery(String query, String queryFileURL) throws MalformedQueryException { new Bigdata2ASTSPARQLParser().parseQuery(query, queryFileURL); }
/** BASE but otherwise empty UPDATE. */ public void test_syntax_update_39() throws MalformedQueryException { final String query = "BASE <http://example/>\n# Otherwise empty\n"; parseOperation(query); } /** PREFIX but otherwise empty UPDATE. */
@Override final public FunctionNode visit(ASTEncodeForURI node, Object data) throws VisitorException { return unary(node, FN.ENCODE_FOR_URI); }
@Override public FunctionNode visit(ASTSTRUUID node, Object data) throws VisitorException { return noneary(node, FunctionRegistry.STRUUID); }
@Override final public FunctionNode visit(ASTLangMatches node, Object data) throws VisitorException { return binary(node, FunctionRegistry.LANG_MATCHES); }
/** * {@inheritDoc} * <p> * The use of the alternative {@link #parseQuery2(String, String)} is * strongly encouraged. * * @return An object which aligns the {@link ASTContainer} with the * {@link ParsedQuery} interface. */ @Override public BigdataParsedQuery parseQuery(final String queryStr, final String baseURI) throws MalformedQueryException { return new BigdataParsedQuery(parseQuery2(queryStr, baseURI)); }
/** * {@inheritDoc} * * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/448"> * SPARQL 1.1 Update </a> */ @Override public ParsedUpdate parseUpdate(final String updateStr, final String baseURI) throws MalformedQueryException { return new BigdataParsedUpdate(parseUpdate2(updateStr, baseURI)); }
/** * Use of an ungrouped variable in a project expression */ public void test_agg11() throws MalformedQueryException { final String query = "PREFIX : <http://www.example.org/>\n" + "SELECT ((?O1 + ?O2) AS ?O12) (COUNT(?O1) AS ?C)\n" + "WHERE { ?S :p ?O1; :q ?O2 } GROUP BY (?S)"; negativeTest(query); }
/** * PrefixName with hex-encoded colon. */ public void test_qname_escape_02() throws MalformedQueryException { final String query = "PREFIX og: <http://ogp.me/ns#>\n" + "SELECT * WHERE { ?page og:audio%3Atitle ?title }"; parseOperation(query); }
@Override final public FunctionNode visit(ASTUpperCase node, Object data) throws VisitorException { return unary(node, FN.UPPER_CASE); }
/** BNode in DELETE WHERE */ public void test_syntax_update_bad_10() throws MalformedQueryException { final String query = "DELETE WHERE { _:a <:p> <:o> }"; negativeTest(query); }
@Override final public FunctionNode visit(ASTSeconds node, Object data) throws VisitorException { return unary(node, FN.SECONDS_FROM_DATETIME); }
/** grouping by expression, done wrong */ public void test_agg08() throws MalformedQueryException { final String query = "PREFIX : <http://www.example.org/>\n" + "SELECT ((?O1 + ?O2) AS ?O12) (COUNT(?O1) AS ?C)\n" + "WHERE { ?S :p ?O1; :q ?O2 } GROUP BY (?O1 + ?O2)\n" + "ORDER BY ?O12"; negativeTest(query); }
@Override final public FunctionNode visit(ASTSHA512 node, Object data) throws VisitorException { return unary(node, FunctionRegistry.SHA512); }
/** * Same variable can not be projected more than once. */ public void test_syn_bad_03() throws MalformedQueryException { final String query = "SELECT (1 AS ?X) (1 AS ?X) {}"; negativeTest(query); }
@Override final public FunctionNode visit(ASTIsNumeric node, Object data) throws VisitorException { return unary(node, FunctionRegistry.IS_NUMERIC); }