예제 #1
0
 public static void output(Update update, IndentedWriter out, SerializationContext sCxt) {
   if (sCxt == null) sCxt = new SerializationContext();
   prologue(out, sCxt.getPrologue());
   outputUpdate(update, out, sCxt);
   // Update operations do not end in newline.
   out.flush();
 }
예제 #2
0
    private void outputQuad(Quad quad) {
      String qs = FmtUtils.stringForQuad(quad, sCxt.getPrefixMapping());

      if (quad.getGraph() != null) {
        String g = FmtUtils.stringForNode(quad.getGraph(), sCxt);
        out.print(g);
        out.print(" ");
      }
      outputTripleOfQuad(quad);
      out.println(" .");
    }
예제 #3
0
  public static void output(UpdateRequest request, IndentedWriter out, SerializationContext sCxt) {
    if (sCxt == null) sCxt = new SerializationContext(request);
    prologue(out, sCxt.getPrologue());
    boolean addSeparator = (request.getOperations().size() > 1);
    boolean first = true;

    for (Update update : request.getOperations()) {
      out.ensureStartOfLine();
      if (!first) out.println();
      first = false;
      outputUpdate(update, out, sCxt);
      if (addSeparator) out.print(" ;");
    }

    // Update requests always end in newline.
    out.ensureStartOfLine();
    out.flush();
  }