Similar Items: Logics for Context-free Hyperproperties