implemented query attribute parsing and ported some testcases