C# Class STELLAR.Data.API

Mostra file Open project: cbinding/stellar

Public Methods

Method Description
DBColumnSplit ( string dbName, string tableName, string columnName, string keyColumnName, char delimiter ) : int

New 04/07/11 - split field values containing nested delimiters into a new table (named as tableName_columnName_split)

DBColumns ( String dbName, String tableName ) : String[]

List the columns in a SQLITE database table

DBNames ( String path ) : String[]

List the SQLITE database names for a given directory path

DBRowCount ( String dbName, String tableName ) : int

Count the rows in a SQLITE database table

DBTables ( String dbName ) : String[]

List the tables in a SQLITE database

DT2DB ( String dbName, DataTable table, bool append ) : int
DT2Delimited ( DataTable table, String fileName, char delimiter ) : int

Write the contents of a DataTable to a delimited file

DT2STG ( DataTable table, String stgFileName, String outFileName ) : int

Convert a System.Data.DataTable using a StringTemplateGroup file

DT2STG ( DataTable table, String stgFileName, String outFileName, String optFileName ) : int
DT2XML ( DataTable table, String xmlFileName ) : int
Delimited2DB ( string dbName, string fileName ) : int
Delimited2DB ( string dbName, string fileName, bool hasHeader ) : int
Delimited2DB ( string dbName, string fileName, char delimiter ) : int
Delimited2DB ( string dbName, string fileName, char delimiter, bool hasHeader ) : int
Delimited2DB ( string dbName, string fileName, string tableName ) : int
Delimited2DB ( string dbName, string fileName, string tableName, bool hasHeader ) : int
Delimited2DB ( string dbName, string fileName, string tableName, bool hasHeader, bool append ) : int
Delimited2DB ( string dbName, string fileName, string tableName, char delimiter, bool hasHeader, bool append ) : int
Delimited2DT ( string fileName ) : DataTable
Delimited2DT ( string fileName, bool hasHeader ) : DataTable
Delimited2DT ( string fileName, bool hasHeader, int maxRows ) : DataTable
Delimited2DT ( string fileName, char delimiter ) : DataTable
Delimited2DT ( string fileName, char delimiter, bool hasHeader ) : DataTable
Delimited2DT ( string fileName, char delimiter, bool hasHeader, int maxRows ) : DataTable

Read a delimited data file to a DataTable

Delimited2DT ( string fileName, char delimiter, int maxRows ) : DataTable
Delimited2DT ( string fileName, int maxRows ) : DataTable
Delimited2RDF ( string fileName, string templateName ) : int
Delimited2RDF ( string fileName, string templateName, string rdfFileName ) : int
Delimited2RDF ( string fileName, string templateName, string rdfFileName, bool hasHeader ) : int
Delimited2RDF ( string fileName, string templateName, string rdfFileName, string namespaceURI ) : int
Delimited2RDF ( string fileName, string templateName, string rdfFileName, string namespaceURI, bool hasHeader ) : int
Delimited2RDF ( string fileName, string templateName, string rdfFileName, string namespaceURI, char delimiter, bool hasHeader ) : int
Delimited2STG ( string fileName, string stgFileName, string outFileName, char delimiter ) : int

Convert a delimited file using a StringTemplateGroup file

Delimited2STG ( string fileName, string stgFileName, string outFileName, string optFileName, bool hasHeader, char delimiter ) : int
Delimited2STG ( string fileName, string stgFileName, string outFileName, string optFileName, char delimiter ) : int
Delimited2XML ( string fileName ) : int
Delimited2XML ( string fileName, bool hasHeader ) : int
Delimited2XML ( string fileName, char delimiter ) : int
Delimited2XML ( string fileName, char delimiter, bool hasHeader ) : int
Delimited2XML ( string fileName, string xmlFileName ) : int
Delimited2XML ( string fileName, string xmlFileName, bool hasHeader ) : int
Delimited2XML ( string fileName, string xmlFileName, char delimiter ) : int
Delimited2XML ( string fileName, string xmlFileName, char delimiter, bool hasHeader ) : int
EscapeUnicode ( string input ) : string
SQL2DT ( string dbName, string sqlFileName ) : DataTable
SQL2Delimited ( string dbName, string sqlFileName ) : int
SQL2Delimited ( string dbName, string sqlFileName, char delimiter ) : int
SQL2Delimited ( string dbName, string sqlFileName, string outFileName ) : int
SQL2Delimited ( string dbName, string sqlFileName, string outFileName, char delimiter ) : int
SQL2RDF ( string dbName, string sqlFileName, string templateName ) : int
SQL2RDF ( string dbName, string sqlFileName, string templateName, string rdfFileName ) : int
SQL2RDF ( string dbName, string sqlFileName, string templateName, string rdfFileName, string namespaceURI ) : int
SQL2STG ( string dbName, string sqlFileName, string stgFileName, string outFileName ) : int

