<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_schema_mapping(schema_dir, resource_listing):
 """Discovers schema file locations and relations. :param schema_dir: the directory schema files live inside :type schema_dir: string :param resource_listing: A swagger resource listing :type resource_listing: dict :returns: a mapping from resource name to file path :rtype: dict """

    def resource_name_to_filepath(name):
        return os.path.join(schema_dir, '{0}.json'.format(name))

    return dict(
        (resource, resource_name_to_filepath(resource))
        for resource in find_resource_names(resource_listing)
    )