public class CSVMapper extends Object
| Constructor and Description |
|---|
CSVMapper() |
| Modifier and Type | Method and Description |
|---|---|
Character |
getEscape()
Returns the escape character for the mapper.
|
char |
getQuote()
Returns the quote character for the mapper.
|
char |
getSeparator()
Returns the separator character that will used by the mapper.
|
boolean |
isHeader()
Returns
true if the header row is enabled for the mapper. |
boolean |
isSkipEmpty()
Returns
true if empty values in the CSV file will be skipped. |
void |
map(Reader theReader,
String theMappings,
com.stardog.stark.io.RDFHandler theHandler)
Maps the contents of a CSV file to RDF using the given mappings.
|
void |
setEscape(Character theEscape)
Sets the character used to escape values containing special characters.
|
void |
setHashAlgorithm(String theHashAlgorithm)
Sets the hash algorithm to use for template vars that are prefixed with a # (hash).
|
void |
setHeader(boolean theHeader)
Enables or disables headers for the mapper.
|
void |
setQuote(char theQuote)
Sets the character used to encapsulate values containing special characters.
|
void |
setSeparator(char theSeparator)
Sets the character used to separate columns in a single line.
|
void |
setSkipEmpty(boolean theSkipEmpty)
Enables or disables skipping empty values in the CSV file.
|
public boolean isHeader()
true if the header row is enabled for the mapper. When headers are enabled the first row
of the input file is used to retrieve the column names and mappings can refer to those column names.public void setHeader(boolean theHeader)
true.public char getSeparator()
public void setSeparator(char theSeparator)
','.public char getQuote()
public void setQuote(char theQuote)
'"'.public Character getEscape()
public void setEscape(Character theEscape)
null.public boolean isSkipEmpty()
true if empty values in the CSV file will be skipped.public void setSkipEmpty(boolean theSkipEmpty)
true no triples will be generated for
templates that refer to a column with empty value. Default value is true.public void setHashAlgorithm(String theHashAlgorithm)
RDFGenerator.HashAlgorithm enum. Default is SHA1.public void map(Reader theReader, String theMappings, com.stardog.stark.io.RDFHandler theHandler) throws IOException
theReader - reader for the CSV filetheMappings - String representation of mappings in Stardog Mapping SyntaxtheHandler - handler for processing the generated triplesIOException - if there is an error reading the CSV filecom.stardog.stark.io.RDFHandlerException - if the handler throws an exception during processingcom.stardog.stark.io.InvalidRDF - if there is an error parsing the mappingsCopyright © 2010-2016 Stardog Union. All Rights Reserved.