'Turns a value read from a external dict into its value to be pushed directly into the metadata dict.'

def from_external_value(self, value, parent, path_rewriter=None):

    if MetadataTempFile.is_JSONified_value(value):
        value = MetadataTempFile.from_JSON(value)
    if isinstance(value, MetadataTempFile):
        mf = parent.metadata.get(self.spec.name, None)
        if (mf is None):
            mf = self.new_file(dataset=parent, **value.kwds)
        file_name = value.file_name
        if path_rewriter:
            file_name = path_rewriter(file_name)
        parent.dataset.object_store.update_from_file(mf, file_name=file_name, extra_dir='_metadata_files', extra_dir_at_root=True, alt_name=os.path.basename(mf.file_name))
        os.unlink(file_name)
        value = mf.id
    return value
