{"id":37032600,"url":"https://github.com/jonassyrstad/stardust.paradox","last_synced_at":"2026-03-13T21:01:38.923Z","repository":{"id":33223681,"uuid":"138338809","full_name":"JonasSyrstad/Stardust.Paradox","owner":"JonasSyrstad","description":"Entity framework'ish tool for developing .net applications using gremlin graph query language with CosmosDb","archived":false,"fork":false,"pushed_at":"2026-03-06T08:13:47.000Z","size":91831,"stargazers_count":8,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"Main","last_synced_at":"2026-03-06T11:14:24.275Z","etag":null,"topics":["cosmosdb","dotnet-standard","entityframework","graph","gremlin"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JonasSyrstad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-06-22T19:03:35.000Z","updated_at":"2026-02-06T15:44:01.000Z","dependencies_parsed_at":"2025-08-27T16:11:34.555Z","dependency_job_id":"051c1369-d5a2-4183-bc1d-1ad15d3dcf06","html_url":"https://github.com/JonasSyrstad/Stardust.Paradox","commit_stats":{"total_commits":127,"total_committers":7,"mean_commits":"18.142857142857142","dds":"0.11811023622047245","last_synced_commit":"390cbc71544226c0fe1f03cfd219a2ef03092cd5"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"purl":"pkg:github/JonasSyrstad/Stardust.Paradox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasSyrstad%2FStardust.Paradox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasSyrstad%2FStardust.Paradox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasSyrstad%2FStardust.Paradox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasSyrstad%2FStardust.Paradox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JonasSyrstad","download_url":"https://codeload.github.com/JonasSyrstad/Stardust.Paradox/tar.gz/refs/heads/Main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonasSyrstad%2FStardust.Paradox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30475616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T20:45:58.186Z","status":"ssl_error","status_checked_at":"2026-03-13T20:45:20.133Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cosmosdb","dotnet-standard","entityframework","graph","gremlin"],"created_at":"2026-01-14T03:59:53.790Z","updated_at":"2026-03-13T21:01:38.917Z","avatar_url":"https://github.com/JonasSyrstad.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stardust.Paradox\nEntity framework'ish tool for developing .net applications using gremlin graph query language with CosmosDb\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=JonasSyrstad_Stardust.Paradox\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=JonasSyrstad_Stardust.Paradox)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=JonasSyrstad_Stardust.Paradox\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=JonasSyrstad_Stardust.Paradox)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=JonasSyrstad_Stardust.Paradox\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=JonasSyrstad_Stardust.Paradox)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=JonasSyrstad_Stardust.Paradox\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=JonasSyrstad_Stardust.Paradox)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=JonasSyrstad_Stardust.Paradox\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=JonasSyrstad_Stardust.Paradox)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FJonasSyrstad%2FStardust.Paradox.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FJonasSyrstad%2FStardust.Paradox?ref=badge_shield)\n\n---\n\n## Stardust Gremlin Studio\n\n**A Modern Query Tool for Gremlin Graph Databases**\n\n| Download | Links |\n|----------|-------|\n| **Windows Installer** | [Download](https://github.com/JonasSyrstad/Stardust.Paradox/releases/latest) |\n| **Source Code** | [View](src/StardustGremlinStudio) |\n| **Docs** | [Read More](src/StardustGremlinStudio/README.md) |\n\n**Features:** Connect to Azure Cosmos DB and TinkerPop | Syntax highlighting | Graph visualization | Built-in playground | Scenario export\n\n---\n\n\n# Usage (asp.net core)\n\n## Startup.cs\n### ConfigureServices\nAdd the generated entity implementations to the IOC container (I will provide an extention method to make this easier)\n```cs\n services.AddEntityBinding((entityType, entityImplementation) =\u003e services.AddTransient(entityType, entityImplementation))\n        .AddScoped\u003cMyEntityContext,MyEntityContext\u003e()\n        .AddScoped\u003cIGremlinLanguageConnector\u003e(s =\u003e new CosmosDbLanguageConnector(DbAccountName, AccessKey, \"databaseName\",\"collectionName\"));\n```\n\n## Defining the model\n\n```cs\n[VertexLabel(\"person\")]\npublic interface IPerson : IVertex\n{\n    string Id {get;}\n\n    string FirstName { get; set; }\n\n    string LastName { get; set; }\n    \n    string Email { get; set; }\n\n    EpochDateTime Birthday {get;set;}//Wrapper type for DateTime that serializes into unix epoch. Can be used in predicate steps directly.\n\n    IEdgeCollection\u003cIPerson\u003e Parents { get; }\n\n    IEdgeCollection\u003cIPerson\u003e Children { get; }\n\n    IEdgeCollection\u003cIPerson\u003e Siblings { get; }\n\n    [InLabel(\"city\")] //pointing to the Residents property in ICity\n    IEdgeReference\u003cICity\u003e HomeCity { get; }//use IEdgeReference to enable task-async operations\n\n    IEdgeCollection\u003cICompany\u003e Employers { get; }\n}\n\n[VertexLabel(\"city\")]\npublic interface ICity : IVertex\n{\n    string Id { get; }\n\n    string Name { get; set; }\n\n    string ZipCode { get; set; }\n    \n\n   [OutLabel(\"city\")] //pointing to the HomCity property in IPerson\n    IEdgeCollection\u003cIperson\u003e Residents { get; } //use IEdgeCollection to enable task-async operations on the collection\n\n    IEdgeReference\u003cICountry\u003e Country { get; }\n}\n\n[VertexLabel(\"company\")]\npublic interface ICompany : IVertex\n{\n    string Id { get; }\n\n    string Name { get; set; }\n\n    IEdgeCollection\u003cICompany\u003e Employees { get; }\n}\n\n[VertexLabel(\"country\")]\npublic interface ICountry : IVertex\n{\n    string Id { get; }\n\n    string Name { get; set; }\n\n    string CountryCode { get; set; }\n\n    string PhoneNoPrefix { get; set; }\n\n    IEdgeCollection\u003cICity\u003e Cities { get; }\n}\n\n [EdgeLabel(\"employer\")]\n    public interface IEmployment : IEdge\u003cIProfile, ICompany\u003e\n    {\n        string Id { get; }\n\n        EpochDateTime HiredDate { get; set; }\n\n        string Manager { get; set; }\n    }\n\n```\n\n## Defining the entity context and generating the entity implementations\n\n```cs\npublic class MyEntityContext : Stardust.Paradox.Data.GraphContextBase\n{\n\n    static MyEntityContext()\n    {\n        PartitionKeyName = \"pk\";//used with partitioned cosmosDb to make sure that ToVerticesAsync uses partitionKey when executing\n    }\n    public IGraphSet\u003cIPerson\u003e Persons =\u003e GraphSet\u003cIPerson\u003e();\n\n    public IGraphSet\u003cICity\u003e Cities =\u003e GraphSet\u003cICity\u003e();\n\n    public IGraphSet\u003cICountry\u003e Countries =\u003e GraphSet\u003cICountry\u003e();\n\n    public IGraphSet\u003cICompany\u003e Companies =\u003e GraphSet\u003cICompany\u003e();\n\n    public IGraphSet\u003cIEmployment\u003e Employments =\u003e EdgeGraphSet\u003cIEmployment\u003e();\n\n    public MyEntityContext(IGremlinLanguageConnector connector, IServiceProvider resolver) : base(connector, resolver)\n    {\n    }\n\n    protected override bool InitializeModel(IGraphConfiguration configuration)\n    {\n        //Added some fluent configuration of the edges\n        configuration.ConfigureCollection\u003cIPerson\u003e()\n                .In(t =\u003e t.Parents, \"parent\").Out(t =\u003e t.Children)\n            .ConfigureCollection\u003cICity\u003e()\n            .ConfigureCollection\u003cICountry\u003e()\n                .AddEdge(t=\u003et.Cities).Reverse\u003cICountry\u003e(t=\u003et.Country)\n            .ConfigureCollection\u003cICompany\u003e()\n                .Out(t=\u003et.Employees, \"employer\").In(t=\u003et.Employers)\n                .ConfigureCollection\u003cIEmployment\u003e();;\n        return true;\n    }\n}\n\n```\n## Using the datacontext\n\n```CS\n\npublic class DemoController:Controller\n{\n    private MyEntityContext _dataContext;\n    public DemoController(MyEntityContext dataContext)\n    {\n        _dataContext=dataContext;\n    }\n\n    public Task\u003cIActionResult\u003e GetDataAsync(string personId)\n    {\n        var person=await _dataContext.Persons.GetAsync(persionId);\n        return new User\n        {\n            Id=person.Id,\n            FirstName=person.FistName,\n            LastName=person.LastName,\n            Email=person.Email\n        }\n    }\n\n    public Task\u003cIActionResult\u003e AddEmploymentAsync(string userId, string companyId,DateTime hiredDate, string managerName) //new in V2\n    {\n        var user=await await _dataContext.Persons.GetAsync(persionId);\n        var company=await _dataContext.Companies.GetAsync(companyId);\n        var e= _dataContext.Employments.Create(user,company);\n        e.HiredDate=hiredDate.ToEpoch();\n        e.ManagerName=managerName;\n        await _dataContext.SaveChangesAsync();\n        //alternative\n        \n    }\n\n    public Task\u003cIActionResult\u003e AddEmploymentAlternativeAsync(string userId, string companyId,DateTime hiredDate, string managerName) //edge property handling in V1\n    {\n        var user=await await _dataContext.Persons.GetAsync(persionId);\n        var company=await _dataContext.Companies.GetAsync(companyId);\n        user.Employers.Add(company,new Dictionary\u003cstring,object\u003e{\n            {\"hiredDate\",hiredDate.ToEpoch()},\n            {\"managerName\",\"managerName\"}\n        })\n        await _dataContext.SaveChangesAsync();\n        //alternative\n        \n    }\n}\n\n```\n## Dynamic graph entities\n\nIn many cases we cannot model our graph as strong typed entities. Paradox supports hybrid entities by adding IDynamicGraphEntity to your edge or vertex definition you can model the well known peroperties on your entities, but at the same time assign and manipulate arbitary properties. These properties enjoy the same treatment as the typed properties with regards to parameterization and change tracking.\n\n\n```CS\n[VertexLabel(\"person\")]\n    public interface IProfile : IVertex, IDynamicGraphEntity\n    {\n        string Id { get; }\n\n        string FirstName { get; set; }\n\n        string LastName { get; set; }\n\n        string Email { get; set; }\n\n        bool VerifiedEmail { get; set; }\n\n        string Name { get; set; }\n\n        string Ocupation { get; set; }\n\n        DateTime LastUpdated { get; set; }\n\n        //[EdgeLabel(\"parent\")]\n        IEdgeCollection\u003cIProfile\u003e Parents { get; }\n\n        //[ReverseEdgeLabel(\"parent\")]\n        IEdgeCollection\u003cIProfile\u003e Children { get; }\n\n        [ToWayEdgeLabel(\"spouce\")]\n        IEdgeReference\u003cIProfile\u003e Spouce { get; }\n\n        [Eager]\n        [EdgeLabel(\"employer\")]\n        ICollection\u003cICompany\u003e Employers { get; }\n\n\n        [GremlinQuery(\"g.V('{id}').as('s').in('parent').out('parent').where(without('s')).dedup()\")]\n        IEdgeCollection\u003cIProfile\u003e Siblings { get; }\n\n        [InlineSerialization(SerializationType.ClearText)]\n        ICollection\u003cstring\u003e ProgramingLanguages { get; }\n\n        IEdgeCollection\u003cIProfile\u003e AllSiblings { get; set; }\n\n        bool Adult { get; set; }\n        \n        string Description { get; set; }\n        \n        int Number { get; set; }\n\t    \n        string Pk { get; set; }\n\t    \n        EpochDateTime LastUpdatedEpoch { get; set; }\n    }\n```\n\n### usage\n\n```CS\n var profile = await tc.VAsync\u003cIProfile\u003e(\"myId\");\n profile.SetProperty(\"someRandomProp\",$\"test+:{DateTime.UtcNow.Ticks}\");\n Console.WriteLine(profile.GetProperty(\"someRandomProp\"));\n Console.WriteLine(string.Join(\",\",profile.DynamicPropertyNames))\n```\n\n## Complex properties\n\nVersion 2.3.3 introduces the cocept of complex properties. Gremlin in it self does not support this. Complex properties are serialized to json and needs to be implemented using the IComplexProperty abstract class. For the framework to pick up on changes to the object all properties needs to raise a notification about the change (resharper will help with the implementation of these)\n\n```CS\npublic class MyProp:IComplexProperty\n    {\n        private DateTime _timeStamp;\n\n        public DateTime TimeStamp\n        {\n            get =\u003e _timeStamp;\n            set\n            {\n                if (value.Equals(_timeStamp)) return;\n                _timeStamp = value;\n                OnPropertyChanged();\n            }\n        }\n    }\n```\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FJonasSyrstad%2FStardust.Paradox.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FJonasSyrstad%2FStardust.Paradox?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonassyrstad%2Fstardust.paradox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonassyrstad%2Fstardust.paradox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonassyrstad%2Fstardust.paradox/lists"}