def suggest_filename(dataset, include_extension=False, upper_case_elements=True):
    """
    Check that file names match requirements.

    Must be the raw filename without any extra paths parts.

    Parameters
    ----------
    dataset : espei.PickleableTinyDB
        TinyDB of the dataset
    include_extension : bool
        Whether to include the filename extension ('.json') in the final string
    upper_case_elements : bool
        Whether to force the elements to be all caps (True) or regular case capitialized.

    Returns
    -------
    str
        String of the suggested file name.

    Notes
    -----
    An exmaple filename would be:

    ``AL-CO-ZPF-BCC_A2-FCC_A1-ishikawa1998phase.json``

    The elements and phase names should be sorted.
    Everything should be caps (as in the dataset, but we don't check that here) except the reference should be exactly the same case.
    """
    ds = dataset.all()[0]  # there should only be one entry in the dataset
    if upper_case_elements:
        elements = '-'.join(sorted(set(ds['components'])-set(['VA']))).upper()
    else:
        elements = '-'.join(sorted([el.lower().capitalize() for el in set(ds['components']) - set(['VA'])]))
    output = ds['output'].upper()
    phases = '-'.join(sorted(ds['phases'])).upper()
    refkey = ds['reference']

    return '-'.join([elements, output, phases, refkey])