NSPREFIXPROPBASE
Constructor and Description |
---|
NTripleWriter() |
Modifier and Type | Method and Description |
---|---|
String |
getPrefixFor(String uri) |
RDFErrorHandler |
setErrorHandler(RDFErrorHandler errHandler)
Set an error handler.
|
void |
setNsPrefix(String prefix,
String ns) |
Object |
setProperty(String propName,
Object propValue)
Set a property to control the writer's behaviour.
|
void |
write(Model model,
OutputStream out,
String base)
Serialize Model
model to OutputStream out. |
static void |
write(Model model,
PrintWriter writer) |
void |
write(Model model,
Writer writer,
String base)
Caution: Serialize Model
model to Writer out . |
public void write(Model model, OutputStream out, String base)
RDFWriter
model
to OutputStream out.
The implementation chooses the character encoding, utf-8 is preferred.
write
in interface RDFWriter
model
- The model to be written.out
- The OutputStream to which the serialization should be sent.base
- the base URI for relative URI calculations.
null
means use only absolute URI's. This is used for relative
URIs that would be resolved against the document retrieval URL.
Particular writers may include this value in the output.public void write(Model model, Writer writer, String base)
RDFWriter
model
to Writer out
.
It is often better to use an OutputStream and permit Jena
to choose the character encoding. The charset restrictions
on the Writer are defined by the different implementations
of this interface. Typically using an OutputStreamWriter (e.g.
a FileWriter) at least permits the implementation to
examine the encoding. With an arbitrary Writer implementations
assume a utf-8 encoding.public Object setProperty(String propName, Object propValue)
This writer currently recognises no properties. Invoking this
method always causes an UnknownPropertyException
to be raised.
setProperty
in interface RDFWriter
propName
- The name of the property to be setpropValue
- The new value of the propertypublic RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
RDFWriter
setErrorHandler
in interface RDFWriter
errHandler
- The new error handler to be used.public static void write(Model model, PrintWriter writer)
Licenced under the Apache License, Version 2.0