All Projects → ExRam → Exram.gremlinq

ExRam / Exram.gremlinq

Licence: mit
A .NET object-graph-mapper for Apache TinkerPop™ Gremlin enabled databases.

Projects that are alternatives of or similar to Exram.gremlinq

Tinkerpop
Apache TinkerPop - a graph computing framework
Stars: ✭ 1,309 (+1458.33%)
Mutual labels:  graph, graphdb, gremlin, tinkerpop
Janusgraph
JanusGraph: an open-source, distributed graph database
Stars: ✭ 4,277 (+4991.67%)
Mutual labels:  graph, graphdb, gremlin, tinkerpop
Unipop
Data Integration Graph
Stars: ✭ 184 (+119.05%)
Mutual labels:  graph, gremlin, tinkerpop
Gremlin Scala
Scala wrapper for Apache TinkerPop 3 Graph DSL
Stars: ✭ 462 (+450%)
Mutual labels:  graph, graphdb, gremlin
Gremlin Javascript
JavaScript tools for graph processing in Node.js and the browser inspired by the Apache TinkerPop API
Stars: ✭ 209 (+148.81%)
Mutual labels:  graphdb, gremlin, tinkerpop
Ogre
Clojure library for querying Apache TinkerPop graphs
Stars: ✭ 118 (+40.48%)
Mutual labels:  graph, gremlin, tinkerpop
Cypher For Gremlin
Cypher for Gremlin adds Cypher support to any Gremlin graph database.
Stars: ✭ 267 (+217.86%)
Mutual labels:  graph, gremlin, tinkerpop
Quartznet
Quartz Enterprise Scheduler .NET
Stars: ✭ 4,825 (+5644.05%)
Mutual labels:  hacktoberfest, dotnetcore
Natasha
基于 Roslyn 的 C# 动态程序集构建库,该库允许开发者在运行时使用 C# 代码构建域 / 程序集 / 类 / 结构体 / 枚举 / 接口 / 方法等,使得程序在运行的时候可以增加新的模块及功能。Natasha 集成了域管理/插件管理,可以实现域隔离,域卸载,热拔插等功能。 该库遵循完整的编译流程,提供完整的错误提示, 可自动添加引用,完善的数据结构构建模板让开发者只专注于程序集脚本的编写,兼容 stanadard2.0 / netcoreapp3.0+, 跨平台,统一、简便的链式 API。 且我们会尽快修复您的问题及回复您的 issue.
Stars: ✭ 705 (+739.29%)
Mutual labels:  hacktoberfest, dotnetcore
Dracula
JavaScript layout and representation of connected graphs.
Stars: ✭ 767 (+813.1%)
Mutual labels:  hacktoberfest, graph
Azure.data.wrappers
Azure Storage Simplified
Stars: ✭ 34 (-59.52%)
Mutual labels:  azure, dotnetcore
Redis Graph
A graph database with Cypher query language as a Redis module
Stars: ✭ 404 (+380.95%)
Mutual labels:  graph, graphdb
Azure Sdk For Go
Microsoft Azure SDK for Go
Stars: ✭ 847 (+908.33%)
Mutual labels:  azure, hacktoberfest
Maximerouiller.azure.appservice.easyauth
.NET Core integration of Azure AppService EasyAuth
Stars: ✭ 38 (-54.76%)
Mutual labels:  azure, dotnetcore
Cli Microsoft365
Manage Microsoft 365 and SharePoint Framework projects on any platform
Stars: ✭ 420 (+400%)
Mutual labels:  azure, hacktoberfest
Awesome Graph
A curated list of resources for graph databases and graph computing tools
Stars: ✭ 717 (+753.57%)
Mutual labels:  graph, graphdb
Mldotnet Real Time Data Streaming Workshop
A Machine Learning and Real-Time Data Analytics Workshop
Stars: ✭ 34 (-59.52%)
Mutual labels:  azure, dotnetcore
Geeksforgeeks Dsa 2
This repository contains all the assignments and practice questions solved during the Data Structures and Algorithms course in C++ taught by the Geeks For Geeks team.
Stars: ✭ 53 (-36.9%)
Mutual labels:  hacktoberfest, graph
Hands On Microservices With Csharp 8 And .net Core 3 Third Edition
Hands-On Microservices with C# 8 and .NET Core 3, Third Edition, published by Packt
Stars: ✭ 46 (-45.24%)
Mutual labels:  azure, dotnetcore
Developing Solutions Azure Exam
This repository contains resources for the Exam AZ-203: Developing Solutions for Microsoft Azure. You can find direct links to resources and and practice resources to test yourself ☁️🎓📚
Stars: ✭ 59 (-29.76%)
Mutual labels:  azure, dotnetcore

