###Relational Queries

When JSON results are received from the API, they are used to build domain objects from the `Soapi.Domain` namespace.

Upon these objects are strategically placed queries, the same queries you will find rooted on the `Site` object, that are pre-keyed to return data for that object.

**NOTE**: 

Query methods are upper-cased to make it clear that it is a query method, not a property.

 - `user.reputation` <sub>(a json property)</sub><br/>
 - `user.Reputation()` <sub>(an api query)</sub><br/>
&nbsp;<br/>
 - `answer.comments` <sub>(a json property)</sub><br/>
 - `answer.Comments()` <sub>(an api query)</sub><br/>

---

**Soapi.Domain.User**
<ul>
<li><code>user.Answers().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/users/14/answers</sub><br/>&nbsp;</li>

<li><code>user.Badges().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/users/14/badges</sub><br/>&nbsp;</li>

<li><code>user.Comments().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/users/14/comments</sub><br/>&nbsp;</li>

<li><code>user.CommentsTo(18).invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/users/14/comments/18</sub><br/>&nbsp;</li>

<li><code>user.Favorites().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/users/14/favorites</sub><br/>&nbsp;</li>

<li><code>user.Mentioned().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/users/14/mentioned</sub><br/>&nbsp;</li>

<li><code>user.Questions().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/users/14/questions</sub><br/>&nbsp;</li>

<li><code>user.Reputation().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/users/14/reputation</sub><br/>&nbsp;</li>

<li><code>user.Tags().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/users/14/tags</sub><br/>&nbsp;</li>

<li><code>user.Timeline().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/users/14/timeline</sub><br/>&nbsp;</li>
</ul>

**Soapi.Domain.Answer**

<ul>

<li><code>answer.Comments().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/answers/1305/comments</sub><br/>&nbsp;</li>

<li><code>answer.Revisions().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/revisions/1305</sub><br/>&nbsp;</li>

<li><code>answer.Revisions().ByRevisionGuid("0eabd918-e2c9-4176-8dbd-d56fc8bd1dd2").invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/revisions/1305/0eabd918-e2c9-4176-8dbd-d56fc8bd1dd2</sub><br/>&nbsp;</li>
</ul>

**Soapi.Domain.Question**

<ul>
<li><code>question.Answers().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/questions/386/answers</sub><br/>&nbsp;</li>

<li><code>question.Comments().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/questions/386/comments</sub><br/>&nbsp;</li>

<li><code>question.Timeline().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/questions/386/timeline</sub><br/>&nbsp;</li>

<li><code>question.Revisions().invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/revisions/386</sub><br/>&nbsp;</li>

<li><code>question.Revisions().ByRevisionGuid("e452e755-a3fe-45d0-976f-e319ec460200").invoke(/*handlers here*/);</code><br/><sub>
http://api.stackapps.com/1.0/revisions/386/e452e755-a3fe-45d0-976f-e319ec460200</sub><br/>&nbsp;</li>
</ul>


Where you see `.invoke(/*handlers here*/)` is where you would implement a standard asynchronous pattern as described in the next post.....


**NEXT:** [Soapi.JS2 Async Pattern][1]


  [1]: http://stackapps.com/questions/1433/soapi-js2-a-whole-nother-thang-alpha-preview/1435#1435