def _validate_optional_links(self, expected, links):
        for uri, l in links.items():
            try:
                rel = l['rel']
            except __HOLE__:
                raise exception.OCCIMissingType(type_id=uri)
            for ex in expected:
                if rel == ex.type_id:
                    break
            else:
                expected_types = ', '.join([e.type_id for e in expected])
                raise exception.OCCISchemaMismatch(expected=expected_types,
                                                   found=l['rel'])
dataset/ETHPy150Open openstack/ooi/ooi/occi/validator.py/Validator._validate_optional_links