def preprocess_path(path):
    """ Given a dataset path, the following structure is to be expected:
        - path/
            - files/
                - S_00000.gdm
                - S_00000.gdm.meta
                - S_00001.gdm
                - S_00001.gdm.meta
                - ...
                - schema.xml
                - [profile.xml]
                - [web_profile.xml]
            - [info.txt]
            - [query.txt]
            - [vocabulary.txt]

    :param path
    :return: the path where the gdm data are
    """
    if path.startswith("gs://"):
        fs = gcsfs.GCSFileSystem(token=get_gcloud_token())
        for sub_f in fs.ls(path):
            if sub_f.endswith("/") and sub_f.split("/")[-2] == FILES_FOLDER:
                return "gs://" + sub_f
        return path
    if path.startswith("hdfs://"):
        return path
    for sub_f in os.listdir(path):
        sub_f_tot = os.path.join(path, sub_f)
        if os.path.isdir(sub_f_tot) and sub_f == FILES_FOLDER:
            if check_for_dataset(sub_f_tot):
                return sub_f_tot
            else:
                raise ValueError("Dataset in {} was not in GMQL format".format(sub_f_tot))
    # if we are here it means that there is no files folder...so we need to check the root
    if check_for_dataset(path):
        return path
    else:
        raise ValueError("Dataset in {} was not in GMQL format".format(path))
Given a dataset path, the following structure is to be expected:
        - path/
            - files/
                - S_00000.gdm
                - S_00000.gdm.meta
                - S_00001.gdm
                - S_00001.gdm.meta
                - ...
                - schema.xml
                - [profile.xml]
                - [web_profile.xml]
            - [info.txt]
            - [query.txt]
            - [vocabulary.txt]

    :param path
    :return: the path where the gdm data are