Structural, optical, dielectric and electrical transport properties of a [Mg(H2O)6]2+-templated proton conducting, semiconducting and photoresponsive 3D hydrogen bonded supramolecular framework