Similar Items: Positive First-order Logic on Words and Graphs