@Test
    public void shouldFilter() {
        final Map<String,Vertex> x = (Map) g.sparql(  "SELECT ?a ?b ?c\n" +
                                                            "WHERE {\n" +
                                                            "  ?a v:label \"person\" .\n" +
                                                            "  ?a e:knows ?b .\n" +
                                                            "  ?a e:created ?c .\n" +
                                                            "  ?b e:created ?c .\n" +
                                                            "  ?a v:age ?d .\n" +
                                                            "    FILTER (?d < 30)\n" +
                                                            "}").next();

        assertEquals(x.get("a"), _g.V(1).next());
        assertEquals(x.get("b"), _g.V(4).next());
        assertEquals(x.get("c"), _g.V(3).next());
        assertEquals(3, x.size());
    }
@author Stephen Mallette (http://stephen.genoprime.com)
sparql-gremlin/src/test/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSourceTest.java