Giter Club home page Giter Club logo

exram.gremlinq's Introduction

ExRam.Gremlinq is a .NET object-graph-mapper for Apache TinkerPop™ Gremlin enabled databases.

Packages

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

Sample project

A sample project can be found at https://github.com/ExRam/ExRam.Gremlinq.Samples.

Features

Build strongly typed gremlin queries

    var persons = await g
        .V<Person>()
        .Where(x => x.Age == 36)
        .ToArray();

    var person = await g
        .AddV(new Person { Age = 36 })
        .First();

Inheritance support

    var animals = await g
        .V<Animal>()
        .ToArray();     // Gets vertices of type 'Cat' or 'Dog' if they inherit from 'Animal'

Deal with anonymous traversals, continuation passing style

    var edge = await g
        .AddV<Person>()
        .AddE<WorksAt>()
        .To(__ => __
            .AddV<Company>())
        .First();

The fluent api remembers in- and out-vertices

    var person = await g
        .AddV<Person>()
        .AddE<WorksAt>()
        .To(__ => __
            .AddV<Company>())
        .OutV()
        .First();

Navigate through the graph:

    var employers = await g
        .V<Person>('bob')
        .Out<WorksAt>()
        .ToArray();

Deal easily with step labels, also continuation passing style

    var tuples = await g
        .V<Person>('bob')
        .As((p, __ => __
            .Out<WorksAt>()
            .As((c, ___) => ___
                .Select(p, c)))
        .ToArray();

Support for complex expressions

    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();

Provider bindings

Development

Help on this project is greatly appreciated! Check out the issues labelled 'up-for-grabs' or file your own and tackle them!

Acknowledgements

The 'Gremlin'-graphic used in this project's logo on top of this page is a trademark of the Apache Software Foundation/Apache TinkerPop.

exram.gremlinq's People

Contributors

danielcweber avatar syntaxunknown avatar javaadpatel avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.