Skip to content

Instantly share code, notes, and snippets.

@mzsima
Last active May 26, 2020 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzsima/22468c9aae13d3e8a8aed83f8efba8fe to your computer and use it in GitHub Desktop.
Save mzsima/22468c9aae13d3e8a8aed83f8efba8fe to your computer and use it in GitHub Desktop.
1+2のRPN

image

snapshot

code gremlin

schema.vertexLabel("Op").ifNotExists().partitionBy("id", Text).property("value", Text).create();
schema.edgeLabel('next').ifNotExists().from('Op').to('Op').create()
  
  
N1 = g.addV("Op").property("id", "a").property("value", "1").next();
N2 = g.addV("Op").property("id", "b").property("value", "2").next();
Plus = g.addV("Op").property("id", "c").property("value", "+").next();

g.addE("next").from(N1).to(N2).next();
g.addE("next").from(N2).to(Plus).next();

dev.V()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment