SparkseePython  6.0.2
Public Member Functions | List of all members
sparksee.ScriptParser Class Reference

ScriptParser. More...

Public Member Functions

def __init__ (self)
 Constructor.
 
def set_error_log (self, path)
 Sets the error log. More...
 
def generate_schema_script (self, path, db)
 Writes an script with the schema definition for the given database. More...
 
def parse (self, path, execute, locale_str)
 Parses the given input file. More...
 
def set_output_log (self, path)
 Sets the output log. More...
 

Detailed Description

ScriptParser.

The ScriptParser can create schemas and load data from a set of commands in a sparksee script.

A SPARKSEE script contains an ordered list of commands. ScriptParser will execute each one of them in order. Commands may create schemas, define nodes and edges, and load data into a previous defined SPARKSEE schema.

Check out the 'Scripting' chapter in the SPARKSEE User Manual for a comprehensive explanation on the grammar of the SPARKSEE commands and how they work.

Author
Sparsity Technologies http://www.sparsity-technologies.com

Member Function Documentation

def sparksee.ScriptParser.generate_schema_script (   self,
  path,
  db 
)

Writes an script with the schema definition for the given database.

Parameters
path[in] Filename of the script to be writen.
db[in] Database.
Exceptions
IOErrorIf bad things happen opening or writing the file.
def sparksee.ScriptParser.parse (   self,
  path,
  execute,
  locale_str 
)

Parses the given input file.

Parameters
path[in] Input file path.
execute[in] If TRUE the script is executed, if FALSE it is just parsed.
locale_str[in] The locale string for reading the input file. See CSVReader.
Returns
TRUE if ok, FALSE in case of error.
Exceptions
IOErrorIf bad things happen opening the file.
def sparksee.ScriptParser.set_error_log (   self,
  path 
)

Sets the error log.

If not set, error log corresponds to standard error output.

Parameters
path[in] Path of the error log.
Exceptions
IOErrorIf bad things happen opening the file.
def sparksee.ScriptParser.set_output_log (   self,
  path 
)

Sets the output log.

If not set, output log corresponds to standard output.

Parameters
path[in] Path of the output log.
Exceptions
IOErrorIf bad things happen opening the file.