Skip to content

Commit d21dc87

Browse files
Merge pull request #6 from matt-beanland/neo4j
Neo4j
2 parents f2885d5 + 00f3d11 commit d21dc87

79 files changed

Lines changed: 8966 additions & 5842 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.formatter.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
[
33
plugins: [Spark.Formatter],
44
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"],
5-
import_deps: [:ash_postgres, :ash]
5+
import_deps: [:ash]
66
]

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ diffo-*.tar
2121

2222
# Temporary files, for example, from tests.
2323
/tmp/
24+
25+
/.elixir_ls
26+
27+
.DS_Store

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Matthew Graham Beanland
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
# Diffo
22

3-
# Diffo - TMF Service and Resource Management with a difference
4-
# Copyright Matt Beanland beanland@live.com.au
3+
Diffo is a Telecommunications Management Forum (TMF) Service and Resource Manager, built for autonomous networks.
4+
5+
It is implemented using the [Ash Framework](https://www.ash-hq.org) leveraging core and community extensions including some created and maintained by [diffo-dev](https://github.com/diffo-dev/). As such it is highly customizable using Spark DSL and as necessary Elixir.
6+
7+
Diffo models relationships between all domain entities (Ash resources) and persists these in [Neo4j](https://github.com/neo4j/neo4j), an open source graph based database.
8+
9+
Diffo comes with all Ash resources to implement:
10+
* TMF638 Service Inventory Management
11+
* TMF639 Resource Inventory Management
12+
13+
Diffo can simply be used as an inventory system paired with conventional orchestration, and while this is a good starting point, we recommend dynamic orchestration, where orchestration (or rather choreography) is done in order to ensure goals are met autonomously.
14+
15+
Diffo can be used to implement 'a difference engine' which allows closed loop autonomy by acting on outstanding goals. Intents can be expressed as persistent expectations, and these are compared with actual instances to compute an outstanding instance, which simply contains unmet expectations in the original structure. This can then be used to derive the next task, which typically impacts actual but may also refine our expectations. In this way the workflow is synthesized from small tasks.
16+
17+
Expected and actual instances are compared using the [Elixir Outstanding Protocol](https://github.com/diffo-dev/outstanding), via the [Ash Outstanding Extension](https://github.com/diffo-dev/ash_outstanding)
18+
19+
Diffo can be used for any combination of service-service, service-resource and resource-resource, where expectations can be held for internal or external actual services and/or resources.
20+
21+
Diffo is especially suited for use in organisations with loosely coupled 'entity based' enterprise architecture where network entities can run diffo inside their entity without requiring or expecting other entities to do so.
522

623
## Installation
724

@@ -16,7 +33,40 @@ def deps do
1633
end
1734
```
1835

19-
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
20-
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
21-
be found at <https://hexdocs.pm/diffo>.
36+
You should need [Neo4j](https://github.com/neo4j/neo4j) available. We recommend the Neo4j Community 5 latest, available at [Neo4j Deploymnent Centre](https://neo4j.com/deployment-center/) which can be installed locally. You can also configure connection to a cloud based database service such as [Neo4j AuraDB](https://neo4j.com/product/auradb/).
37+
38+
## Tutorial
39+
40+
To get started you need a running instance of [Livebook](https://livebook.dev/)
41+
42+
[![Run in Livebook](https://livebook.dev/badge/v1/blue.svg)](https://livebook.dev/run?url=https%3A%2F%2Fgithub.com%2Fdiffo%2Ddev%2Fdiffo%2Fblob%2Fdev%2Fdiffo.livemd)
43+
44+
45+
## Future Work
46+
47+
We plan to support:
48+
* an intent based interface for managing both consumer and provider expectations
49+
* expose MCP so that services and resources can be defined by your agent
50+
* incorporate an an agent based framework so that your TMF service and resource instances are backed by co-operating intelligent agents
51+
* embedded diffo, enabling intelligent network elements that natively communicate with TMF protocols
52+
53+
## Contributions
54+
55+
Contributions are welcome, please start with either a [discussion](https://github.com/diffo-dev/diffo/issues) or [issue](https://github.com/diffo-dev/diffo/issues)
56+
57+
## Acknowledgements
58+
59+
Thanks to [Telstra](https://www.telstra.com.au/) for supporting innovation in orchestration and inventory shared-tech which resulted in the award winning difference engine [2024 TMF Excellence Award in Autonomous Networks](https://www.tmforum.org/about/awards-and-recognition/excellence-awards/winners-2024/) powering three network service entities enabling outstanding produce experience [2025 TMF Excellence Award in Customer Experience](https://www.tmforum.org/about/awards-and-recognition/excellence-awards/winners-2025/) and inspiring both this open source and internal shared-tech.
60+
61+
Thanks to the [Ash Core](https://github.com/ash-project) for [ash](https://github.com/ash-project/ash) 🚀
62+
63+
Thanks to [Sagastume](https://github.com/sagastume) for [boltx](https://github.com/tiagodavi/ex4j) which is used by the [Ash Neo4j DataLayer](https://github.com/diffo-dev/ash_neo4j)
64+
65+
Thanks to the [Neo4j Core](https://github.com/neo4j) for [neo4j](https://github.com/neo4j/neo4j) and pioneering work on graph databases.
66+
67+
## Links
68+
69+
[Diffo.dev](https://www.diffo.dev)
70+
[Neo4j Deployment Centre](https://neo4j.com/deployment-center/)
71+
[TMF](https://www.tmforum.org)
2272

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

config/config.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import Config
2-
config :spark, formatter: ["Ash.Resource": [section_order: [:postgres]]]
3-
config :diffo, ecto_repos: [Diffo.Repo], ash_domains: [Diffo.Provider]
2+
config :spark, formatter: ["Ash.Resource": [section_order: [:neo4j, :jason, :outstanding]]]
3+
config :diffo, ash_domains: [Diffo.Provider]
44
import_config "#{config_env()}.exs"

config/dev.exs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
import Config
22

3-
config :diffo, Diffo.Repo,
4-
username: "postgres",
5-
password: "postgres",
6-
hostname: "localhost",
7-
database: "diffo_dev",
8-
show_sensitive_data_on_connection_error: true,
9-
pool_size: 10
3+
config :boltx, Bolt,
4+
uri: "bolt://localhost:7687",
5+
auth: [username: "neo4j", password: "password"],
6+
user_agent: "DiffoDev/1",
7+
pool_size: 15,
8+
max_overflow: 3,
9+
prefix: :default,
10+
name: Bolt,
11+
log: true,
12+
log_hex: true
13+
14+
level =
15+
if System.get_env("DEBUG") do
16+
:debug
17+
else
18+
:info
19+
end
20+
21+
config :logger, :console,
22+
level: level,
23+
format: "$date $time [$level] $metadata$message\n"

config/test.exs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,24 @@ config :logger, level: :warning
44
config :ash, disable_async?: true
55
config :ash, :missed_notifications, :ignore
66

7-
config :diffo, Diffo.Repo,
8-
username: "postgres",
9-
password: "postgres",
10-
hostname: "localhost",
11-
database: "diffo_test#{System.get_env("MIX_TEST_PARTITION")}",
12-
pool: Ecto.Adapters.SQL.Sandbox,
13-
pool_size: 10
7+
config :boltx, Bolt,
8+
uri: "bolt://localhost:7687",
9+
auth: [username: "neo4j", password: "password"],
10+
user_agent: "DiffoTest/1",
11+
pool_size: 15,
12+
max_overflow: 3,
13+
prefix: :default,
14+
name: Bolt,
15+
log: true,
16+
log_hex: true
17+
18+
level =
19+
if System.get_env("DEBUG") do
20+
:debug
21+
else
22+
:info
23+
end
24+
25+
config :logger, :console,
26+
level: level,
27+
format: "$date $time [$level] $metadata$message\n"

0 commit comments

Comments
 (0)