<｜begin▁of▁sentence｜>### Instruction:
Given the Condensed Matter collaborations graph from the year 2005, which you can read from a GML file named 'cond-mat-2005.gml', can you use the LAIS2 function in cdlib to perform community detection? And can you convert the resulting NodeClustering object to a JSON representation?
### Response:
import networkx as nx
from cdlib import algorithms

# Create a graph from the 'cond-mat-2005.gml' file
G = nx.read_gml('cond-mat-2005.gml')

# Apply the LAIS2 community detection algorithm
communities = algorithms.lais2(G)

# Convert the NodeClustering object to json
communities_json = communities.to_json()

print(communities_json)
<|EOT|>
