Skip to content

Neo4j graph access in Cratis Arc

Cratis Arc’s Neo4j integration gives commands and queries a session on the graph database of the current tenant. Add Cratis.Arc.Neo4j to inject an IGraphSession into model-bound queries, a command’s Provide() method and ordinary services, with the same convenience the MongoDB integration gives documents. You can use it without Chronicle or event sourcing.

A graph is what events leave behind: Chronicle’s Neo4j graph sink writes nodes and relationships from graph projections, and nobody writes to it directly. Arc reads it. That is why the session is a read session by default.

Follow getting started to install the package, connect your host to a server and run the first query.

  • Tenancy: the database naming Arc and Chronicle share, and the single-database mode for development.
  • Connection resolution: choose a server, database or credentials for each tenant.
  • Querying: run Cypher through the session and map the rows to your types.
  • Concepts: bind ConceptAs<T> values as parameters and get them back in results.
  • Testing: substitute the session in specifications and command scenarios.

If your documents live in MongoDB instead, see the MongoDB integration. Both follow the same tenancy model.