| java.lang.Object com.hp.hpl.jena.n3.N3JenaWriterCommon
All known Subclasses: com.hp.hpl.jena.n3.N3JenaWriterTriples, com.hp.hpl.jena.n3.N3JenaWriterPP, com.hp.hpl.jena.n3.N3JenaWriterPlain,
N3JenaWriterCommon | public class N3JenaWriterCommon implements RDFWriter(Code) | | Common framework for implementing N3 writers.
author: Andy Seaborne version: $Id: N3JenaWriterCommon.java,v 1.41 2008/02/08 16:13:20 andy_seaborne Exp $ |
Method Summary | |
protected String | absolutePropName(String propName) | protected int | calcPropertyPadding(String propStr) | static boolean | checkQName(String ns, String local) | static boolean | checkQNameLocalname(String s) | static boolean | checkQNameNamespace(String s) | static boolean | checkQNamePart(String s) | protected int | countArcsTo(Resource resource) | protected int | countArcsTo(Property prop, Resource resource) | protected int | countProperties(Resource r) | protected int | countProperties(Resource r, Property p) | protected void | finishWriting() | protected String | formatLiteral(Literal literal) | protected String | formatNode(RDFNode node) | protected String | formatProperty(Property p) | protected String | formatResource(Resource r) | protected String | formatURI(String uriStr) | protected boolean | getBooleanValue(String prop, boolean defaultValue) | protected int | getIntValue(String prop, int defaultValue) | protected IndentedWriter | getOutput() | protected Map | getPrefixes() | protected String | getPropValue(String prop) | protected String | getStringValue(String prop, String defaultValue) | protected ResIterator | listSubjects(Model model) | protected String | localPropName(String propName) | protected static String | pad(int cols) | protected void | prepare(Model model) | protected ClosableIterator | preparePropertiesForSubject(Resource r) | protected void | processModel(Model baseModel) | protected Iterator | rdfListIterator(Resource r) | public RDFErrorHandler | setErrorHandler(RDFErrorHandler errHandler) | public Object | setProperty(String propName, Object propValue) | protected boolean | skipThisSubject(Resource r) | protected void | startWriting() | protected static void | string(StringBuffer sbuff, String s, boolean singleQuoteLiteral) | public void | write(Model baseModel, Writer _out, String base) Write the model out in N3. | public synchronized void | write(Model model, OutputStream output, String base) | protected void | writeHeader(Model model) | protected void | writeLiteral(Literal literal) | protected void | writeModel(Model model) | protected void | writeObject(RDFNode node) | protected void | writeObjectList(Resource subject, Property property) | protected void | writeOneGraphNode(Resource subject) | protected void | writePrefixes(Model model) | protected void | writePropertiesForSubject(Resource subj, ClosableIterator iter) | protected void | writeSubject(Resource subject) |
allowDecimals | boolean allowDecimals(Code) | | |
allowDoubles | boolean allowDoubles(Code) | | |
allowTripleQuotedStrings | boolean allowTripleQuotedStrings(Code) | | |
alwaysAllocateBNodeLabel | boolean alwaysAllocateBNodeLabel(Code) | | |
bNodeCounter | int bNodeCounter(Code) | | |
indentObject | int indentObject(Code) | | |
indentProperty | int indentProperty(Code) | | |
propertyCol | int propertyCol(Code) | | |
shortSubject | int shortSubject(Code) | | |
subjectColumn | int subjectColumn(Code) | | |
useWellKnownPropertySymbols | boolean useWellKnownPropertySymbols(Code) | | |
wellKnownPropsMap | static Map wellKnownPropsMap(Code) | | |
widePropertyLen | int widePropertyLen(Code) | | |
writerPropertyMap | Map writerPropertyMap(Code) | | |
calcPropertyPadding | protected int calcPropertyPadding(String propStr)(Code) | | |
checkQNameLocalname | static boolean checkQNameLocalname(String s)(Code) | | |
checkQNameNamespace | static boolean checkQNameNamespace(String s)(Code) | | |
finishWriting | protected void finishWriting()(Code) | | |
getBooleanValue | protected boolean getBooleanValue(String prop, boolean defaultValue)(Code) | | |
getIntValue | protected int getIntValue(String prop, int defaultValue)(Code) | | |
processModel | protected void processModel(Model baseModel)(Code) | | |
startWriting | protected void startWriting()(Code) | | |
write | public void write(Model baseModel, Writer _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: N3JenaWriterCommon.write(Model,Writer,String) |
writeHeader | protected void writeHeader(Model model)(Code) | | |
writeOneGraphNode | protected void writeOneGraphNode(Resource subject)(Code) | | |
writePrefixes | protected void writePrefixes(Model model)(Code) | | |
|
|