def METHOD_NAME(
        self, reference: _EXTERNAL_REFERENCE_TYPING) -> dict:
    if reference.source_name == 'url':
        return {
            'value': reference.url,
            **self._mapping.references_attribute()
        }
    external_id = reference.external_id
    return {
        'value': external_id.split('-')[1]
        if external_id.startswith('CAPEC-') else external_id,
        **self._mapping.attack_pattern_id_attribute()
    }