<｜begin▁of▁sentence｜>### Instruction:
Certainly! Imagine you're consulting on a green construction project where sustainable practices are a priority. The project management team uses a streamlined communication system that incorporates detailed visual representations for efficient planning and tracking. You have a simplified model representing the flow of resources between three key departments in the project: Planning, Sourcing, and Implementation. Each department is represented as a node, and the connections between them, symbolizing the flow of information and resources, are the edges.

We need to digitally encode this model's structure in a JSON format to integrate it with our project management software. This encoding should include bespoke labels for each department node and each connection to clearly identify them within the software. The goal is to do this without losing the meaning and relationships inherent in the original model, ensuring a seamless translation into the digital representation the team uses.

Could you rephrase the given task while keeping it relevant to the green building project, ensuring to specify that the model should be formatted into JSON, with unique identifiers for each department node and the connections between them? If there's a need to reference a file, like a gml that contains the graph's details, it should be aptly named within the scenario framework, such as "resource_flow.gml".
### Response:
import networkx as nx

# Create a graph
G = nx.path_graph(3)

# Add some attributes to nodes and edges
for i in range(3):
    G.nodes[i]['label'] = f'Node {i}'
G.edges[0, 1]['label'] = 'Edge 0-1'
G.edges[1, 2]['label'] = 'Edge 1-2'

# Get the Cytoscape JSON representation of the graph
data = nx.cytoscape_data(G)

# Modify the dictionary to fit the desired output format
output = {'graph nodes': [], 'graph edges': []}
for node in data['elements']['nodes']:
    output['graph nodes'].append({'id': node['data']['id'], 'label': node['data'].get('label', '')})
for edge in data['elements']['edges']:
    output['graph edges'].append({'source': edge['data']['source'],
                                  'target': edge['data']['target'],
                                  'label': edge['data'].get('label', '')})

print(output)
<|EOT|>
