From my limited understanding, AQL functions do not normally include the path - see AQL spec
WHERE e/value/defining_code/code_string matches TERMINOLOGY('expand', 'hl7.org/fhir/4.0', 'http://snomed.info/sct?fhir_vs=isa/50697003')
if we also want to search for terms in mappings then currently we have to do.
WHERE e/value/defining_code/code_string matches TERMINOLOGY('expand', 'hl7.org/fhir/4.0', 'http://snomed.info/sct?fhir_vs=isa/50697003')
OR
e/value/mappings/target/code_string matches TERMINOLOGY('expand', 'hl7.org/fhir/4.0', 'http://snomed.info/sct?fhir_vs=isa/50697003')
and it is even worse if looking for an array of terms as we have to query on the term and the terminologyId separately.
So I still think this is closer to current AQL function approaches
WHERE sys.name/value/CONTAINS_TERM(TERMINOLOGY(βexpandβ, βIndex - FHIR v4.0.1β, βhttp://snomed.info/sct?fhir_vs=isa/50697003β), β=β )
Happy to be proven wrong (again!)