Run a SQL query against the specified database, convert the output using a StringTemplateGroup file

SQL2STG ( string dbName, string sqlFileName, string stgFileName, string outFileName, string optFileName ) : int
SQL2XML ( string dbName, string sqlFileName ) : int
SQL2XML ( string dbName, string sqlFileName, string xmlFileName ) : int
SQLExecute ( string dbName, string sqlFileName ) : int
XML2RDF ( string xmlFileName, string templateName ) : bool
XML2RDF ( string xmlFileName, string templateName, string rdfFileName ) : bool
XML2RDF ( string xmlFileName, string templateName, string rdfFileName, string namespaceURI ) : bool
templateNames ( ) : String[]

List possible template names (compiled within STELLAR.Xsl.dll)

Private Methods

Method Description
getNextColumnName ( DataTable table ) : String

used in CSV2DT to generate next column name when no column header row exists

getValidColumnName ( String colName ) : String

used in CSV2DT to ensure table/column names are valid - punctuation and spaces replaced with underscores

getValidName ( String name ) : String
getValidTableName ( String tblName ) : String
trimQuotes ( String quotedString ) : String

Method Details

DBColumnSplit() public static method

New 04/07/11 - split field values containing nested delimiters into a new table (named as tableName_columnName_split)
public static DBColumnSplit ( string dbName, string tableName, string columnName, string keyColumnName, char delimiter ) : int
dbName string Database file name
tableName string Database table name
columnName string Name of field containing nested delimiters
keyColumnName string Name of the key (ID) field from the specified table
delimiter char Character used as delimiter in the column
return int

DBColumns() public static method

List the columns in a SQLITE database table
Throws an argument exception if dbName or tableName are not supplied
public static DBColumns ( String dbName, String tableName ) : String[]
dbName String Database file name
tableName String Database table name
return String[]

DBNames() public static method

List the SQLITE database names for a given directory path
public static DBNames ( String path ) : String[]
path String Directory path to be searched
return String[]

DBRowCount() public static method

Count the rows in a SQLITE database table
Throws an exception if dbName or tableName are not supplied
public static DBRowCount ( String dbName, String tableName ) : int
dbName String Database file name
tableName String Database table name
return int

DBTables() public static method

List the tables in a SQLITE database
Throws an exception if dbName is not supplied
public static DBTables ( String dbName ) : String[]
dbName String Database file name
return String[]

DT2DB() public static method

public static DT2DB ( String dbName, DataTable table, bool append ) : int
dbName String
table System.Data.DataTable
append bool
return int

DT2Delimited() public static method

Write the contents of a DataTable to a delimited file
Throws an exception if output file name is not supplied
public static DT2Delimited ( DataTable table, String fileName, char delimiter ) : int
table System.Data.DataTable The DataTable to be used
fileName String The name of the delimited file to write, including absolute or relative path as appropriate
delimiter char Delimiter character to be used
return int

DT2STG() public static method

Convert a System.Data.DataTable using a StringTemplateGroup file
Throws an exception if stgFileName or outFileName are not supplied
public static DT2STG ( DataTable table, String stgFileName, String outFileName ) : int
table System.Data.DataTable DataTable to be converted
stgFileName String The name of the StringTemplateGroup file, including absolute or relative path as appropriate
outFileName String The name of the file to write the output to
return int

DT2STG() public static method

public static DT2STG ( DataTable table, String stgFileName, String outFileName, String optFileName ) : int
table System.Data.DataTable
stgFileName String
outFileName String
optFileName String
return int

DT2XML() public static method

Throws an exception if xmlFileName is not supplied
public static DT2XML ( DataTable table, String xmlFileName ) : int
table System.Data.DataTable The DataTable to be used
xmlFileName String The name of the XML file to write, including absolute or relative path as appropriate
return int

Delimited2DB() public static method

public static Delimited2DB ( string dbName, string fileName ) : int
dbName string
fileName string
return int

Delimited2DB() public static method

public static Delimited2DB ( string dbName, string fileName, bool hasHeader ) : int
dbName string
fileName string
hasHeader bool
return int

Delimited2DB() public static method

public static Delimited2DB ( string dbName, string fileName, char delimiter ) : int
dbName string
fileName string
delimiter char
return int

Delimited2DB() public static method

public static Delimited2DB ( string dbName, string fileName, char delimiter, bool hasHeader ) : int
dbName string
fileName string
delimiter char
hasHeader bool
return int

Delimited2DB() public static method

