Skip to Main Content
Exploring Graphs with Elixir
book

Exploring Graphs with Elixir

by Tony Hammond
November 2022
Intermediate to advanced content levelIntermediate to advanced
294 pages
5h 58m
English
Pragmatic Bookshelf
Content preview from Exploring Graphs with Elixir

Setting Up a Graph Service

We can do graph management of our Neo4j instance using Cypher queries over Bolt.Sips to add and delete graphs. But we’d ideally like to bring this under our common graph services API so we can operate at a higher level of abstraction, which will make for less context switching when swapping between graph services.

Let’s set up a graph service for our PropertyGraph project now:

 defmodule​ PropertyGraph.Service ​do
  @behaviour GraphCommons.Service
 
 # ...
 
 end

Note that this module is going to implement the GraphCommons.Service behaviour so we use the module attribute @behaviour.

Graph API

We’ll first need to set up our Cypher queries for deleting all nodes and relationships and for reading them:

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Concurrent Data Processing in Elixir

Concurrent Data Processing in Elixir

Svilen Gospodinov

Publisher Resources

ISBN: 9798888650059Errata Page