def METHOD_NAME(collected_path, message_path, ld_op="compact"):
    """
    Compile all messages into a single provenance graph.
    Parameters
    ----------
    collected_path : :obj:`os.pathlike`
        A place to write all of the collected messages. (?TODO)
    message_path : :obj:`os.pathlike`
        A path with the message file (?TODO)
    ld_op : :obj:`str`, optional
        Option used by pld.jsonld
    """
    import pyld as pld
    import json
    from glob import glob
    fl = glob(str(message_path / "*.jsonld"))
    data = []
    for f in fl:
        with open(f) as fp:
            data.append(json.load(fp))
    if data:
        records = getattr(pld.jsonld, ld_op)(
            pld.jsonld.from_rdf(pld.jsonld.to_rdf(data, {})), data[0]
        )
        records["@id"] = f"uid:{gen_uuid()}"
        with open(collected_path / "messages.jsonld", "w") as fp:
            json.dump(records, fp, ensure_ascii=False, indent=2, sort_keys=False)