{"id":13508852,"url":"https://github.com/Revmaker/gremlex","last_synced_at":"2025-03-30T11:32:53.957Z","repository":{"id":55448926,"uuid":"123871824","full_name":"Revmaker/gremlex","owner":"Revmaker","description":"Elixir Client for Gremlin (Apache TinkerPop™)","archived":false,"fork":false,"pushed_at":"2020-12-30T06:23:08.000Z","size":217,"stargazers_count":69,"open_issues_count":9,"forks_count":22,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-07-07T15:11:21.414Z","etag":null,"topics":["elixir","elixir-lang","gremlex","gremlin","tinkerpop"],"latest_commit_sha":null,"homepage":"https://gremlex.carlabs.ai/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Revmaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-05T05:57:33.000Z","updated_at":"2024-01-20T14:22:01.000Z","dependencies_parsed_at":"2022-08-15T00:31:00.619Z","dependency_job_id":null,"html_url":"https://github.com/Revmaker/gremlex","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Revmaker%2Fgremlex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Revmaker%2Fgremlex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Revmaker%2Fgremlex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Revmaker%2Fgremlex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Revmaker","download_url":"https://codeload.github.com/Revmaker/gremlex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213450182,"owners_count":15589015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["elixir","elixir-lang","gremlex","gremlin","tinkerpop"],"created_at":"2024-08-01T02:00:59.390Z","updated_at":"2024-08-01T02:02:40.414Z","avatar_url":"https://github.com/Revmaker.png","language":"Elixir","funding_links":[],"categories":["ORM and Datamapping"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"logo.png\"\u003e\u003c/img\u003e\u003c/p\u003e\n\n[![Build Status](https://travis-ci.com/Revmaker/gremlex.svg?branch=master)](https://travis-ci.com/Revmaker/gremlex)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# Gremlex\n\nAn Elixir client for Apache TinkerPop™ aka [Gremlin](http://tinkerpop.apache.org/gremlin.html).\n\nGremlex does not support all functions (yet). It is pretty early on in it's development. But you can always use raw Gremlin queries by using `Client.query(\"\u003cInsert gremlin query\u003e\")`\n\n## Installation\n\nInstall from Hex.pm:\n\n```elixir\ndef deps do\n  [\n    {:gremlex, \"~\u003e 0.1.1\"}\n  ]\nend\n```\n\n## Examples\n\n#### Basic Usage\nThe two main modules that you'll want to use are `Gremlex.Graph` and `Gremlex.Client`.\n\n`Gremlex.Graph` is the module that hosts all the functions needed to build a Gremlin query.\nThe DSL is a simple set of functions that carries over a graph for every step. Once you've\ndefined your query, you can simply call `Gremlex.Client.query/1` to perform it.\n\n```elixir\niex(1)\u003e alias Gremlex.Graph\nGremlex.Graph\niex(2)\u003e alias Gremlex.Client\nGremlex.Client\niex(3)\u003e Graph.g() |\u003e Graph.v() |\u003e Client.query\n{:ok,\n [\n   %Gremlex.Vertex{\n     id: 1,\n     label: \"person\",\n     properties: %{age: [29], name: [\"marko\"]}\n   }\n ]}\n```\n\n#### Gremlin Query to Gremlex\nThis gremlin query:\n```\ng.V().has(\"name\",\"marko\")\n  .out(\"knows\")\n  .out(\"knows\")\n  .values(\"name\")\n```\nWould translate in Gremlex to:\n```elixir\nGraph.g()\n|\u003e Graph.v()\n|\u003e Graph.has(\"name\", \"marko\")\n|\u003e Graph.out(\"knows\")\n|\u003e Graph.out(\"knows\")\n|\u003e Graph.values(\"name\")\n|\u003e Client.query\n```\n\n#### Raw Queries\n```elixir\nClient.query(\"\"\"\n  g.V().match(\n    __.as(\"a\").out(\"knows\").as(\"b\"),\n    __.as(\"a\").out(\"created\").as(\"c\"),\n    __.as(\"b\").out(\"created\").as(\"c\"),\n    __.as(\"c\").in(\"created\").count().is(2)\n  )\n  .select(\"c\").by(\"name\")\n\"\"\")\n```\n\n## Configuration\nYou can configure Gremlex by adding the following to your `config.exs`:\n\n```elixir\nconfig :gremlex,\n  host: \"127.0.0.1\",\n  port: 8182,\n  path: \"/gremlin\",\n  pool_size: 10,\n  secure: false\n  ping_delay: 60_000\n```\n\nGremlex uses [confex](https://github.com/Nebo15/confex), so that you can easily define\nyour configuration to use environment variables when it comes time to deploying. To do so,\nsimply have the parameters that need to be dynamically read at run time set to `{:SYSTEM, \"ENV_VAR_NAME\"}`.\n\n### Parameters\n* `host`: Gremlin host to connect to (defaults to \"127.0.0.1\")\n* `port`: Port Gremlin is listening to on host (defaults to 8182)\n* `path`: Websocket path to Gremlin (defaults to \"/gremlin\")\n* `pool_size`: The number of connections to keep open in the pool (defaults to 10)\n* `secure`: Set to `true` to connect to a server with SSL enabled\n* `ping_delay`: Delay in milliseconds to send a pong frame to the server. If 0, then a pong frame won't be scheduled. (defaults to 0)\n\n## Contributing\n\n    $ git clone https://github.com/Revmaker/gremlex.git\n    $ cd gremlex\n    $ mix deps.get\n    $ mix test\n\nOnce you've made your additions and `mix test` passes, go ahead and open a PR!\nNote: Please make sure you run `mix format` on the touched files :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRevmaker%2Fgremlex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRevmaker%2Fgremlex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRevmaker%2Fgremlex/lists"}