Skip to content

Instantly share code, notes, and snippets.

@zmaril
Created December 11, 2012 07:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zmaril/4256562 to your computer and use it in GitHub Desktop.
Save zmaril/4256562 to your computer and use it in GitHub Desktop.
TitanKey happiness = g.makeType().name("happiness").dataType(Integer.class).eidetic(true).makePropertyKey();
TitanVertex v = g.addVertex()
v.setProperty("name","Zack")
v.setProperty("happiness",2)
v.getProperty("happiness")
//TimeSeries([[2,1000]])
v.setProperty("happiness",10)
v.getProperty("happiness")
//TimeSeries([[2,1000],[10,1001]])
v.getProperty("happiness").now()
//10
v.setProperty("happiness",7).setProperty("happiness",6).setProperty("happiness",10)
Thread.sleep(1000)
v.setProperty("happiness",3).setProperty("happiness",4).setProperty("happiness",5)
v.getProperty("happiness").history()
/*
[
[2,1000],
[10,1001],
[7,1002],
[6,1003],
[10,1004],
[3,2004],
[4,2005],
[5,1006]
]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment