import json


def _get_metadata(dataset):
    """Get the layer metadata if exist"""

    metadata = [k for k in dataset['keywords']
                if k.startswith('layer_info:')]
    if not metadata:
        return ""
    else:
        return json.loads(metadata[0].split("layer_info:")[1])