- All Known Subinterfaces:
RDFXMLWriterI
- All Known Implementing Classes:
BaseXMLWriter
,NTripleWriter
,RDFXML_Abbrev
,RDFXML_Basic
public interface RDFWriterI
RDFWriterI is an interface to RDF serializers.
Legacy
Writing RDF is usually done via:
- RDFDataMgr
- RDFWriterr
- Model.write
An RDFWriter
is a class which serializes an RDF model
to some RDF serialization language.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionsetErrorHandler
(RDFErrorHandler errHandler) Set an error handler.setProperty
(String propName, Object propValue) Set a property to control the behaviour of this writer.void
write
(Model model, OutputStream out, String base) Serialize Modelmodel
to OutputStreamout
.void
Caution: Serialize Modelmodel
to Writerout
.
-
Field Details
-
NSPREFIXPROPBASE
- See Also:
-
-
Method Details
-
write
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.- Parameters:
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.
-
write
Serialize Modelmodel
to OutputStreamout
. The implementation chooses the character encoding, utf-8 is preferred.- Parameters:
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.
-
setProperty
Set a property to control the behaviour of this writer.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 documentation for that implementation.
The built-in RDFWriters have properties as defined by:
- N-TRIPLE
- No properties.
- RDF/XML
- RDF/XML-ABBREV
- Parameters:
propName
- The name of the property.propValue
- The new value of the property- Returns:
- the old value for this property, or
null
if no value was set.
-
setErrorHandler
Set an error handler.- Parameters:
errHandler
- The new error handler to be used.- Returns:
- the old error handler
-