def graph_to_entities_json(g):
    """
    Converts the given graph to entities JSON.
    :param g: a graph
    :return: an array of JSON
    """
    entities = []
    for u, v in g.edges():
        entity = {
            "Device": "",
            "IP": "",
            "Identity": "",
            "Location": "",
            "Cookie": ""
        }
        source = g.nodes()[u]
        target = g.nodes()[v]
        entity[source["label"]] = source["id"]
        entity[target["label"]] = target["id"]
        entities.append(entity)
    return entities