Package org.apache.jena.riot
Class RDFWriterBuilder
- java.lang.Object
-
- org.apache.jena.riot.RDFWriterBuilder
-
public class RDFWriterBuilder extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asString()
Short form forbuild().asString()
.RDFWriterBuilder
base(java.lang.String baseURI)
RDFWriter
build()
RDFWriterBuilder
clone()
RDFWriterBuilder
context(Context context)
Set the context for the writer when built.static RDFWriterBuilder
create()
RDFWriterBuilder
format(RDFFormat format)
Set the output format to aRDFFormat
.RDFWriterBuilder
lang(Lang lang)
Set the output language to aLang
; this will set the format.void
output(java.io.OutputStream outputStream)
Short form forbuild().output(outputStream)
.void
output(java.lang.String filename)
Short form forbuild().output(filename)
.RDFWriterBuilder
set(Symbol symbol, boolean value)
Add a setting to the context for the writer when built.RDFWriterBuilder
set(Symbol symbol, java.lang.Object value)
Added a setting to the context for the writer when built.RDFWriterBuilder
source(Graph graph)
Set the source of writing to the graph argument.RDFWriterBuilder
source(Dataset dataset)
Set the source of writing to theDatasetGraph
argument.RDFWriterBuilder
source(Model model)
Set the source of writing to the graph argument.RDFWriterBuilder
source(DatasetGraph dataset)
Set the source of writing to theDatasetGraph
argument.
-
-
-
Method Detail
-
create
public static RDFWriterBuilder create()
-
source
public RDFWriterBuilder source(Graph graph)
Set the source of writing to the graph argument.Any previous source setting is cleared.
- Parameters:
graph
- AGraph
.- Returns:
- this
-
source
public RDFWriterBuilder source(Model model)
Set the source of writing to the graph argument.Any previous source setting is cleared.
Equivalent to
source(model.getGraph()(s)
- Parameters:
model
- AModel
.- Returns:
- this
-
source
public RDFWriterBuilder source(DatasetGraph dataset)
Set the source of writing to theDatasetGraph
argument.Any previous source setting is cleared.
- Parameters:
dataset
- ADatasetGraph
.- Returns:
- this
-
source
public RDFWriterBuilder source(Dataset dataset)
Set the source of writing to theDatasetGraph
argument.Any previous source setting is cleared.
Equivalent to
source(dataset.asDatasetGraph())
- Parameters:
dataset
- ADatasetGraph
.- Returns:
- this
-
context
public RDFWriterBuilder context(Context context)
Set the context for the writer when built.- Parameters:
context
-- Returns:
- this
- See Also:
Context
-
set
public RDFWriterBuilder set(Symbol symbol, boolean value)
Add a setting to the context for the writer when built.- Parameters:
symbol
-value
-- Returns:
- this
- See Also:
Context
-
set
public RDFWriterBuilder set(Symbol symbol, java.lang.Object value)
Added a setting to the context for the writer when built. A value of "null" removes a previous setting.- Parameters:
symbol
-value
-- Returns:
- this
- See Also:
Context
-
lang
public RDFWriterBuilder lang(Lang lang)
Set the output language to aLang
; this will set the format.If
Lang
andRDFFormat
are not set, an attempt is made to guess it from file name or URI on output.If output is to an
OutputStream
,Lang
orRDFFormat
must be set.Any previous setting of
Lang
orRDFFormat
is cleared.- Parameters:
lang
-- Returns:
- this
-
format
public RDFWriterBuilder format(RDFFormat format)
Set the output format to aRDFFormat
.If
Lang
andRDFFormat
are not set, an attempt is made to guess it from file name or URI on output.If output is to an
OutputStream
,Lang
orRDFFormat
must be set.Any previous setting of
Lang
orRDFFormat
is cleared.- Parameters:
format
-- Returns:
- this
-
base
public RDFWriterBuilder base(java.lang.String baseURI)
-
clone
public RDFWriterBuilder clone()
-
build
public RDFWriter build()
-
output
public void output(java.io.OutputStream outputStream)
Short form forbuild().output(outputStream)
.- Parameters:
outputStream
-
-
output
public void output(java.lang.String filename)
Short form forbuild().output(filename)
.- Parameters:
filename
-
-
asString
public java.lang.String asString()
Short form forbuild().asString()
.
-
-