Package com.stardog.stark.io.ntriples
Class NTWriter
java.lang.Object
com.stardog.stark.io.ntriples.NTWriter
- All Implemented Interfaces:
RDFHandler,RDFWriter
RDFWriter implementation for the N-Triples RDF format
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Michael Grove
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidWrite a comment to the output.voidend()Signals the writing process is completed.format()Theformatthis writer will serialize output in.voidWrite the givenStatementvoidProvide a namespace to the writer.static voidstatic voidstatic voidstatic voidvoidstart()Signals that the RDF writing process is starting.
-
Method Details
-
end
public void end()Signals the writing process is completed. The underlyingInputStreamis *not* closed, but the caller should not call additional methods on this writer as that will normally yield syntax errors in the output.- Specified by:
endin interfaceRDFHandler- Specified by:
endin interfaceRDFWriter
-
start
public void start()Signals that the RDF writing process is starting.- Specified by:
startin interfaceRDFHandler- Specified by:
startin interfaceRDFWriter
-
namespace
Provide a namespace to the writer. This method can be called before writing hasstarted, in which case, the namespace bindings are buffered and written when appropriate after writing has begun.- Specified by:
namespacein interfaceRDFHandler- Specified by:
namespacein interfaceRDFWriter- Parameters:
thePrefix- the namespace prefixtheIRI- the associated IRI
-
comment
Write a comment to the output. Writing need not bestartedat this point; comments can be written prior to any actual serialized RDF -
handle
Write the givenStatement- Specified by:
handlein interfaceRDFHandler- Specified by:
handlein interfaceRDFWriter- Parameters:
theStmt- the statement to write
-
format
Theformatthis writer will serialize output in. -
serialize
public static void serialize(@Nonnull Value theObj, boolean theSimplify, Writer theWriter) throws IOException - Throws:
IOException
-
serialize
- Throws:
IOException
-
serialize
- Throws:
IOException
-
serialize
public static void serialize(@Nonnull Literal theObj, boolean theSimplify, Writer theWriter) throws IOException - Throws:
IOException
-