SparkseePython3 6.1.0
sparksee.EdgeTypeLoader Class Reference

EdgeTypeLoader class. More...

Inheritance diagram for sparksee.EdgeTypeLoader:
Inheritance graph
Collaboration diagram for sparksee.EdgeTypeLoader:
Collaboration graph

Public Member Functions

 run (self)
 See the TypeLoader class Run method.
 set_log_error (self, path)
 Sets a log error file.
 set_type (self, type)
 Sets the type to be loaded.
 set_head_position (self, pos)
 Sets the position of the head attribute in the source data.
 set_locale (self, locale_str)
 Sets the locale that will be used to read the data.
 set_timestamp_format (self, timestamp_format)
 Sets a specific timestamp format.
 set_attributes (self, attrs)
 Sets the list of Attributes.
 __init__ (self)
 Creates a new instance.
 register (self, tel)
 Registers a new listener.
 __init__ (self, row_reader, graph, type, attrs, attrs_pos, h_pos, t_pos, h_attr, t_attr, head_mep, tail_mep)
 Creates a new instance.
 set_frequency (self, freq)
 Sets the frequency of listener notification.
 run_two_phases (self)
 See the TypeLoader class RunTwoPhases method.
 set_head_attribute (self, attr)
 Sets the attribute that will be used to find the head of the edge.
 set_tail_attribute (self, attr)
 Sets the attribute that will be used to find the tail of the edge.
 set_tail_position (self, pos)
 Sets the position of the tail attribute in the source data.
 set_row_reader (self, rr)
 Sets the input data source.
 set_tail_mep (self, mep)
 Sets the flag to create missing tail nodes when loading nodes or edges.
 set_attribute_positions (self, attrs_pos)
 Sets the list of attribute positions.
 set_graph (self, graph)
 Sets the graph where the data will be loaded.
 run_n_phases (self, partitions)
 See the TypeLoader class RunNPhases method.
 set_head_mep (self, mep)
 Sets the flag to create missing head nodes when loading nodes or edges.
 set_log_off (self)
 Truns off all the error reporting.

Detailed Description

EdgeTypeLoader class.

Specific TypeLoader implementation for edge types.

Check out the 'Data import' section in the SPARKSEE User Manual for more details on this.

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

Constructor & Destructor Documentation

◆ __init__()

sparksee.EdgeTypeLoader.__init__ ( self,
row_reader,
graph,
type,
attrs,
attrs_pos,
h_pos,
t_pos,
h_attr,
t_attr,
head_mep,
tail_mep )

Creates a new instance.

Parameters
row_reader[in] Input RowReader.
graph[in] Graph.
type[in] Type identifier.
attrs[in] Attribute identifiers to be loaded.
attrs_pos[in] Attribute positions (column index >=0). to all listeners.
h_pos[in] The position (index column) for the head value.
t_pos[in] The position (index column) for the tail value.
h_attr[in] The attribute identifier for the head.
t_attr[in] The attribute identifier for the tail.
head_mep[in] The MissingEndpoint policy for the head nodes
tail_mep[in] The MissingEndpoint policy for the tail nodes

Member Function Documentation

◆ register()

sparksee.EdgeTypeLoader.register ( self,
tel )

Registers a new listener.

Parameters
telTypeLoaderListener to be registered.

Reimplemented from sparksee.TypeLoader.

◆ run()

sparksee.EdgeTypeLoader.run ( self)

See the TypeLoader class Run method.

ErrorFor other issues

Exceptions
RuntimeErrornull
IOErrorIf bad things happen using to the RowReader.

Reimplemented from sparksee.TypeLoader.

◆ run_n_phases()

sparksee.EdgeTypeLoader.run_n_phases ( self,
partitions )

See the TypeLoader class RunNPhases method.

ErrorFor other issues

Parameters
partitionsnull
Exceptions
RuntimeErrornull
IOErrorIf bad things happen using to the RowReader.

Reimplemented from sparksee.TypeLoader.

◆ run_two_phases()

sparksee.EdgeTypeLoader.run_two_phases ( self)

See the TypeLoader class RunTwoPhases method.

ErrorFor other issues

Exceptions
RuntimeErrornull
IOErrorIf bad things happen using to the RowReader.

