<commit_before>/******************************************************************************** 
	component-centric-snapshot-description-unique-term-in-concept

	Assertion:
	For a given concept, all active description terms are unique.

	Implementation is limited to active descriptions of active concepts edited 
	in the current prospective release.
********************************************************************************/
/*  violators have the same term twice within a concept */
	insert into qa_result (runid, assertionuuid, concept_id, details)
	select 
		<RUNID>,
		'<ASSERTIONUUID>',
		c.conceptid,
		concat('DESC: Id=', c.id, ': non-unique term within concept.') 
	from res_concepts_edited a
		join curr_concept_s b
			on a.conceptid = b.id
			and b.active = 1
		join curr_description_s c
			on c.conceptid = a.conceptid
			and c.active = 1
	group by c.conceptid,  binary c.term
	having count(c.conceptid) > 1
	and binary count(c.term) > 1;
			<commit_msg>Update unique term validation to include the language code<commit_after>/******************************************************************************** 
	component-centric-snapshot-description-unique-term-in-concept

	Assertion:
	For a given concept, all active description terms are unique.

	Implementation is limited to active descriptions of active concepts edited 
	in the current prospective release.
********************************************************************************/
/*  violators have the same term twice within a concept */
	insert into qa_result (runid, assertionuuid, concept_id, details)
	select 
		<RUNID>,
		'<ASSERTIONUUID>',
		c.conceptid,
		concat('DESC: Id=', c.id, ': non-unique term within concept.') 
	from res_concepts_edited a
		join curr_concept_s b
			on a.conceptid = b.id
			and b.active = 1
		join curr_description_s c
			on c.conceptid = a.conceptid
			and c.active = 1
	group by c.conceptid, c.languagecode, binary c.term
	having count(c.conceptid) > 1
	and binary count(c.term) > 1;
			
{'fraction_non_alphanumeric': 0.23107569721115537, 'fraction_numerical': 0.00398406374501992, 'mean_word_length': 4.707386363636363, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6005885', 'n_tokens_mistral': 627, 'n_tokens_neox': 541, 'n_words': 185}