org.trippi.io
Class CSVTupleWriter
java.lang.Object
org.trippi.io.RDFWriter
org.trippi.io.TupleWriter
org.trippi.io.CSVTupleWriter
public class CSVTupleWriter
- extends TupleWriter
Writes tuples as CSV's (comma-separated values), a format common in
spreadsheet applications.
Headings (the names in the first row) are always quoted.
Values are quoted only when they contain commas or quote chars (in which
case the quote character is escaped using ""). Newlines in values
are replaced with spaces.
Note that this form does not preserve datatype or language attributes
for RDF literals. UTF-8 encoding is used for extended characters.
Constructor Summary |
CSVTupleWriter(java.io.OutputStream out,
java.util.Map aliases)
|
Method Summary |
java.lang.String |
getValue(org.jrdf.graph.Node node)
|
int |
write(TupleIterator iter)
Write the tuples from the iterator, close the iterator, and return
the number written. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CSVTupleWriter
public CSVTupleWriter(java.io.OutputStream out,
java.util.Map aliases)
throws TrippiException
- Throws:
TrippiException
write
public int write(TupleIterator iter)
throws TrippiException
- Description copied from class:
TupleWriter
- Write the tuples from the iterator, close the iterator, and return
the number written. Do not close the outputstream.
- Specified by:
write
in class TupleWriter
- Throws:
TrippiException
getValue
public java.lang.String getValue(org.jrdf.graph.Node node)