public interface RDFWriter
An RDFWriter
is a class which serializes an RDF model
to some RDF serializaion language. RDF/XML, n-triple and n3 are
examples of serialization languages.
Modifier and Type | Field and Description |
---|---|
static String |
NSPREFIXPROPBASE |
Modifier and Type | Method and Description |
---|---|
RDFErrorHandler |
setErrorHandler(RDFErrorHandler errHandler)
Set an error handler.
|
Object |
setProperty(String propName,
Object propValue)
Set a property to control the behaviour of this writer.
|
void |
write(Model model,
OutputStream out,
String base)
Serialize Model
model to OutputStream out. |
void |
write(Model model,
Writer out,
String base)
Caution: Serialize Model
model to Writer out . |
static final String NSPREFIXPROPBASE
void write(Model model, Writer out, String base)
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.out
- The Writer to which the serialization should
be sent.model
- The model to be written.base
- the base URI for relative URI calculations.
null
means use only absolute URI's.void write(Model model, OutputStream out, String base)
model
to OutputStream out.
The implementation chooses the character encoding, utf-8 is preferred.
out
- The OutputStream to which the serialization should be sent.model
- The model to be written.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.Object setProperty(String propName, Object propValue)
An RDFWriter's behaviour can be influenced by defining property values interpreted by that particular writer class. The values for such properties can be changed by calling this method.
No standard properties are defined. For the properties recognised by any particular writer implementation, see the the documentation for that implementation.
The built-in RDFWriters have properties as defined by:
propName
- The name of the property.propValue
- The new value of the propertynull
if no value was set.RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
errHandler
- The new error handler to be used.Licenced under the Apache License, Version 2.0