Add support for partial query attributes
Add support for `Q.SELF`

`Q.SELF` allows the definition of a query attribute to refers to the
entity itself; `Q.SELF` is useful for some kinds of polymorphic queries.