public static Delimited2DB ( string dbName, string fileName, string tableName ) : int
dbName string
fileName string
tableName string
return int

Delimited2DB() public static method

public static Delimited2DB ( string dbName, string fileName, string tableName, bool hasHeader ) : int
dbName string
fileName string
tableName string
hasHeader bool
return int

Delimited2DB() public static method

public static Delimited2DB ( string dbName, string fileName, string tableName, bool hasHeader, bool append ) : int
dbName string
fileName string
tableName string
hasHeader bool
append bool
return int

Delimited2DB() public static method

public static Delimited2DB ( string dbName, string fileName, string tableName, char delimiter, bool hasHeader, bool append ) : int
dbName string
fileName string
tableName string
delimiter char
hasHeader bool
append bool
return int

Delimited2DT() public static method

public static Delimited2DT ( string fileName ) : DataTable
fileName string
return System.Data.DataTable

Delimited2DT() public static method

public static Delimited2DT ( string fileName, bool hasHeader ) : DataTable
fileName string
hasHeader bool
return System.Data.DataTable

Delimited2DT() public static method

public static Delimited2DT ( string fileName, bool hasHeader, int maxRows ) : DataTable
fileName string
hasHeader bool
maxRows int
return System.Data.DataTable

Delimited2DT() public static method

public static Delimited2DT ( string fileName, char delimiter ) : DataTable
fileName string
delimiter char
return System.Data.DataTable

Delimited2DT() public static method

public static Delimited2DT ( string fileName, char delimiter, bool hasHeader ) : DataTable
fileName string
delimiter char
hasHeader bool
return System.Data.DataTable

Delimited2DT() public static method

Read a delimited data file to a DataTable
Throws an exception if delimited file name is not supplied Throws an exception if delimited file name does not exist or cannot be accessed
public static Delimited2DT ( string fileName, char delimiter, bool hasHeader, int maxRows ) : DataTable
fileName string The name of the delimited file to read, including absolute or relative path as appropriate
delimiter char Delimiter character to be used
hasHeader bool Is there a header row containing column names? If not they will be generated automatically
maxRows int Only read this many rows (useful for testing with larger files)
return System.Data.DataTable

Delimited2DT() public static method

public static Delimited2DT ( string fileName, char delimiter, int maxRows ) : DataTable
fileName string
delimiter char
maxRows int
return System.Data.DataTable

Delimited2DT() public static method

public static Delimited2DT ( string fileName, int maxRows ) : DataTable
fileName string
maxRows int
return System.Data.DataTable

Delimited2RDF() public static method

public static Delimited2RDF ( string fileName, string templateName ) : int
fileName string
templateName string
return int

Delimited2RDF() public static method

public static Delimited2RDF ( string fileName, string templateName, string rdfFileName ) : int
fileName string
templateName string
rdfFileName string
return int

Delimited2RDF() public static method

public static Delimited2RDF ( string fileName, string templateName, string rdfFileName, bool hasHeader ) : int
fileName string
templateName string
rdfFileName string
hasHeader bool
return int

Delimited2RDF() public static method

public static Delimited2RDF ( string fileName, string templateName, string rdfFileName, string namespaceURI ) : int
fileName string
templateName string
rdfFileName string
namespaceURI string
return int

Delimited2RDF() public static method

public static Delimited2RDF ( string fileName, string templateName, string rdfFileName, string namespaceURI, bool hasHeader ) : int
fileName string
templateName string
rdfFileName string
namespaceURI string
hasHeader bool
return int

Delimited2RDF() public static method

public static Delimited2RDF ( string fileName, string templateName, string rdfFileName, string namespaceURI, char delimiter, bool hasHeader ) : int
fileName string
templateName string
rdfFileName string
namespaceURI string
delimiter char
hasHeader bool
return int

Delimited2STG() public static method

Convert a delimited file using a StringTemplateGroup file
public static Delimited2STG ( string fileName, string stgFileName, string outFileName, char delimiter ) : int
fileName string The name of the delimited file, including absolute or relative path as appropriate
stgFileName string The name of the StringTemplateGroup file, including absolute or relative path as appropriate
outFileName string The name of the file to write the output to
delimiter char Delimiter character for the delimited file
return int

Delimited2STG() public static method

public static Delimited2STG ( string fileName, string stgFileName, string outFileName, string optFileName, bool hasHeader, char delimiter ) : int
fileName string
stgFileName string
outFileName string
optFileName string
hasHeader bool
delimiter char
return int

Delimited2STG() public static method

public static Delimited2STG ( string fileName, string stgFileName, string outFileName, string optFileName, char delimiter ) : int
fileName string
stgFileName string
outFileName string
optFileName string
delimiter char
return int

Delimited2XML() public static method

