/** * 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); }
/** PREFIX but otherwise empty UPDATE. */ public void test_syntax_update_30() throws MalformedQueryException { final String query = "PREFIX : <http://example/>\n# Otherwise empty\n"; parseOperation(query); }
/** 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. */
/** * Positive test (originally failed because it was being passed to * parseQuery() rather than parseUpdate()). */ public void test_syntax_update_01() throws MalformedQueryException { final String query="BASE <http://example/base#>\n"+ "PREFIX : <http://example/>\n"+ "LOAD <http://example.org/faraway>"; parseOperation(query); }
/** Empty UPDATE. */ public void test_syntax_update_38() throws MalformedQueryException { final String query = "# Empty\n"; parseOperation(query); }
/** * PrefixName with backslash-escaped colon (qname in select). */ public void test_qname_escape_01b() throws MalformedQueryException { if (!BigdataStatics.runKnownBadTests) { // FIXME See #1076 Negative parser tests return; } final String query = "PREFIX og: <http://ogp.me/ns#>\n" + "SELECT ( og:audio\\:title as ?x )" + "WHERE {?page og:foo ?title}"; parseOperation(query); }
/** * PrefixName with backslash-escaped colons. * <pre> * SELECT * WHERE { * ?page og:audio\:title ?title * } * </pre> * @throws MalformedQueryException * @see syntax-query/qname-escape-01.rq */ public void test_qname_escape_01() throws MalformedQueryException { if (!BigdataStatics.runKnownBadTests) { // FIXME See #1076 Negative parser tests return; } final String query = "PREFIX og: <http://ogp.me/ns#>\n" + " SELECT * WHERE {\n" + " ?page og:audio\\:title ?title\n" + "}"; parseOperation(query); }
/** * Positive test (originally failed because it was being passed to * parseQuery() rather than parseUpdate()). */ public void test_syntax_update_01() throws MalformedQueryException { final String query="BASE <http://example/base#>\n"+ "PREFIX : <http://example/>\n"+ "LOAD <http://example.org/faraway>"; parseOperation(query); }
/** 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. */
/** * 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); }
/** Empty UPDATE. */ public void test_syntax_update_38() throws MalformedQueryException { final String query = "# Empty\n"; parseOperation(query); }
/** PREFIX but otherwise empty UPDATE. */ public void test_syntax_update_30() throws MalformedQueryException { final String query = "PREFIX : <http://example/>\n# Otherwise empty\n"; parseOperation(query); }
/** * PrefixName with backslash-escaped colon (qname in select). */ public void test_qname_escape_01b() throws MalformedQueryException { if (!BigdataStatics.runKnownBadTests) { // FIXME See #1076 Negative parser tests return; } final String query = "PREFIX og: <http://ogp.me/ns#>\n" + "SELECT ( og:audio\\:title as ?x )" + "WHERE {?page og:foo ?title}"; parseOperation(query); }
/** * Parse with expectation of failure. * * @param query * The query or update request. */ private void negativeTest(final String query) { try { parseOperation(query); fail("Negative test - should fail"); } catch (MalformedQueryException ex) { // Ignore expected exception. } }
/** * PrefixName with backslash-escaped colons. * <pre> * SELECT * WHERE { * ?page og:audio\:title ?title * } * </pre> * @throws MalformedQueryException * @see syntax-query/qname-escape-01.rq */ public void test_qname_escape_01() throws MalformedQueryException { if (!BigdataStatics.runKnownBadTests) { // FIXME See #1076 Negative parser tests return; } final String query = "PREFIX og: <http://ogp.me/ns#>\n" + " SELECT * WHERE {\n" + " ?page og:audio\\:title ?title\n" + "}"; parseOperation(query); }
/** * Parse with expectation of failure. * * @param query * The query or update request. */ private void negativeTest(final String query) { try { parseOperation(query); fail("Negative test - should fail"); } catch (MalformedQueryException ex) { // Ignore expected exception. } }