Package org.restlet.ext.rdf.internal.n3
Class RdfN3Writer
- java.lang.Object
-
- org.restlet.ext.rdf.GraphHandler
-
- org.restlet.ext.rdf.internal.n3.RdfN3Writer
-
public class RdfN3Writer extends GraphHandler
Handler of RDF content according to the N3 notation.
-
-
Field Summary
Fields Modifier and Type Field Description private ContextcontextThe current context object.private ReferenceprecPredicateThe preceding predicate used for factorization matter.private ReferenceprecSourceThe preceding source used for factorization matter.private java.io.WriterwriterThe character writer.private booleanwritingExtraDotIndicates if the end of the statement is to be written.
-
Constructor Summary
Constructors Constructor Description RdfN3Writer(java.io.Writer writer)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendGraph()Callback method used after the graph is parsed or written.voidlink(Reference source, Reference typeRef, Reference target)Callback method used when a link is parsed or written.voidlink(Reference source, Reference typeRef, Literal target)Callback method used when a link is parsed or written.voidlink(Graph source, Reference typeRef, Reference target)Callback method used when a link is parsed or written.voidlink(Graph source, Reference typeRef, Literal target)Callback method used when a link is parsed or written.private voidwrite(Reference reference, java.util.Map<java.lang.String,java.lang.String> prefixes)Writes the representation of a given reference.private voidwrite(Graph linkset)Write the representation of the given graph of links.private voidwrite(Literal literal)Writes the representation of a literal.-
Methods inherited from class org.restlet.ext.rdf.GraphHandler
endPrefixMapping, startGraph, startPrefixMapping
-
-
-
-
Field Detail
-
context
private Context context
The current context object.
-
precPredicate
private Reference precPredicate
The preceding predicate used for factorization matter.
-
precSource
private Reference precSource
The preceding source used for factorization matter.
-
writer
private java.io.Writer writer
The character writer.
-
writingExtraDot
private boolean writingExtraDot
Indicates if the end of the statement is to be written.
-
-
Method Detail
-
endGraph
public void endGraph() throws java.io.IOExceptionDescription copied from class:GraphHandlerCallback method used after the graph is parsed or written. Does nothing by default.- Overrides:
endGraphin classGraphHandler- Throws:
java.io.IOException
-
link
public void link(Graph source, Reference typeRef, Literal target)
Description copied from class:GraphHandlerCallback method used when a link is parsed or written.- Specified by:
linkin classGraphHandler- Parameters:
source- The source or subject of the link.typeRef- The type reference of the link.target- The target or object of the link.
-
link
public void link(Graph source, Reference typeRef, Reference target)
Description copied from class:GraphHandlerCallback method used when a link is parsed or written.- Specified by:
linkin classGraphHandler- Parameters:
source- The source or subject of the link.typeRef- The type reference of the link.target- The target or object of the link.
-
link
public void link(Reference source, Reference typeRef, Literal target)
Description copied from class:GraphHandlerCallback method used when a link is parsed or written.- Specified by:
linkin classGraphHandler- Parameters:
source- The source or subject of the link.typeRef- The type reference of the link.target- The target or object of the link.
-
link
public void link(Reference source, Reference typeRef, Reference target)
Description copied from class:GraphHandlerCallback method used when a link is parsed or written.- Specified by:
linkin classGraphHandler- Parameters:
source- The source or subject of the link.typeRef- The type reference of the link.target- The target or object of the link.
-
write
private void write(Graph linkset) throws java.io.IOException
Write the representation of the given graph of links.- Parameters:
linkset- the given graph of links.- Throws:
java.io.IOException
-
write
private void write(Literal literal) throws java.io.IOException
Writes the representation of a literal.- Parameters:
literal- The literal to write.- Throws:
java.io.IOException
-
write
private void write(Reference reference, java.util.Map<java.lang.String,java.lang.String> prefixes) throws java.io.IOException
Writes the representation of a given reference.- Parameters:
reference- The reference to write.prefixes- The map of known namespaces.- Throws:
java.io.IOException
-
-