Towards a Language for Pattern Manipulation and Querying