Reimplemented from sparksee.TypeLoader.

◆ set_attribute_positions()

sparksee.EdgeTypeLoader.set_attribute_positions ( self,
attrs_pos )

Sets the list of attribute positions.

Parameters
attrs_pos[in] Attribute positions (column index >=0).

Reimplemented from sparksee.TypeLoader.

◆ set_attributes()

sparksee.EdgeTypeLoader.set_attributes ( self,
attrs )

Sets the list of Attributes.

Parameters
attrs[in] Attribute identifiers to be loaded

Reimplemented from sparksee.TypeLoader.

◆ set_frequency()

sparksee.EdgeTypeLoader.set_frequency ( self,
freq )

Sets the frequency of listener notification.

Parameters
freq[in] Frequency in number of rows managed to notify progress to all listeners

Reimplemented from sparksee.TypeLoader.

◆ set_graph()

sparksee.EdgeTypeLoader.set_graph ( self,
graph )

Sets the graph where the data will be loaded.

Parameters
graph[in] Graph.

Reimplemented from sparksee.TypeLoader.

◆ set_head_attribute()

sparksee.EdgeTypeLoader.set_head_attribute ( self,
attr )

Sets the attribute that will be used to find the head of the edge.

This method is protected because only the Edge loaders should have it.

Parameters
attr[in] Head Attribute

◆ set_head_mep()

sparksee.EdgeTypeLoader.set_head_mep ( self,
mep )

Sets the flag to create missing head nodes when loading nodes or edges.

flagTrue if the nodes need to be created. False otherwise

Parameters
mepnull

◆ set_head_position()

sparksee.EdgeTypeLoader.set_head_position ( self,
pos )

Sets the position of the head attribute in the source data.

This method is protected because only the Edge loaders should have it.

Parameters
pos[in] Head position

◆ set_locale()

sparksee.EdgeTypeLoader.set_locale ( self,
locale_str )

Sets the locale that will be used to read the data.

It should match the locale used in the rowreader.

Parameters
locale_str[in] The locale string for the read data. See CSVReader.

Reimplemented from sparksee.TypeLoader.

◆ set_log_error()

sparksee.EdgeTypeLoader.set_log_error ( self,
path )

Sets a log error file.

By default errors are thrown as a exception and the load process ends. If a log file is set, errors are logged there and the load process does not stop.

Parameters
path[in] The path to the error log file.
Exceptions
IOErrorIf bad things happen opening the file.

Reimplemented from sparksee.TypeLoader.

◆ set_log_off()

sparksee.EdgeTypeLoader.set_log_off ( self)

Truns off all the error reporting.

The log file will not be created and no exceptions for invalid data will be thrown. If you just want to turn off the logs, but abort at the first error what you should do is not call this method and not set a logError file.

Reimplemented from sparksee.TypeLoader.

◆ set_row_reader()

sparksee.EdgeTypeLoader.set_row_reader ( self,
rr )

Sets the input data source.

Parameters
rr[in] Input RowReader.

Reimplemented from sparksee.TypeLoader.

◆ set_tail_attribute()

sparksee.EdgeTypeLoader.set_tail_attribute ( self,
attr )

Sets the attribute that will be used to find the tail of the edge.

This method is protected because only the Edge loaders should have it.

Parameters
attr[in] Tail Attribute

◆ set_tail_mep()

sparksee.EdgeTypeLoader.set_tail_mep ( self,
mep )

Sets the flag to create missing tail nodes when loading nodes or edges.

flagTrue if the nodes need to be created. False otherwise

Parameters
mepnull

◆ set_tail_position()

sparksee.EdgeTypeLoader.set_tail_position ( self,
pos )

Sets the position of the tail attribute in the source data.

This method is protected because only the Edge loaders should have it.

Parameters
pos[in] Tail position

◆ set_timestamp_format()

sparksee.EdgeTypeLoader.set_timestamp_format ( self,
timestamp_format )

Sets a specific timestamp format.

Parameters
timestamp_format[in] A string with the timestamp format definition.

Reimplemented from sparksee.TypeLoader.

◆ set_type()

sparksee.EdgeTypeLoader.set_type ( self,
type )

Sets the type to be loaded.

Parameters
type[in] Type identifier.

Reimplemented from sparksee.TypeLoader.