A strongly typed Server driver for Apache TinkerPop™ Gremlin enabled databases.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ExRam.Gremlinq.CosmosDb
ExRam.Gremlinq.Dse.Tests
ExRam.Gremlinq.Dse
ExRam.Gremlinq.Providers.WebSocket
ExRam.Gremlinq.Tests
ExRam.Gremlinq
.gitignore
Directory.build.props
ExRam.Gremlinq.sln
ExRam.Gremlinq.sln.DotSettings
LICENSE Initial commit Mar 21, 2017
README.md
version.json

README.md

ExRam.Gremlinq

ExRam.Gremlinq is a strongly typed Server driver for Apache TinkerPop™ Gremlin enabled databases.

Packages

Package Link
ExRam.Gremlinq #
ExRam.Gremlinq.Providers.WebSocket #
ExRam.Gremlinq.CosmosDb #

Features

Fluent Linq-style API:

Build strongly typed gremlin queries:

//Get all vertices with label "SomeVertexType" that have a property "SomeProperty" of value 36.

var query = g
    .V<Person>()
    .Has(x => x.Age == 36);

//Add a vertex with label "SomeVertexType" and add a property "SomeProperty" of value 36.
var query = g
    .AddV(new Person { Age = 36 });

//Above query can also be written differently:
var query = g
    .AddV<Person>()
    .Property(x => x.Age, 36);

//Anonymous traversals are supported seamlessly:
var query = g
    .AddV<Person>()
    .AddE<WorksAt>()
    .To(__ => __
        .AddV<Company>());

//Navigate through the graph:
var query = g
    .V<Person>('bob')
    .Out<WorksAt>();

//Deal easily with step labels:
var query = g
    .V<Person>('bob')
    .As((p, __ => __
        .Out<WorksAt>()
        .As((c, ___) => ___
            .Select(p, c)));

//Formulate more complex queries
var query = g
    .V<Person>()
    .Has(x => x.Age == 36 && x.Name == "Bob");

var query = g
    .V<Person>()
    .Has(x => x.Age != 36);

var query = g
    .V<Person>()
    .Has(x => x.Age < 36 && x.Name == "Bob");

var query = g
    .V<Person>()
    .Has(x => x.Name.StartsWith("B"));

var query = g
    .V<Person>()
    .Has(x => x.Pets.Contains("Daisy"));

var query = g
    .V<Person>()
    .Has(x => x.Pets.Any());
	
var query = g
    .V<Person>()
    .Where(t => t.PhoneNumbers.Intersects(new[] { "+4912345", "+4923456" }));

var query = g
    .V<Person>()
    .Where(t => new[] { 36, 37, 38 }.Contains(t.Age));

Development

The library is still under development. The API might change without notice. Help on this project is appreciated!