Skip to content

Instantly share code, notes, and snippets.

View lambdazen's full-sized avatar

LambdaZen lambdazen

View GitHub Profile
@lambdazen
lambdazen / SchemaChecker.groovy
Last active June 29, 2018 20:32
Quick and Dirty Groovy/Gremlin Schema Checker
// You can run this code in a Gremlin shell. Tested with Tinkerpop 2.4.0
// A sample graph -- See https://github.com/tinkerpop/blueprints/wiki/Property-Graph-Model
g = TinkerGraphFactory.createTinkerGraph()
// The schema for the sample graph -- See http://lambdazen.blogspot.com/2014/01/do-property-graphs-have-schemas.html
sg = new TinkerGraph()
person = sg.addVertex()
person.setProperty('_label', 'person')
person.setProperty('name', 'java.lang.String')
person.setProperty('age', 'java.lang.Integer')