java.lang.Object
org.apache.jena.rdf.model.impl.NTripleWriter
- All Implemented Interfaces:
RDFWriterI
Writes out an XML serialization of a model.
-
Field Summary
Fields inherited from interface org.apache.jena.rdf.model.RDFWriterI
NSPREFIXPROPBASE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPrefixFor
(String uri) setErrorHandler
(RDFErrorHandler errHandler) Set an error handler.void
setNsPrefix
(String prefix, String ns) setProperty
(String propName, Object propValue) Set a property to control the writer's behaviour.void
write
(Model model, OutputStream out, String base) Serialize Modelmodel
to OutputStreamout
.static void
write
(Model model, PrintWriter writer) void
Caution: Serialize Modelmodel
to Writerout
.
-
Constructor Details
-
NTripleWriter
public NTripleWriter()
-
-
Method Details
-
write
Description copied from interface:RDFWriterI
Serialize Modelmodel
to OutputStreamout
. The implementation chooses the character encoding, utf-8 is preferred.- Specified by:
write
in interfaceRDFWriterI
- Parameters:
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.
-
write
Description copied from interface:RDFWriterI
Caution: Serialize Modelmodel
to Writerout
. 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.- Specified by:
write
in interfaceRDFWriterI
- Parameters:
model
- The model to be written.writer
- The Writer to which the serialization should be sent.base
- the base URI for relative URI calculations.null
means use only absolute URI's.
-
setProperty
Set a property to control the writer's behaviour.This writer currently recognises no properties. Invoking this method always causes an
?UnknownPropertyException
to be raised.- Specified by:
setProperty
in interfaceRDFWriterI
- Parameters:
propName
- The name of the property to be setpropValue
- The new value of the property- Returns:
- the previous value of the property
-
setNsPrefix
-
getPrefixFor
-
setErrorHandler
Description copied from interface:RDFWriterI
Set an error handler.- Specified by:
setErrorHandler
in interfaceRDFWriterI
- Parameters:
errHandler
- The new error handler to be used.- Returns:
- the old error handler
-
write
-