def parse_processing_parents(processings, parent_keys):
    """Return a dictionary relating each processing identifier to its parent.

    Parameters
    ----------
    processings : dict
        A dictionary of processing data, whose keys are processing identifiers
        and values are dictionaries containing corresponding processing data.
        This sort of dictionary is generated by reading the JSON file containing
        processing/artifact metadata derived from the processing network/tree on
        Qiita.
    parent_keys : ordered iterable of str
        An ordered collection of strings that are keys that will be
        sequentially used to find parent processing identifiers in the
        processing data of the `processings` argument.

    Returns
    -------
    dict
        Dictionary whose keys are processing identifiers and values are the
        identifiers of a parent processing.
    """
    processing_parents = {}
    for proc_id, proc_data in processings.items():
        for key in parent_keys:
            try:
                parent_id = proc_data[key]
            except KeyError:
                # Processings can also have no parents, in which case the for
                # loop will simply exhaust all keys.
                pass
            else:
                processing_parents[proc_id] = parent_id
                break
    return processing_parents