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.voidsetNsPrefix(String prefix, String ns) setProperty(String propName, Object propValue) Set a property to control the writer's behaviour.voidwrite(Model model, OutputStream out, String base) Serialize Modelmodelto OutputStreamout.static voidwrite(Model model, PrintWriter writer) voidCaution: Serialize Modelmodelto Writerout.
-
Constructor Details
-
NTripleWriter
public NTripleWriter()
-
-
Method Details
-
write
Description copied from interface:RDFWriterISerialize Modelmodelto OutputStreamout. The implementation chooses the character encoding, utf-8 is preferred.- Specified by:
writein 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.nullmeans 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:RDFWriterICaution: Serialize Modelmodelto 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:
writein 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.nullmeans 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
?UnknownPropertyExceptionto be raised.- Specified by:
setPropertyin 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:RDFWriterISet an error handler.- Specified by:
setErrorHandlerin interfaceRDFWriterI- Parameters:
errHandler- The new error handler to be used.- Returns:
- the old error handler
-
write
-