def get_io_from_prov_json(prov_json):
    """Identify input and output files from provenance JSON
    Parameters
    ----------
    prov_json : OrderedDict
                ordered dictionary generated from json prov file using python's json module
                i.e. json.load(path_to_json_file, object_pairs_hook=OrderedDict)

    Returns
    -------
    (input_files, output_files, file_locs) : tuple of (list, list, dict)
                                             input files and output files (empty lists if none) and
                                             dict mapping files to location (empty if none)
    """
    # initializing data structures
    entity_to_file = {}
    file_locs = {}
    input_files = []
    output_files = []

    # get file entity names and locations
    for key, value in prov_json['entity'].items():
        if value['rdt:type'] == 'File':
            filename = value['rdt:name']
            entity_to_file[key] = filename
            file_locs[filename] = value['rdt:location']

    entities = set(entity_to_file.keys())

    # if a file entity is used by an activity, it must be an input file
    for value in prov_json['used'].values():
        if value['prov:entity'] in entities:
            input_files.append(entity_to_file[value['prov:entity']])

    # if a file entity was generated by an activity, it must be an output file
    for value in prov_json['wasGeneratedBy'].values():
        if value['prov:entity'] in entities:
            output_files.append(entity_to_file[value['prov:entity']])

    return input_files, output_files, file_locs