public static Delimited2XML ( string fileName ) : int
fileName string
return int

Delimited2XML() public static method

public static Delimited2XML ( string fileName, bool hasHeader ) : int
fileName string
hasHeader bool
return int

Delimited2XML() public static method

public static Delimited2XML ( string fileName, char delimiter ) : int
fileName string
delimiter char
return int

Delimited2XML() public static method

public static Delimited2XML ( string fileName, char delimiter, bool hasHeader ) : int
fileName string
delimiter char
hasHeader bool
return int

Delimited2XML() public static method

public static Delimited2XML ( string fileName, string xmlFileName ) : int
fileName string
xmlFileName string
return int

Delimited2XML() public static method

public static Delimited2XML ( string fileName, string xmlFileName, bool hasHeader ) : int
fileName string
xmlFileName string
hasHeader bool
return int

Delimited2XML() public static method

public static Delimited2XML ( string fileName, string xmlFileName, char delimiter ) : int
fileName string
xmlFileName string
delimiter char
return int

Delimited2XML() public static method

public static Delimited2XML ( string fileName, string xmlFileName, char delimiter, bool hasHeader ) : int
fileName string
xmlFileName string
delimiter char
hasHeader bool
return int

EscapeUnicode() public static method

public static EscapeUnicode ( string input ) : string
input string
return string

SQL2DT() public static method

public static SQL2DT ( string dbName, string sqlFileName ) : DataTable
dbName string
sqlFileName string
return System.Data.DataTable

SQL2Delimited() public static method

public static SQL2Delimited ( string dbName, string sqlFileName ) : int
dbName string
sqlFileName string
return int

SQL2Delimited() public static method

public static SQL2Delimited ( string dbName, string sqlFileName, char delimiter ) : int
dbName string
sqlFileName string
delimiter char
return int

SQL2Delimited() public static method

public static SQL2Delimited ( string dbName, string sqlFileName, string outFileName ) : int
dbName string
sqlFileName string
outFileName string
return int

SQL2Delimited() public static method

public static SQL2Delimited ( string dbName, string sqlFileName, string outFileName, char delimiter ) : int
dbName string
sqlFileName string
outFileName string
delimiter char
return int

SQL2RDF() public static method

public static SQL2RDF ( string dbName, string sqlFileName, string templateName ) : int
dbName string
sqlFileName string
templateName string
return int

SQL2RDF() public static method

public static SQL2RDF ( string dbName, string sqlFileName, string templateName, string rdfFileName ) : int
dbName string
sqlFileName string
templateName string
rdfFileName string
return int

SQL2RDF() public static method

public static SQL2RDF ( string dbName, string sqlFileName, string templateName, string rdfFileName, string namespaceURI ) : int
dbName string
sqlFileName string
templateName string
rdfFileName string
namespaceURI string
return int

SQL2STG() public static method

Run a SQL query against the specified database, convert the output using a StringTemplateGroup file
Throws an exception if dbName, sqlFileName or stgFileName are not supplied
public static SQL2STG ( string dbName, string sqlFileName, string stgFileName, string outFileName ) : int
dbName string The name of the database file, including absolute or relative path as appropriate
sqlFileName string The name of the SQL query file, including absolute or relative path as appropriate
stgFileName string The name of the StringTemplateGroup file, including absolute or relative path as appropriate
outFileName string The name of the file to write the output to
return int

SQL2STG() public static method

public static SQL2STG ( string dbName, string sqlFileName, string stgFileName, string outFileName, string optFileName ) : int
dbName string
sqlFileName string
stgFileName string
outFileName string
optFileName string
return int

SQL2XML() public static method

public static SQL2XML ( string dbName, string sqlFileName ) : int
dbName string
sqlFileName string
return int

SQL2XML() public static method

public static SQL2XML ( string dbName, string sqlFileName, string xmlFileName ) : int
dbName string
sqlFileName string
xmlFileName string
return int

SQLExecute() public static method

public static SQLExecute ( string dbName, string sqlFileName ) : int
dbName string
sqlFileName string
return int

XML2RDF() public static method

public static XML2RDF ( string xmlFileName, string templateName ) : bool
xmlFileName string
templateName string
return bool

XML2RDF() public static method

public static XML2RDF ( string xmlFileName, string templateName, string rdfFileName ) : bool
xmlFileName string
templateName string
rdfFileName string
return bool

XML2RDF() public static method

public static XML2RDF ( string xmlFileName, string templateName, string rdfFileName, string namespaceURI ) : bool
xmlFileName string
templateName string
rdfFileName string
namespaceURI string
return bool

templateNames() public static method

List possible template names (compiled within STELLAR.Xsl.dll)
public static templateNames ( ) : String[]
return String[]