Beispiel #1
0
 @Override
 protected void writeURI(org.openrdf.model.URI uri) throws IOException {
   URI create = URI.create(uri.toString());
   URI rel = baseURI.relativize(create);
   if (!rel.isAbsolute()) {
     writer.write("<");
     writer.write(TurtleUtil.encodeURIString(rel.toString()));
     writer.write(">");
   } else {
     super.writeURI(uri);
   }
 }
Beispiel #2
0
 @Override
 public void startRDF() throws RDFHandlerException {
   super.startRDF();
   try {
     writer.write("@base ");
     writer.write("<");
     writer.write(TurtleUtil.encodeURIString(baseURI.toString()));
     writer.write("> .");
     writer.writeEOL();
   } catch (IOException e) {
     throw new RDFHandlerException(e);
   }
 }