def clean(dirty_json, dataset, text_threshold=50):
    """Standardise a json data's schema. This function will identify
    four types of entity: the title (must be called 'title' in the input
    json), the id (must be called 'id' in the input json), text bodies
    (will be searchable in Clio, required to have at least 'text_threshold'
    characters), and 'other' fields which is everything else.

    Args:
        dirty_json (json): Input raw data json.
        dataset (str): Name of the dataset.
        text_threshold (int): Minimum number of characters required
                              to define a body of text as a textBody field.
    Returns:
        uid, cleaned_json, fields: list of ids, cleaned json, set of fields
    """
    uid = []
    cleaned_json = []
    fields = set()
    for row in dirty_json:
        new_row = dict()
        for field, value in row.items():
            # Ignore nulls
            if value is None:
                continue
            if field == "title":
                field = f"title_of_{dataset}"
            elif field == "id":
                field = f"id_of_{dataset}"
                uid.append(value)
            elif type(value) is str and len(value) > text_threshold:
                field = f"textBody_{field}_{dataset}"
            else:
                field = f"other_{field}_{dataset}"
            new_row[field] = value
            fields.add(field)
        cleaned_json.append(new_row)
    return uid, cleaned_json, fields