package gremlin
Not available on OCaml 5.5Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=d6d34be20f43e9ff4c6b18159e99ea2c
sha512=42b39f19eb57d1f30b8e078457078e0d2dda35e538cc7fc28bc65d4cac6ebe8ad08f81fcd5f5e7e151c3cbfcd4ab9f9b09cba1608682fdda08eab0b5761b0bbe
Description
This is an Apache Tinkerpop3 Gremlin client library.
See the official tinkerpop3 and gremlin docs:
- http://tinkerpop.apache.org/docs/current/
This client library is implemented following the driver provider requirements:
- http://tinkerpop.apache.org/docs/current/dev/provider/#_graph_driver_provider_requirements
Added to opam-repository:
README
OCaml Gremlin Client
Overview
This is a very rough Apache Tinkerpop3 Gremlin client library written in OCaml. It was implemented using the Graph Driver Provider Requirements.
Given this is my first public OCaml library and I was fairly rushed, it's not pretty.
I'd like to improve it which probably means completely refactoring it but I'm not sure when I'll get the chance. In the meantime, any suggestions or PRs are welcome.
Instructions
Build/Install
git clone https://github.com/bramford/ocaml-gremlin
cd ocaml-gremlin
opam pin add .Usage
Assuming you're running a gremlin server on localhost:8182, in a toplevel such as utop:
#require "gremlin";;
let conn =
Gremlin.Websocket.new_connection
(Uri.of_string "http://localhost:8182/gremlin")
(* Add vertices *)
let add_vertices = Lwt_main.run (
Gremlin.Websocket.run_queries_transaction
conn
["g.addV('user').property('name', 'foo')";
"g.addV('user').property('name', 'bar')";]
)
(* Get vertices *)
let get_vertices =
Lwt_main.run (
Gremlin.Websocket.run_query
conn
"g.V()"
)
;;See examples/ for other examples.
To do
There's obviously a lot to improve but here are some starting points:
- Properly close gremlin session on completion
- Handle streamed responses
- Add interface documentation (e.g. odoc)
- Implement proper logging (e.g. using
Logs) - Improve types and results
- Abstract internals and types properly
- Refactor/improve response handler (currently uses
Lwt_streambut poorly) - Refactor response JSON checking/parsing
- Improve concurrency (currently all serial using
Lwt_list.map_s) - Support other serialization formats (e.g. bytecode)
- Support Traversal OpProcessor
- Support REST interface
- MirageOS compatibility
Dependencies (11)
-
websocket-lwt-unix
>= "2.13" -
websocket
>= "2.13" -
yojson
>= "1.7.0" -
ppx_let
>= "v0.12.0" -
lwt_ppx
>= "1.2.2" -
lwt
>= "4.2.1" -
dune
>= "1.10.0" -
core
>= "v0.12.3" & < "v0.15" -
containers
>= "2.6" -
conduit-lwt-unix
>= "1.4.0" & < "5.0.0" -
ocaml
>= "4.07.1"
Dev Dependencies
None
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building gremlin with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.1.1 (this version) | good | good | n/a | n/a | n/a |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure