You are confusing the concept of indices a bit. Using createKeyIndex
on Graph
in this way:
g.createKeyIndex('has', Edge.class)
Is not creating an "indexed" edge label called "has". It is creating a index on a property called "has" that will lookup an Edge
. If you want an index on "since" then simply do:
g.createKeyIndex('since', Edge.class)
That said, there is nothing I know of that exists in Neo4j that is analogous to vertex centric indices in Titan, so it's not as though your creation of a key index on "since" will allow Gremlin to take advantage of that index in a traversal outside of a simple key index lookup, like:
g.E('since', new Date())