• Stars
    star
    81
  • Rank 400,299 (Top 8 %)
  • Language
    Elixir
  • License
    MIT License
  • Created about 9 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Elixir driver for the Neo4j graph database server

Neo4j.Sips

A simple Elixir driver using the Neo4j graph database REST API. Compatible with the following Neo4j servers: 2.x/3.0.x/3.1.x

Build Status Deps Status Hex.pm Hexdocs.pm

Documentation: hexdocs.pm/neo4j_sips/

You can also look at: Bolt.Sips - Elixir driver using the Bolt protocol; Neo4j's newest network protocol, designed for high-performance.

Install

Available in Hex. Edit the mix.ex file and add the neo4j_sips dependency to the deps/1 function:

def deps do
  [{:neo4j_sips, "~> 0.2"}]
end

or from Github:

def deps do
  [{:neo4j_sips, github: "florinpatrascu/neo4j_sips"}]
end

If you're using a local development copy:

def deps do
  [{:neo4j_sips, path: "../neo4j_sips"}]
end

Then add the neo4j_sips dependency the applications list:

def application do
  [applications: [:logger, :neo4j_sips],
   mod: {Neo4j.Sips.Application, []}]
end

Edit the config/config.exs and describe a Neo4j server endpoint, example:

config :neo4j_sips, Neo4j,
  url: "http://localhost:7474",
  pool_size: 5,
  max_overflow: 2,
  timeout: 15_000  # milliseconds!

Run mix do deps.get, deps.compile

If your server requires basic authentication, add this to your config file:

  basic_auth: [username: "foo", password: "bar"]

Or:

  token_auth: "bmVvNGo6dGVzdA==" # if using an authentication token?!

You can also specify the authentication in the url config:

  url: "http://neo4j:neo4j@localhost:7474"

Example

With a minimalist setup configured as above, and a Neo4j server running, we can connect to the server and run some queries using Elixir’s interactive shell (IEx):

$ cd <my_mix_project>
$ iex -S mix
Erlang/OTP 19 [erts-8.0.2] [source] [64-bit] ...

Interactive Elixir (1.3.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> alias Neo4j.Sips, as: Neo4j

iex(2)> Neo4j.start_link(url: "http://localhost:7474")
{:ok, #PID<0.204.0>}

iex(3)> cypher = """
  CREATE (n:Neo4jSips {title:'Elixir sipping from Neo4j', released:2015, 
    license:'MIT', neo4j_sips_test: true})
"""

iex(4)> Neo4j.query(Neo4j.conn, cypher)
{:ok, []}

iex(5)> n = Neo4j.query!(Neo4j.conn, "match (n:Neo4jSips {title:'Elixir sipping from Neo4j'}) where n.neo4j_sips_test return n")
[%{"n" => %{"license" => "MIT", "neo4j_sips_test" => true, "released" => 2015,
     "title" => "Elixir sipping from Neo4j"}}]

For more examples, see the test suites.

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Test (mix test)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

Contributors

As reported by Github: contributions to master, excluding merge commits

Author

Florin T.PATRASCU (@florinpatrascu, @florin on Twitter)

License

  • Neo4j.Sips - MIT, check LICENSE file for more information.
  • Neo4j - Dual free software/commercial license, see http://neo4j.org/

More Repositories

1

bolt_sips

Neo4j driver for Elixir
Elixir
258
star
2

micro

a modular micro MVC framework for Java web applications
Java
86
star
3

movies_elixir_phoenix

Neo4j with Elixir, Phoenix and Neo4j.Sips - The Movies Example Application
Elixir
37
star
4

closure_table

Closure Table for Elixir - a simple solution for storing and manipulating complex hierarchies.
Elixir
30
star
5

bolt_movies_elixir_phoenix

A very simple web application using Neo4j with Elixir, Phoenix, and: Bolt.Sips; an Elixir driver for Neo4j’s Bolt newest network protocol.
Elixir
21
star
6

vscode-elixir-snippets

Elixir code snippets for VS Code
19
star
7

elixir_grafana_loki_tempo

A very simple Elixir demo/project used for experimenting with Grafana Tempo and Loki #opentelemetry #observability #tracing
Elixir
13
star
8

libcluster_gig

A libcluster strategy for Google Managed Instance Groups
Elixir
10
star
9

jrack

a port of Rack to Java
Java
8
star
10

jpublish

JPublish provides a powerful system for managing your web site's content as well as your web site's application logic.
Java
7
star
11

neo4j_sips_models

Neo4j models, for Neo4j.Sips
Elixir
6
star
12

micro-examples

Examples of web applications or deployment solutions using the Micro MVC framework
Java
5
star
13

fixex

support for integrating ExUnit with external apps/cli, as external fixtures providers, or for mimicking external services
Elixir
4
star
14

Sinatra-HART

A Sinatra Haml, Activerecord, RSPEC and Twitter bootstrap boilerplate, with SimpleCov flavour :)
JavaScript
3
star
15

pomo-chrono

A simple yet versatile stateful jQuery Pomodori countdown timer plugin
JavaScript
2
star
16

silw

a simple ruby gem utility that allows one user to monitor several remote systems, provided he has the proper credentials and the authorization to execute remote commands
Ruby
2
star
17

bpl

A very simple gem to help you track your blood pressure
Ruby
1
star
18

mongo_fe

A simple Sinatra based web front-end that can be used for experimenting and learning MongoDB. It is also a Ruby gem :)
JavaScript
1
star
19

dnsimple_touch

a very simple DNSimple - jQTouch prototype
JavaScript
1
star
20

micro-docs

This is the Documentation web site for the Micro framework; using Micro for publishing.
CSS
1
star
21

google_playground

A repository containing small scripts that I use to manage some GCP infrastructure chores, notes, etc. Mostly Elixir of course =)
Elixir
1
star