|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.rio.helpers.RDFHandlerBase
org.eaglei.repository.format.RDFNQuadsWriter
public class RDFNQuadsWriter
N-Quad writer About the Format: There is no standard or "offcial" format called N-Quad. We maded this up for the eagle-i project, to have a simple line-based QUAD (not TRIPLE) format that makes it easy to compare the contents of two groups of quads, or dumps of a Sesame context-aware triplestore (really quad-store). The only purpose of tihs format is to render "quads" - i.e. the statement *and* its context(s) - in a format that is guaranteed to to be the same for any equivalent graph, modulo the order of the lines. This allows sorted output to be compared for equality with a simple text comparision. It CANNOT be parsed into reasonable RDF again because the identifiers in blank nodes are lost. So there is no parser. Format is similar to NTriples; see: http://www.w3.org/TR/rdf-testcases/#ntriples ..only each line STARTS with a forth value, the context (or named graph); null context represented by "<>". Destructive changes when filtering output: 1. Optionally normalize all blank nodes so they compare as equal, all named _:bnode 2. Transform newline characters (both \r and \n) into escaped versions so they do not induce "false" line breaks. Remember, it is *ONLY* useful to debug and compare this output!
| Field Summary | |
|---|---|
static boolean |
normalizeBNodes
|
static org.openrdf.rio.RDFFormat |
NQUADS
Constant NQUADS |
static java.lang.String |
NQUADS_MIME
Constant NQUADS_MIME="text/rdf+nquads" |
| Constructor Summary | |
|---|---|
RDFNQuadsWriter(java.io.Writer out)
Constructor for RDFNQuadsWriter. |
|
| Method Summary | |
|---|---|
void |
endRDF()
endRDF |
org.openrdf.rio.RDFFormat |
getRDFFormat()
getRDFFormat |
void |
handleStatement(org.openrdf.model.Statement s)
|
| Methods inherited from class org.openrdf.rio.helpers.RDFHandlerBase |
|---|
handleComment, handleNamespace, startRDF |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.openrdf.rio.RDFHandler |
|---|
handleComment, handleNamespace, startRDF |
| Field Detail |
|---|
public static final java.lang.String NQUADS_MIME
NQUADS_MIME="text/rdf+nquads"
public static final boolean normalizeBNodes
public static final org.openrdf.rio.RDFFormat NQUADS
NQUADS
| Constructor Detail |
|---|
public RDFNQuadsWriter(java.io.Writer out)
Constructor for RDFNQuadsWriter.
out - a Writer object.| Method Detail |
|---|
public org.openrdf.rio.RDFFormat getRDFFormat()
getRDFFormat
getRDFFormat in interface org.openrdf.rio.RDFWriterRDFFormat object.
public void handleStatement(org.openrdf.model.Statement s)
throws org.openrdf.rio.RDFHandlerException
handleStatement in interface org.openrdf.rio.RDFHandlerhandleStatement in class org.openrdf.rio.helpers.RDFHandlerBaseorg.openrdf.rio.RDFHandlerException
public void endRDF()
throws org.openrdf.rio.RDFHandlerException
endRDF
endRDF in interface org.openrdf.rio.RDFHandlerendRDF in class org.openrdf.rio.helpers.RDFHandlerBaseorg.openrdf.rio.RDFHandlerException - if any.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||