HKSamples matching metadata ?

Some HKDiscreteQuantitySample types have metadata. Is it possible to write a HKSampleQuery that would return samples that match a specific metadata param? Use case: getting heartRate samples that match a specific HKHeartRateMotionContex case (or its raw value).