ExRam.Gremlinq is a .NET object-graph-mapper for Apache TinkerPop™ Gremlin enabled databases.
Package | Link |
---|---|
ExRam.Gremlinq.Core | |
ExRam.Gremlinq.Providers.WebSocket | |
ExRam.Gremlinq.Providers.CosmosDb |
A sample project can be found at https://github.com/ExRam/ExRam.Gremlinq.Samples.
var persons = await g
.V<Person>()
.Where(x => x.Age == 36)
.ToArray();
var person = await g
.AddV(new Person { Age = 36 })
.First();
var animals = await g
.V<Animal>()
.ToArray(); // Gets vertices of type 'Cat' or 'Dog' if they inherit from 'Animal'
var edge = await g
.AddV<Person>()
.AddE<WorksAt>()
.To(__ => __
.AddV<Company>())
.First();
var person = await g
.AddV<Person>()
.AddE<WorksAt>()
.To(__ => __
.AddV<Company>())
.OutV()
.First();
var employers = await g
.V<Person>('bob')
.Out<WorksAt>()
.ToArray();
var tuples = await g
.V<Person>('bob')
.As((p, __ => __
.Out<WorksAt>()
.As((c, ___) => ___
.Select(p, c)))
.ToArray();
var persons = await g
.V<Person>()
.Where(x => x.Age == 36 && x.Name == "Bob")
.ToArray();
var persons = await g
.V<Person>()
.Where(x => x.Age != 36)
.ToArray();
var persons = await g
.V<Person>()
.Where(x => x.Age < 36 && x.Name == "Bob")
.ToArray();
var persons = await g
.V<Person>()
.Where(x => x.Name.StartsWith("B"))
.ToArray();
var persons = await g
.V<Person>()
.Where(x => x.Pets.Contains("Daisy"))
.ToArray();
var persons = await g
.V<Person>()
.Where(x => x.Pets.Any())
.ToArray();
var persons = await g
.V<Person>()
.Where(t => t.PhoneNumbers.Intersects(new[] { "+4912345", "+4923456" }))
.ToArray();
var persons = await g
.V<Person>()
.Where(t => new[] { 36, 37, 38 }.Contains(t.Age))
.ToArray();
Help on this project is greatly appreciated! Check out the issues labelled 'up-for-grabs' or file your own and tackle them!
The 'Gremlin'-graphic used in this project's logo on top of this page is a trademark of the Apache Software Foundation/Apache TinkerPop.