ScriptEngine engine = new GremlinGroovyScriptEngine();
assertEquals("轉注", engine.eval("'轉注'"));
}
public void testUTF8Query() throws Exception {
TinkerGraph graph = new TinkerGraph();
Index<Vertex> index = graph.createIndex("nodes", Vertex.class);
Vertex nonUtf8 = graph.addVertex("1");
nonUtf8.setProperty("name", "marko");
nonUtf8.setProperty("age", 29);
index.put("name", "marko", nonUtf8);
Vertex utf8Name = graph.addVertex("2");
utf8Name.setProperty("name", "轉注");
utf8Name.setProperty("age", 32);
index.put("name", "轉注", utf8Name);
graph.addVertex(utf8Name);
graph.addEdge("12", nonUtf8, utf8Name, "created").setProperty("weight", 0.2f);
ScriptEngine engine = new GremlinGroovyScriptEngine();
engine.put("g", graph);
Pipeline eval = (Pipeline) engine.eval("g.idx(\"nodes\")[['name' : 'marko']]");