3. A system for performing a query, the system comprising: a non-transitory computer readable medium that includes: a query rewrite module that receives a user graph query and that rewrites the user graph query as a new query based on a query policy expressed in a graph query language, the user graph query being user generated, the query policy being expressed as a set of one or more views, where each view includes a first query that evaluates whether the query policy applies to the user and a second query that determines graph data that is viewable to the user through the view, wherein the new query comprises a union of conjunctive queries wherein each query in the union is a result of considering one combination from a Cartesian product of the user graph query and the set of one or more views; the query rewrite module further configured to create an optimized query by removing redundant views from the new query, removing any empty views from the new query, and removing any empty sub-query of the new query; and a query module that performs the optimized query on a graph data to obtain a result, wherein the graph data includes a set of triples, wherein the query rewrite module rewrites the user query by: identifying a plurality of views in the query policy; separating the plurality of views into groups based on a query predicate; considering one view from each of the groups as a rewritten query based on a query predicate; and generating the new query based on a union of the rewritten queries.
3. A system for performing a query, the system comprising: a non-transitory computer readable medium that includes: a query rewrite module that receives a user graph query and that rewrites the user graph query as a new query based on a query policy expressed in a graph query language, the user graph query being user generated, the query policy being expressed as a set of one or more views, where each view includes a first query that evaluates whether the query policy applies to the user and a second query that determines graph data that is viewable to the user through the view, wherein the new query comprises a union of conjunctive queries wherein each query in the union is a result of considering one combination from a Cartesian product of the user graph query and the set of one or more views; the query rewrite module further configured to create an optimized query by removing redundant views from the new query, removing any empty views from the new query, and removing any empty sub-query of the new query; and a query module that performs the optimized query on a graph data to obtain a result, wherein the graph data includes a set of triples, wherein the query rewrite module rewrites the user query by: identifying a plurality of views in the query policy; separating the plurality of views into groups based on a query predicate; considering one view from each of the groups as a rewritten query based on a query predicate; and generating the new query based on a union of the rewritten queries. 4. The system of claim 3 wherein the graph query language is at least one of SPARQL, RDQL, and RQL.