{"id":18931966,"url":"https://github.com/crflynn/redisgraph-ex","last_synced_at":"2026-03-14T22:38:43.576Z","repository":{"id":57542410,"uuid":"206482438","full_name":"crflynn/redisgraph-ex","owner":"crflynn","description":"RedisGraph client implementation in Elixir","archived":false,"fork":false,"pushed_at":"2023-06-12T07:58:08.000Z","size":30,"stargazers_count":21,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T05:44:15.010Z","etag":null,"topics":["elixir","graph-database","redis","redisgraph"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/redisgraph","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/crflynn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"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}},"created_at":"2019-09-05T05:33:31.000Z","updated_at":"2025-01-04T07:55:10.000Z","dependencies_parsed_at":"2024-11-08T11:48:19.580Z","dependency_job_id":"cfae8d77-c562-431f-9498-457395eee55a","html_url":"https://github.com/crflynn/redisgraph-ex","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":"0.30000000000000004","last_synced_commit":"df37ccc01a52d4d996816faa5f0916933d7846f3"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fredisgraph-ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fredisgraph-ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fredisgraph-ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crflynn%2Fredisgraph-ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crflynn","download_url":"https://codeload.github.com/crflynn/redisgraph-ex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809039,"owners_count":21164896,"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","graph-database","redis","redisgraph"],"created_at":"2024-11-08T11:47:30.698Z","updated_at":"2026-03-14T22:38:38.532Z","avatar_url":"https://github.com/crflynn.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RedisGraph\n\n[![Hex.pm](https://img.shields.io/hexpm/v/redisgraph)](https://hex.pm/packages/redisgraph)\n[![githubactions](https://github.com/crflynn/redisgraph-ex/workflows/elixir/badge.svg)](https://github.com/crflynn/redisgraph-ex/actions)\n\nA [RedisGraph](https://oss.redislabs.com/redisgraph/) client implementation library in Elixir.\n\n## Installation\n\nThe `redisgraph` package can be installed\nby adding `redisgraph` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:redisgraph, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nDocumentation can be found at [https://hexdocs.pm/redisgraph](https://hexdocs.pm/redisgraph).\n\n## Example usage\n\nThis library uses [Redix](https://github.com/whatyouhide/redix) to communicate with a redisgraph server.\n\nTo launch ``redisgraph`` locally, use\n\n```bash\ndocker run -p 6379:6379 -it --rm redislabs/redisgraph\n```\n\nHere is a simple example:\n\n```elixir\nalias RedisGraph.{Node, Edge, Graph, QueryResult}\n\n# Create a connection using Redix\n{:ok, conn} = Redix.start_link(\"redis://localhost:6379\")\n\n# Create a graph\ngraph = Graph.new(%{\n  name: \"social\"\n})\n\n# Create a node\njohn = Node.new(%{\n  label: \"person\",\n  properties: %{\n    name: \"John Doe\",\n    age: 33,\n    gender: \"male\",\n    status: \"single\"\n  }\n})\n\n# Add the node to the graph\n# The graph and node are returned\n# The node may be modified if no alias has been set\n# For this reason, nodes should always be added to the graph\n# before creating edges between them.\n{graph, john} = Graph.add_node(graph, john)\n\n# Create a second node\njapan = Node.new(%{\n  label: \"country\",\n  properties: %{\n    name: \"Japan\"\n  }\n})\n\n# Add the second node\n{graph, japan} = Graph.add_node(graph, japan)\n\n# Create an edge connecting the two nodes\nedge = Edge.new(%{\n  src_node: john,\n  dest_node: japan,\n  relation: \"visited\"\n})\n\n# Add the edge to the graph\n# If the nodes are not present, an {:error, error} is returned\n{:ok, graph} = Graph.add_edge(graph, edge)\n\n# Commit the graph to the database\n{:ok, commit_result} = RedisGraph.commit(conn, graph)\n\n# Print the transaction statistics\nIO.inspect(commit_result.statistics)\n\n# Create a query to fetch some data\nquery = \"MATCH (p:person)-[v:visited]-\u003e(c:country) RETURN p.name, p.age, v.purpose, c.name\"\n\n# Execute the query\n{:ok, query_result} = RedisGraph.query(conn, graph.name, query)\n\n# Pretty print the results using the Scribe lib\nIO.puts(QueryResult.pretty_print(query_result))\n```\n\nwhich gives the following results:\n\n```elixir\n# Commit result statistics\n%{\n  \"Labels added\" =\u003e nil,\n  \"Nodes created\" =\u003e \"2\",\n  \"Nodes deleted\" =\u003e nil,\n  \"Properties set\" =\u003e \"5\",\n  \"Query internal execution time\" =\u003e \"0.228669\",\n  \"Relationships created\" =\u003e \"1\",\n  \"Relationships deleted\" =\u003e nil\n}\n\n# Query result pretty-printed\n+----------------+-------------+-----------------+--------------+\n| \"p.name\"       | \"p.age\"     | \"v.purpose\"     | \"c.name\"     |\n+----------------+-------------+-----------------+--------------+\n| \"John Doe\"     | 33          | nil             | \"Japan\"      |\n+----------------+-------------+-----------------+--------------+\n```\n\n## License\n\nRedisGraph is licensed under [MIT](https://github.com/crflynn/redisgraph-ex/blob/master/LICENSE.txt).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrflynn%2Fredisgraph-ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrflynn%2Fredisgraph-ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrflynn%2Fredisgraph-ex/lists"}