public static void output(UpdateRequest request, IndentedWriter out) { Prologue prologue = request ; if ( ! request.explicitlySetBaseURI() ) prologue = new Prologue(request.getPrefixMapping(), (IRIResolver)null) ; SerializationContext sCxt = new SerializationContext(prologue, new NodeToLabelMapBNode()) ; output(request, out, sCxt); }
public static void checkUpdate(UpdateRequest req, Syntax syntax) { IndentedLineBuffer w = new IndentedLineBuffer() ; UpdateWriter.output(req, w) ; String updateString2 = w.asString() ; UpdateRequest req2; try { String baseURI = null ; if ( ! req.explicitlySetBaseURI() ) baseURI = req.getBaseURI() ; req2 = UpdateFactory.create(updateString2, syntax) ; } catch (UnsupportedOperationException ex) { // No parser after all. return ; } catch (QueryException ex) { System.err.println(updateString2) ; throw new QueryCheckException("could not parse output update request", ex) ; } // if ( req.hashCode() != req2.hashCode() ) // throw new UpdateCheckException("reparsed query hashCode does not equal parsed input update \nUpdate (hashCode: " + req.hashCode() + ")=\n" + req + "\n\nUpdate2 (hashCode: " + req2.hashCode() + ")=\n" + req2) ; // // if ( ! req.equals(req2) ) // throw new UpdateCheckException("reparsed output does not equal parsed input") ; }
public static void checkUpdate(UpdateRequest req, Syntax syntax) { IndentedLineBuffer w = new IndentedLineBuffer() ; UpdateWriter.output(req, w) ; String updateString2 = w.asString() ; UpdateRequest req2; try { String baseURI = null ; if ( ! req.explicitlySetBaseURI() ) baseURI = req.getBaseURI() ; req2 = UpdateFactory.create(updateString2, syntax) ; } catch (UnsupportedOperationException ex) { // No parser after all. return ; } catch (QueryException ex) { System.err.println(updateString2) ; throw new QueryCheckException("could not parse output update request", ex) ; } // if ( req.hashCode() != req2.hashCode() ) // throw new UpdateCheckException("reparsed query hashCode does not equal parsed input update \nUpdate (hashCode: " + req.hashCode() + ")=\n" + req + "\n\nUpdate2 (hashCode: " + req2.hashCode() + ")=\n" + req2) ; // // if ( ! req.equals(req2) ) // throw new UpdateCheckException("reparsed output does not equal parsed input") ; }