Altium Design Rule - How to apply to one named component?
It's InComponent(), i.e.:

InComponent ('J2') OR InComponent('J3') OR InComponent ('J4') OR InComponent ('J5')

Likewise, if you end up making a ComponentClass, it's InComponentClass():

InComponentClass('WaivedClearance')

Remember that if you do a positional re-annotation or something similar at the end that changes reference designators, your rules and component classes won't update automatically.