@Test public void Modify() throws IOException { UpdateClause modify = parse("MODIFY DELETE { ?s ?p ?o } INSERT { ?s ?p2 ?o2 }"); assertEquals(UpdateClause.Type.MODIFY, modify.getType()); assertEquals("?s ?p ?o", modify.getDelete()); assertEquals("?s ?p2 ?o2", modify.getInsert()); }
private UpdateClause modify() throws IOException { UpdateClause modify = new UpdateClause(prefixes, UpdateClause.Type.MODIFY); nextChar(); while (in(LT)) { pushback(); modify.addInto(uri()); skipWhitespace(); nextChar(); } skipWhileIn(DELETE, WS); modify.setDelete(block()); skipWhileIn(INSERT, WS); modify.setInsert(block()); skipWhitespace(); nextChar(); if (ch > -1 && ch < 65535) { skipWhileIn(WHERE, WS); modify.setPattern(block()); } return modify; }
SPARQLUpdateParser { private UpdateClause modify() throws IOException { UpdateClause modify = new UpdateClause(prefixes, UpdateClause.Type.MODIFY); nextChar(); while (in(LT)) { pushback(); modify.addInto(uri()); skipWhitespace(); nextChar(); } skipWhileIn(DELETE, WS); modify.setDelete(block()); skipWhileIn(INSERT, WS); modify.setInsert(block()); skipWhitespace(); nextChar(); if (ch > -1 && ch < 65535) { skipWhileIn(WHERE, WS); modify.setPattern(block()); } return modify; } }
SPARQLUpdateParser { private UpdateClause modify() throws IOException { UpdateClause modify = new UpdateClause(prefixes, UpdateClause.Type.MODIFY); nextChar(); while (in(LT)) { pushback(); modify.addInto(uri()); skipWhitespace(); nextChar(); } skipWhileIn(DELETE, WS); modify.setDelete(block()); skipWhileIn(INSERT, WS); modify.setInsert(block()); skipWhitespace(); nextChar(); if (ch > -1 && ch < 65535) { skipWhileIn(WHERE, WS); modify.setPattern(block()); } return modify; }  }
SPARQLUpdateParser { private UpdateClause modify() throws IOException { UpdateClause modify = new UpdateClause(prefixes, UpdateClause.Type.MODIFY); nextChar(); while (in(LT)) { pushback(); modify.addInto(uri()); skipWhitespace(); nextChar(); } skipWhileIn(DELETE, WS); modify.setDelete(block()); skipWhileIn(INSERT, WS); modify.setInsert(block()); skipWhitespace(); nextChar(); if (ch > -1 && ch < 65535) { skipWhileIn(WHERE, WS); modify.setPattern(block()); } return modify; }  UpdateClause parse(String str); UpdateClause parse(InputStream in); UpdateClause parse(InputStream in, String charset); String collectWhileIn(CharSet... charSets); String collectWhileNotIn(CharSet... charSets); @Override String toString(); }
SPARQLUpdateParser { private UpdateClause modify() throws IOException { UpdateClause modify = new UpdateClause(prefixes, UpdateClause.Type.MODIFY); nextChar(); while (in(LT)) { pushback(); modify.addInto(uri()); skipWhitespace(); nextChar(); } skipWhileIn(DELETE, WS); modify.setDelete(block()); skipWhileIn(INSERT, WS); modify.setInsert(block()); skipWhitespace(); nextChar(); if (ch > -1 && ch < 65535) { skipWhileIn(WHERE, WS); modify.setPattern(block()); } return modify; }  UpdateClause parse(String str); UpdateClause parse(InputStream in); UpdateClause parse(InputStream in, String charset); String collectWhileIn(CharSet... charSets); String collectWhileNotIn(CharSet... charSets); @Override String toString();  }