Gremlinq mascot

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

Build status

Packages

Package Stable Preview
ExRam.Gremlinq.Core # #
ExRam.Gremlinq.Providers.WebSocket # #
ExRam.Gremlinq.Providers.GremlinServer # #
ExRam.Gremlinq.Providers.CosmosDb # #
ExRam.Gremlinq.Providers.Neptune # #
ExRam.Gremlinq.Providers.JanusGraph # #
ExRam.Gremlinq.Core.AspNet # #
ExRam.Gremlinq.Providers.WebSocket.AspNet # #
ExRam.Gremlinq.Providers.GremlinServer.AspNet # #
ExRam.Gremlinq.Providers.CosmosDb.AspNet # #
ExRam.Gremlinq.Providers.Neptune.AspNet # #
ExRam.Gremlinq.Providers.JanusGraph.AspNet # #

Sample project

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

Commercial support

For commercial support, contact
#

Features

The following snippets are part of the sample project mentioned above. They showcase some of the many features of ExRam.Gremlinq.

Easily create vertices and edges

    var marko = await _g
        .AddV(new Person { Name = "Marko", Age = 29 })
        .FirstAsync();

    var vadas = await _g
        .AddV(new Person { Name = "Vadas", Age = 27 })
        .FirstAsync();
            
    var josh = await _g
        .AddV(new Person { Name = "Josh", Age = 32 })
        .FirstAsync();

    var peter = await _g
        .AddV(new Person { Name = "Peter", Age = 35 })
        .FirstAsync();

    var daniel = await _g
        .AddV(new Person
        {
            Name = "Daniel",
            Age = 37,
            PhoneNumbers = new []
            {
                "+491234567",
                "+492345678"
            }
        })
        .FirstAsync();

    var charlie = await _g
        .AddV(new Dog { Name = "Charlie", Age = 2 })
        .FirstAsync();

    var catmanJohn = await _g
        .AddV(new Cat { Name = "Catman John", Age = 5 })
        .FirstAsync();

    var luna = await _g
        .AddV(new Cat { Name = "Luna", Age = 9 })
        .FirstAsync();

    var lop = await _g
        .AddV(new Software { Name = "Lop", Language = ProgrammingLanguage.Java })
        .FirstAsync();

    var ripple = await _g
        .AddV(new Software { Name = "Ripple", Language = ProgrammingLanguage.Java })
        .FirstAsync();

    await _g
        .V(_marko.Id)
        .AddE<Knows>()
        .To(__ => __
            .V(vadas.Id))
        .FirstAsync();

    await _g
        .V(_marko.Id)
        .AddE<Knows>()
        .To(__ => __
            .V(josh.Id))
        .FirstAsync();

    await _g
        .V(_marko.Id)
        .AddE<Created>()
        .To(__ => __
            .V(lop.Id))
        .FirstAsync();

    await _g
        .V(josh.Id)
        .AddE<Created>()
        .To(__ => __
            .V(ripple.Id))
        .FirstAsync();

    await _g
        .V(josh.Id)
        .AddE<Created>()
        .To(__ => __
            .V(lop.Id))
        .FirstAsync();

    await _g
        .V(peter.Id)
        .AddE<Created>()
        .To(__ => __
            .V(lop.Id))
        .FirstAsync();

    await _g
        .V(josh.Id)
        .AddE<Owns>()
        .To(__ => __
            .V(charlie.Id))
        .FirstAsync();

    await _g
        .V(josh.Id)
        .AddE<Owns>()
        .To(__ => __
            .V(luna.Id))
        .FirstAsync();

    await _g
        .V(daniel.Id)
        .AddE<Owns>()
        .To(__ => __
            .V(catmanJohn.Id))
        .FirstAsync();

    // Add Persons and and edge in between in one single query!
    await _g
        .AddV(new Person { Name = "Bob", Age = 36 })
        .AddE<Knows>()
        .To(__ => __
            .AddV(new Person { Name = "Jeff", Age = 27 }))
        .FirstAsync();

Build nice queries

