fluxion.jsongraph.objects.multigraph module
- class fluxion.jsongraph.objects.multigraph.Multigraph(graphs=[], type=None, label=None, metadata=None)
Bases:
object- GRAPHS = 'graphs'
- LABEL = 'label'
- METADATA = 'metadata'
- TYPE = 'type'
- add_graph(graph)
Method to add a graph to the multigraph.
- Parameters:
add (graph -- Graph the graph to)
- get_graphs()
Method to get a list of all graphs in the multigraph.
- Returns:
[Graph] list of graphs present in the multigraph
- get_label()
Method to get the label of the multigraph.
- Returns:
string the label of the multigraph if set, else None
- get_metadata()
"Get the metadata of the multigraph.
- Returns:
dictionary the metadata of the multigraph if set, else None
- get_type()
Method to get the type of the multigraph.
- Returns:
string the typename of the multigraph if set, else None
- set_graphs(graphs)
Method to add a list of graphs.
- Parameters:
added (graphs -- [Graph] the list of graphs that need to be)
- set_label(label)
Method to set the label of the multigraph.
- Parameters:
set (label -- string the labelname of the multigraph to)
- set_metadata(metadata)
Method to set the metadata of the multigraph.
- Parameters:
multigraph (metadata -- dictionary the metadata to set on the)
- set_type(type)
Method to set the type of the multigraph.
- Parameters:
set (type -- string the typename of the multigraph to)
- to_JSON(asString=False)
Convert the multigraph to JSON.
Creates a dictionary object of the multigraph conforming to the JSON Graph Format.
- Parameters:
string (asString -- bool if set to True the method returns the JSON as)
- Returns:
dictionary the multigraph as dictionary ready to serialize