| java.lang.Object com.hp.hpl.jena.n3.N3JenaWriter
All known Subclasses: com.hp.hpl.jena.n3.N3TurtleJenaWriter,
N3JenaWriter | public class N3JenaWriter implements RDFWriter(Code) | | Entry point for N3 writers. This writer will choose the actual writer
to use by looking at the system property
com.hp.hpl.jena.n3.N3JenaWriter.writer to get the
writer name.
The following N3 writers are provided:
- N3-PP: Pretty Printer (the default)
- N3-PLAIN: Plain, record/frame-oriented format
- N3-TRIPLES: Triples, with prefixes.
author: Andy Seaborne version: $Id: N3JenaWriter.java,v 1.32 2008/01/02 12:04:49 andy_seaborne Exp $ |
DEBUG | public static boolean DEBUG(Code) | | |
n3Writer | final public static String n3Writer(Code) | | General name for the N3 writer. Will make a decision on exactly which
writer to use (pretty writer, plain writer or simple writer) when created.
Default is the pretty writer but can be overridden with system property
com.hp.hpl.jena.n3.N3JenaWriter.writer .
|
n3WriterPlain | final public static String n3WriterPlain(Code) | | Name of the N3 plain writer. The plain writer writes records
by subject.
|
n3WriterPrettyPrinter | final public static String n3WriterPrettyPrinter(Code) | | Name of the N3 pretty writer. The pretty writer
uses a frame-like layout, with prefixing, clustering like properties
and embedding one-referenced bNodes.
|
n3WriterTriples | final public static String n3WriterTriples(Code) | | Name of the N3 triples writer. This writer writes one line per statement,
like N-Triples, but does N3-style prefixing.
|
n3WriterTriplesAlt | final public static String n3WriterTriplesAlt(Code) | | Alternative name for the N3 triples writer.
|
propWriteSimple | final public static String propWriteSimple(Code) | | Compatibility.
|
propWriterName | final public static String propWriterName(Code) | | System property name that sets the default N3 writer name
|
turtleWriter | final public static String turtleWriter(Code) | | Turtle writer.
http://www.dajobe.org/2004/01/turtle/
|
turtleWriterAlt1 | final public static String turtleWriterAlt1(Code) | | |
turtleWriterAlt2 | final public static String turtleWriterAlt2(Code) | | |
N3JenaWriter | public N3JenaWriter()(Code) | | |
write | public void write(Model model, OutputStream out, String base)(Code) | | Write the model out in N3. The writer should be one suitable for UTF-8 which
excludes a PrintWriter or a FileWriter which use default character set.
Examples:
try {
Writer w = new BufferedWriter(new OutputStreamWriter(output, "UTF-8")) ;
model.write(w, base) ;
try { w.flush() ; } catch (IOException ioEx) {}
} catch (java.io.UnsupportedEncodingException ex) {} //UTF-8 is required so can't happen
or
try {
OutputStream out = new FileOutputStream(file) ;
Writer w = new BufferedWriter(new OutputStreamWriter(out, "UTF-8")) ;
model.write(w, base) ;
}
catch (java.io.UnsupportedEncodingException ex) {}
catch (java.io.FileNotFoundException noFileEx) { ... }
See Also: N3JenaWriter.write(Model,Writer,String) |
|
|