In one embodiment, a method includes storing one or more graphs, each graph comprising one or more nodes arranged in a hierarchical format, each node representing one or more data items; accessing a query requesting one or more specific data items in the graphs, the query being expressed in a language having a hierarchical format; retrieving the specific data items from the graphs; arranging the specific data items in a hierarchical format; and outputting the specific data items in response to the query.