예제 #1
0
 public void write(Statement st) throws IOException {
   stmtCount++;
   if (validate) {
     if (!st.isSubjectAnon()) {
       validateUri(st.getSubjectUri());
     }
     validateUri(st.getPredicateUri());
     if (!st.isObjectAnon() && !st.isLiteral()) validateUri(st.getObjectUri());
   }
   st.write(os, escapeUnicode);
 }
예제 #2
0
  public void writeLiteral(String s, String p, Object o) throws IOException {
    if (validate) {
      if (strictValidator != null) {
        strictValidator.validateLiteral(s, p, o);
      }
      validateUri(s);
      validateUri(p);
    }

    stmtCount++;
    NtWriter.writeLiteral(os, s, p, o, escapeUnicode);
  }
예제 #3
0
  public void writeLiteral(Object s, Object p, Object o) throws IOException {
    if (validate) {
      if (strictValidator != null) {
        strictValidator.validateLiteral(s, p, o);
      }
      validateUri(s.toString());
      validateUri(p.toString());
      validateLiteral(o);
    }

    stmtCount++;
    NtWriter.writeLiteral(os, s.toString(), p.toString(), o, escapeUnicode);
  }
예제 #4
0
  public void writeStatement(String s, String p, String o) throws IOException {
    if (validate) {
      if (strictValidator != null) {
        strictValidator.validateStatement(s, p, o);
      }
      validateUri(s);
      validateUri(p);
      validateUri(o);
    }

    stmtCount++;
    writeResource(s);
    os.write(' ');
    writeResource(p);
    os.write(' ');
    writeResource(o);
    os.write(' ');
    os.write('.');
    os.write('\n');
  }