def construct_rest_of_worlds_mapping(self, excluded, fp=None):
metadata = {<EOL>'<STR_LIT:filename>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT:id>',<EOL>'<STR_LIT>': sha256(self.faces_fp)<EOL>}<EOL>data = []<EOL>for key, locations in excluded.items():<EOL><INDENT>for location in locations:<EOL><INDENT>assert location in self.locations, "<STR_LIT>".format(location)<EOL><DEDENT>included = self.all_faces.difference(<EOL>{face for loc in locations for face in self.data[loc]}<EOL>)<EOL>data.append((key, sorted(included)))<EOL><DEDENT>obj = {'<STR_LIT:data>': data, '<STR_LIT>': metadata}<EOL>if fp:<EOL><INDENT>with open(fp, "<STR_LIT:w>") as f:<EOL><INDENT>json.dump(obj, f, indent=<NUM_LIT:2>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return obj<EOL><DEDENT>
Construct topo mapping file for ``excluded``.

        ``excluded`` must be a **dictionary** of {"rest-of-world label": ["names", "of", "excluded", "locations"]}``.

        Topo mapping has the data format:

        .. code-block:: python

            {
                'data': [
                    ['location label', ['topo face integer ids']],
                ],
                'metadata': {
                    'filename': 'name of face definitions file',
                    'field': 'field with uniquely identifies the fields in ``filename``',
                    'sha256': 'SHA 256 hash of ``filename``'
                }
            }