Package com.stardog.stark.io.trig
Class TrigWriter
- java.lang.Object
-
- com.stardog.stark.io.turtle.TurtleWriter
-
- com.stardog.stark.io.trig.TrigWriter
-
- All Implemented Interfaces:
RDFHandler,RDFWriter
public class TrigWriter extends TurtleWriter
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Michael Grove
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTrigWriter.TrigWriterFactoryFactory forTrigWriter-
Nested classes/interfaces inherited from class com.stardog.stark.io.turtle.TurtleWriter
TurtleWriter.TurtleWriterFactory
-
-
Field Summary
-
Fields inherited from class com.stardog.stark.io.turtle.TurtleWriter
mBlockSpec, mLastWrittenPredicate, mLastWrittenSubject, mNamespaces, mOptions, mStarted, mStmtClosed, mWriter
-
-
Constructor Summary
Constructors Constructor Description TrigWriter(java.io.OutputStream theWriter, Options theOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseActiveContext()voidcomment(java.lang.String theComment)Write a comment to the output.voidend()Signals the writing process is completed.RDFFormatformat()Theformatthis writer will serialize output in.voidhandle(Statement theStmt)Write the givenStatementvoidstart()Signals that the RDF writing process is starting.protected voidwriteNamespace(java.lang.String thePrefix, java.lang.String theName)-
Methods inherited from class com.stardog.stark.io.turtle.TurtleWriter
closePreviousStatement, namespace, writeBNode, writeCommentLine, writeEmbeddedTriple, writeIRI, writeLiteral, writePredicate, writeResource, writeValue
-
-
-
-
Constructor Detail
-
TrigWriter
public TrigWriter(java.io.OutputStream theWriter, Options theOptions)
-
-
Method Detail
-
start
public void start()
Signals that the RDF writing process is starting.- Specified by:
startin interfaceRDFHandler- Specified by:
startin interfaceRDFWriter- Overrides:
startin classTurtleWriter
-
handle
public void handle(@Nonnull Statement theStmt)Write the givenStatement- Specified by:
handlein interfaceRDFHandler- Specified by:
handlein interfaceRDFWriter- Overrides:
handlein classTurtleWriter- Parameters:
theStmt- the statement to write
-
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- Overrides:
endin classTurtleWriter
-
comment
public void comment(@Nonnull java.lang.String theComment)Write a comment to the output. Writing need not bestartedat this point; comments can be written prior to any actual serialized RDF- Specified by:
commentin interfaceRDFWriter- Overrides:
commentin classTurtleWriter- Parameters:
theComment- the comment to write
-
writeNamespace
protected void writeNamespace(@Nonnull java.lang.String thePrefix, @Nonnull java.lang.String theName)- Overrides:
writeNamespacein classTurtleWriter
-
closeActiveContext
protected void closeActiveContext()
-
-