Structural, electronic, and optical properties of periodic graphene/h-BN van der Waals heterostructures