Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mneudert/caylir
Cayley driver for Elixir
https://github.com/mneudert/caylir
Last synced: 26 days ago
JSON representation
Cayley driver for Elixir
- Host: GitHub
- URL: https://github.com/mneudert/caylir
- Owner: mneudert
- License: apache-2.0
- Created: 2014-10-05T12:51:46.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T12:18:03.000Z (about 2 months ago)
- Last Synced: 2024-11-09T19:50:17.472Z (about 1 month ago)
- Language: Elixir
- Homepage:
- Size: 523 KB
- Stars: 21
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Cayley driver for Elixir. (ORM and Datamapping)
- fucking-awesome-elixir - caylir - Cayley driver for Elixir. (ORM and Datamapping)
- awesome-elixir - caylir - Cayley driver for Elixir. (ORM and Datamapping)
README
# Caylir
Cayley driver for Elixir
## Cayley Support
Tested Cayley versions:
- `0.7.3`
- `0.7.4`
- `0.7.5`
- `0.7.6`## Package Setup
To use Caylir with your projects, edit your `mix.exs` file and add the required dependencies:
```elixir
defp deps do
[
# ...
{:caylir, "~> 1.0"},
# ...
]
end
```## Application Setup
### Graph Definition
Defining a graph connection requires defining a module:
```elixir
defmodule MyGraph do
use Caylir.Graph, otp_app: :my_app
end
```This defined graph module needs to be hooked up into your supervision tree:
```elixir
children = [
# ...
MyGraph,
# ...
]
```For a more detailed explanation of how to get started with a graph please consult the inline documentation of the `Caylir.Graph` module.
To configure your connection you can use the application environment:
```elixir
config :my_app, MyGraph,
host: "cayley.host",
port: 42160,
scheme: "https"
```The entry should match the chosen `:otp_app` and module name defined earlier.
For more information on how (and what) to configure please refer to the inline documentation of the `Caylir.Graph.Config` module.
## Usage
Querying data:
```elixir
MyGraph.query("graph.Vertex('graph').Out('connection').All()")
```Writing Data:
```elixir
MyGraph.write(%{
subject: "graph",
predicate: "connection",
object: "target"
})
```Deleting Data:
```elixir
MyGraph.delete(%{
subject: "graph",
predicate: "connection",
object: "target"
})
```A more detailed usage documentation can be found inline at the `Caylir.Graph` module.
## License
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)