fluxion.jsongraph.objects.node module

class fluxion.jsongraph.objects.node.Node(id, label=None, metadata=None)

Bases: object

Node class representing a node in the JSON Graph Format.

ID = 'id'
LABEL = 'label'
METADATA = 'metadata'
get_id()

Get the id of the node.

Returns:

string id of the node

get_label()

Get the label of the node.

Returns:

string label of the node if set, else None

get_metadata()

Get the metadata of the node.

Returns:

dictionary the metadata of the node if set, else None

set_id(id)

Method to set the id of the node.

Parameters:

set (id -- string the id to)

set_label(label)

Method to set the label of the node.

Parameters:

set. (label -- string the label to)

set_metadata(metadata)

Method to set the metadata of the node.

Parameters:

set. (metadata -- dictionary the metadata to)

to_JSON()

Convert the node to JSON.

Creates a dictionary object of the node conforming to the JSON Graph Format.

Returns:

dictionary the node as dictionary ready to serialize

class fluxion.jsongraph.objects.node.TestNodeClass(methodName='runTest')

Bases: TestCase

test_base()
test_setters()
test_to_JSON()