From marko, walk all the Knows edges to all the Persons that he knows and order them by their names:

    var peopleKnownToMarko = await _g
        .V(marko.Id)
        .Out<Knows>()
        .OfType<Person>()
        .Order(_ => _
            .By(x => x.Name))
        .Values(x => x.Name)
        .ToArrayAsync();


Gremlinq supports boolean expressions like you're used to use them in your Linq-queries. Under the hood, they will be translated to the corresponding Gremlin-expressions, like

g.V().hasLabel('Person').has('Age', gt(30))

in this case:

    var peopleOlderThan30 = await _g
        .V<Person>()
        .Where(x => x.Age > 30)
        .ToArrayAsync();


Even an expression like 'StartsWith' on a string will be recognized by ExRam.Gremlinq and translated to proper Gremlin syntax:

    var nameStartsWithB = await _g
        .V<Person>()
        .Where(x => x.Name.Value.StartsWith("B"))
        .ToArrayAsync();


Here, we demonstrate how to deal with Gremlin step labels. Instead of dealing with raw strings, ExRam.Gremlinq uses a dedicated StepLabel-type for these. And you don't even need to declare them upfront, as the As-operator of ExRam.Gremlinq will put them in scope for you, along with a continuation-query that you can further build upon! Also, ExRam.Gremlinq's Select operators will not leave you with raw dictionaries (or maps, as Java calls them). Instead, you'll get nice ValueTuples!

    var friendTuples = await _g
        .V<Person>()
        .As((__, person) => __
            .Out<Knows>()
            .OfType<Person>()
            .As((__, friend) => __
                .Select(person, friend)));


ExRam.Gremlinq supports inheritance! Below query will find all the dogs and all the cats and instantiate the right type.

    var pets = await _g
        .V<Pet>();


This sample demonstrates how to fluently build projections with ExRam.Gremlinq. It can project to a ValueTuple or to a dynamic. In the latter case, the user may specify the name of each projection.

    var dynamics = await _g
        .V<Person>()
        .Project(b => b
            .ToDynamic()
            .By(person => person.Name)
            .By(
                "count",
                __ => __
                    .Cast<object>()
                    .Out<Owns>()
                    .OfType<Pet>()
                    .Count()));


ExRam.Gremlinq supports multi-properties! And since these are represented on the POCOs as arrays (in this case PhoneNumbers), you want to call things like Contain on them! ExRam.Gremlinq recognizes these expressions!

    var personWithThatPhoneNumber = await _g
        .V<Person>()
        .Where(person => person
            .PhoneNumbers
            .Contains("+491234567"))
        .FirstOrDefaultAsync();


Group also has a beautiful fluent interface!

    var entityGroups = await _g
       .V()
       .Group(g => g
           .ByKey(__ => __.Label())
           .ByValue(__ => __.Count()))
       .FirstAsync();


This showcases the power of the fluent interface of ExRam.Gremlinq. Once we go from a Person to the Created edge, the entity we came from is actually encoded in the interface, so on calling OutV, ExRam.Gremlinq remembers that we're now on a Person again.

    var creators = await _g
        .V<Person>()
        .OutE<Created>()
        .OutV()
        .Dedup();


ExRam.Gremlinq even defines extension methods on StepLabels so you can ask question like the following: Which persons have an age that's within a previously collected set of ages, referenced by a step label? So first, for simplicity, we inject 3 values (29, 30, 31), fold them and store them in a step label 'ages'. Note that these values 29, 30 and 31 don't need to be hard coded but can come from an ordinary traversal. Then, we ask for all the persons whose age is contained within the array that the 'ages' step label references.

    var personsWithSpecificAges = await _g
        .Inject(29, 30, 31)
        .Fold()
        .As((_, ages) => _
            .V<Person>()
            .Where(person => ages.Contains(person.Age)));


Finally, we demonstrate setting and retrieving properties on vertex properties. Furthermore, we show how to dynamically avoid queries if the underlying graph database provider doesn't support them. The following code will not run on AWS Neptune since it doesn't support meta properties.

    if (_g.Environment.FeatureSet.Supports(VertexFeatures.MetaProperties))
    {
        await _g
            .V<Person>(_marko.Id)
            .Properties(x => x.Name)
            .Property(x => x.Creator, "Stephen")
            .Property(x => x.Date, DateTimeOffset.Now)
            .ToArrayAsync();

        var metaProperties = await _g
            .V()
            .Properties()
            .Properties()
            .ToArrayAsync();
    }

Provider bindings

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].