final OrientGraph graph = OGraphCommandExecutorSQLFactory.getGraph(false);
try {
final Iterable<OrientVertex> vertices;
if (language.equals("sql"))
vertices = graph.command(new OSQLSynchQuery<OrientVertex>(text, limit).setFetchPlan(fetchPlan)).execute();
else if (language.equals("gremlin")) {
List<Object> result = new ArrayList<Object>();
OGremlinHelper.execute(graph, text, null, null, result, null, null);
vertices = new ArrayList<OrientVertex>(result.size());