Skip to content

Commit

Permalink
Merge dev into main
Browse files Browse the repository at this point in the history
  • Loading branch information
DinisCruz committed Feb 2, 2025
2 parents 1e41764 + f572e07 commit 46e59ee
Show file tree
Hide file tree
Showing 334 changed files with 3,275 additions and 1,155 deletions.
2 changes: 1 addition & 1 deletion .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ runs:
- name: Run Unit Tests (Unit)
shell: bash
run: |
coverage run --source=mgraph_ai -m pytest -v -s --durations=0 tests/unit
coverage run --source=mgraph_db -m pytest -v -s --durations=0 tests/unit
4 changes: 2 additions & 2 deletions .github/workflows/ci-pipeline__dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
GIT__BRANCH : 'dev'
RELEASE_TYPE : 'minor'
PACKAGE_NAME : 'mgraph_ai'
PACKAGE_NAME : 'mgraph_db'

jobs:

Expand All @@ -33,7 +33,7 @@ jobs:
- run-tests

publish-to-pypi:
if: False
#if: False
name: "Publish to: PYPI"
permissions:
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pipeline__main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
GIT__BRANCH : 'main'
RELEASE_TYPE : 'major'
PACKAGE_NAME : 'mgraph_ai'
PACKAGE_NAME : 'mgraph_db'

jobs:

Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# MGraph-AI - A Memory-based GraphDB for GenAI, Semantic Web and Serverless
# MGraph-DB - A Memory-based GraphDB for GenAI, Semantic Web and Serverless

![Current Release](https://img.shields.io/badge/release-v0.11.0-blue)
![Current Release](https://img.shields.io/badge/release-v0.11.5-blue)

MGraph-AI is a lightweight, memory-first graph database implementation in Python, designed specifically for AI, semantic web,
MGraph-DB is a lightweight, memory-first graph database implementation in Python, designed specifically for AI, semantic web,
and serverless applications. What sets it apart is its focus on in-memory performance while maintaining persistence through
serialized JSON data structures. This makes it particularly well-suited for:

Expand All @@ -12,7 +12,7 @@ serialized JSON data structures. This makes it particularly well-suited for:
- Applications requiring both graph capabilities and JSON compatibility

The library provides a robust, type-safe implementation with a clean, layered architecture that prioritizes maintainability
and scalability. By keeping the graph in memory and serializing to JSON, MGraph-AI achieves excellent performance from small to read-heavy
and scalability. By keeping the graph in memory and serializing to JSON, MGraph-DB achieves excellent performance from small to read-heavy
workloads while maintaining data persistence.

## Features
Expand All @@ -31,13 +31,13 @@ workloads while maintaining data persistence.
## Installation

```bash
pip install mgraph-ai
pip install mgraph-db
```

## Quick Start

```python
from mgraph_ai.mgraph import MGraph
from mgraph_db.mgraph import MGraph
from osbot_utils.helpers.Safe_Id import Safe_Id

# Create a new graph
Expand Down Expand Up @@ -74,7 +74,7 @@ with mgraph.data() as data:

## Architecture

MGraph-AI implements a layered architecture:
MGraph-DB implements a layered architecture:

```
Actions Layer (Data, Edit, Filter, Storage)
Expand All @@ -95,7 +95,7 @@ Operations are organized into focused interfaces:

### Type Safety

MGraph-AI enforces type safety at all layers:
MGraph-DB enforces type safety at all layers:

```python
# Type-safe node creation
Expand All @@ -113,7 +113,7 @@ node.add_attribute(name=Safe_Id("count"),
### Custom Node Types

```python
from mgraph_ai.mgraph.schemas.Schema__MGraph__Node import Schema__MGraph__Node
from mgraph_db.mgraph.schemas.Schema__MGraph__Node import Schema__MGraph__Node

class Custom_Node(Schema__MGraph__Node):
def custom_method(self):
Expand Down Expand Up @@ -166,8 +166,8 @@ attributes = node.attributes()

```bash
# Clone the repository
git clone https://github.com/owasp-sbot/MGraph-AI.git
cd MGraph-AI
git clone https://github.com/owasp-sbot/MGraph-DB.git
cd MGraph-DB

# Install dependencies with Poetry
poetry install
Expand Down
2 changes: 1 addition & 1 deletion _experiments/Trace_Call__Graph.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mgraph_ai.providers.mermaid.domain.Mermaid__Graph import Mermaid__Graph
from mgraph_db.providers.mermaid.domain.Mermaid__Graph import Mermaid__Graph
from osbot_utils.helpers.trace.Trace_Call import Trace_Call

# todo: reimplement this class when Mermaid__Graph has been updated to new version
Expand Down
2 changes: 1 addition & 1 deletion _experiments/core/MGraph__Data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mgraph_ai.mgraph.domain.MGraph import MGraph
from mgraph_db.mgraph.domain.MGraph import MGraph
from osbot_utils.type_safe.Type_Safe import Type_Safe
from osbot_utils.helpers.Print_Table import Print_Table

Expand Down
4 changes: 2 additions & 2 deletions _experiments/core/MGraph__Serializer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from enum import Enum, auto
from mgraph_ai.core.MGraph__Data import MGraph__Data
from mgraph_ai.mgraph.domain.Domain__MGraph import MGraph
from mgraph_db.core.MGraph__Data import MGraph__Data
from mgraph_db.mgraph.domain.Domain__MGraph import MGraph
from osbot_utils.type_safe.Type_Safe import Type_Safe
from osbot_utils.utils.Str import safe_str
from osbot_utils.helpers.Local_Cache import Local_Cache
Expand Down
8 changes: 4 additions & 4 deletions _experiments/core/test_MGraph__Serializer.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import pytest
from unittest import TestCase
from mgraph_ai.core.MGraph__Data import MGraph__Data
from mgraph_ai.mgraph.domain.MGraph import MGraph
from mgraph_db.core.MGraph__Data import MGraph__Data
from mgraph_db.mgraph.domain.MGraph import MGraph
from osbot_utils.utils.Files import current_temp_folder
from osbot_utils.helpers.Local_Cache import Local_Cache
from osbot_utils.utils.Misc import list_set
from osbot_utils.helpers.Random_Seed import Random_Seed
from mgraph_ai.core.MGraph__Serializer import MGraph__Serializer, Serialization_Mode
from mgraph_ai.core.MGraphs import MGraphs
from mgraph_db.core.MGraph__Serializer import MGraph__Serializer, Serialization_Mode
from mgraph_db.core.MGraphs import MGraphs

class test_MGraph__Serializer(TestCase):

Expand Down
8 changes: 4 additions & 4 deletions _experiments/core/test__todo__MGraph.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pytest
from unittest import TestCase
from mgraph_ai.mgraph.domain.MGraph import MGraph
from mgraph_ai.mgraph.schemas.Schema__MGraph__Edge import Schema__MGraph__Edge
from mgraph_db.mgraph.domain.MGraph import MGraph
from mgraph_db.mgraph.schemas.Schema__MGraph__Edge import Schema__MGraph__Edge
from osbot_utils.utils.Misc import is_guid
from mgraph_ai.core.MGraph__Data import MGraph__Data
from mgraph_ai.mgraph.schemas.Schema__MGraph__Graph import Schema__MGraph__Graph
from mgraph_db.core.MGraph__Data import MGraph__Data
from mgraph_db.mgraph.schemas.Schema__MGraph__Graph import Schema__MGraph__Graph
from osbot_utils.utils.Objects import __
from osbot_utils.testing.Stdout import Stdout

Expand Down
6 changes: 3 additions & 3 deletions _experiments/core/test__todo__MGraph__Data.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest
from collections import defaultdict
from unittest import TestCase
from mgraph_ai.core.MGraph__Data import MGraph__Data
from mgraph_ai.mgraph.domain.MGraph import MGraph
from mgraph_ai.mgraph.schemas.Schema__MGraph__Edge import Schema__MGraph__Edge
from mgraph_db.core.MGraph__Data import MGraph__Data
from mgraph_db.mgraph.domain.MGraph import MGraph
from mgraph_db.mgraph.schemas.Schema__MGraph__Edge import Schema__MGraph__Edge
from osbot_utils.testing.Stdout import Stdout
from osbot_utils.utils.Misc import list_set

Expand Down
18 changes: 9 additions & 9 deletions _experiments/obj_factories/MGraph__Json__Obj_Factory__Domain.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from mgraph_ai.providers.json.domain.Domain__MGraph__Json__Edge import Domain__MGraph__Json__Edge
from mgraph_ai.providers.json.domain.Domain__MGraph__Json__Graph import Domain__MGraph__Json__Graph
from mgraph_ai.providers.json.domain.Domain__MGraph__Json__Node import Domain__MGraph__Json__Node
from mgraph_ai.providers.json.domain.Domain__MGraph__Json__Node__Dict import Domain__MGraph__Json__Node__Dict
from mgraph_ai.providers.json.domain.Domain__MGraph__Json__Node__List import Domain__MGraph__Json__Node__List
from mgraph_ai.providers.json.domain.Domain__MGraph__Json__Node__Property import Domain__MGraph__Json__Node__Property
from mgraph_ai.providers.json.domain.Domain__MGraph__Json__Node__Value import Domain__MGraph__Json__Node__Value
from mgraph_ai.providers.json.domain.Domain__MGraph__Json__Types import Domain__MGraph__Json__Types
from mgraph_ai.providers.json.actions.MGraph__Json__Obj_Factory__Models import MGraph__Json__Obj_Factory__Models
from mgraph_db.providers.json.domain.Domain__MGraph__Json__Edge import Domain__MGraph__Json__Edge
from mgraph_db.providers.json.domain.Domain__MGraph__Json__Graph import Domain__MGraph__Json__Graph
from mgraph_db.providers.json.domain.Domain__MGraph__Json__Node import Domain__MGraph__Json__Node
from mgraph_db.providers.json.domain.Domain__MGraph__Json__Node__Dict import Domain__MGraph__Json__Node__Dict
from mgraph_db.providers.json.domain.Domain__MGraph__Json__Node__List import Domain__MGraph__Json__Node__List
from mgraph_db.providers.json.domain.Domain__MGraph__Json__Node__Property import Domain__MGraph__Json__Node__Property
from mgraph_db.providers.json.domain.Domain__MGraph__Json__Node__Value import Domain__MGraph__Json__Node__Value
from mgraph_db.providers.json.domain.Domain__MGraph__Json__Types import Domain__MGraph__Json__Types
from mgraph_db.providers.json.actions.MGraph__Json__Obj_Factory__Models import MGraph__Json__Obj_Factory__Models
from osbot_utils.type_safe.Type_Safe import Type_Safe

class MGraph__Json__Obj_Factory__Domain(Type_Safe):
Expand Down
18 changes: 9 additions & 9 deletions _experiments/obj_factories/MGraph__Json__Obj_Factory__Models.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from mgraph_ai.providers.json.models.Model__MGraph__Json__Edge import Model__MGraph__Json__Edge
from mgraph_ai.providers.json.models.Model__MGraph__Json__Graph import Model__MGraph__Json__Graph
from mgraph_ai.providers.json.models.Model__MGraph__Json__Node import Model__MGraph__Json__Node
from mgraph_ai.providers.json.models.Model__MGraph__Json__Node__Dict import Model__MGraph__Json__Node__Dict
from mgraph_ai.providers.json.models.Model__MGraph__Json__Node__List import Model__MGraph__Json__Node__List
from mgraph_ai.providers.json.models.Model__MGraph__Json__Node__Property import Model__MGraph__Json__Node__Property
from mgraph_ai.providers.json.models.Model__MGraph__Json__Node__Value import Model__MGraph__Json__Node__Value
from mgraph_ai.providers.json.models.Model__MGraph__Json__Types import Model__MGraph__Json__Types
from mgraph_ai.providers.json.actions.MGraph__Json__Obj_Factory__Schemas import MGraph__Json__Obj_Factory__Schemas
from mgraph_db.providers.json.models.Model__MGraph__Json__Edge import Model__MGraph__Json__Edge
from mgraph_db.providers.json.models.Model__MGraph__Json__Graph import Model__MGraph__Json__Graph
from mgraph_db.providers.json.models.Model__MGraph__Json__Node import Model__MGraph__Json__Node
from mgraph_db.providers.json.models.Model__MGraph__Json__Node__Dict import Model__MGraph__Json__Node__Dict
from mgraph_db.providers.json.models.Model__MGraph__Json__Node__List import Model__MGraph__Json__Node__List
from mgraph_db.providers.json.models.Model__MGraph__Json__Node__Property import Model__MGraph__Json__Node__Property
from mgraph_db.providers.json.models.Model__MGraph__Json__Node__Value import Model__MGraph__Json__Node__Value
from mgraph_db.providers.json.models.Model__MGraph__Json__Types import Model__MGraph__Json__Types
from mgraph_db.providers.json.actions.MGraph__Json__Obj_Factory__Schemas import MGraph__Json__Obj_Factory__Schemas
from osbot_utils.type_safe.Type_Safe import Type_Safe

class MGraph__Json__Obj_Factory__Models(Type_Safe):
Expand Down
22 changes: 11 additions & 11 deletions _experiments/obj_factories/MGraph__Json__Obj_Factory__Schemas.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Edge import Schema__MGraph__Json__Edge
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Graph import Schema__MGraph__Json__Graph
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Graph__Data import Schema__MGraph__Json__Graph__Data
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Node import Schema__MGraph__Json__Node
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Node__Dict import Schema__MGraph__Json__Node__Dict
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Node__List import Schema__MGraph__Json__Node__List
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Node__Property import Schema__MGraph__Json__Node__Property
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Node__Property__Data import Schema__MGraph__Json__Node__Property__Data
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Node__Value import Schema__MGraph__Json__Node__Value
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Node__Value__Data import Schema__MGraph__Json__Node__Value__Data
from mgraph_ai.providers.json.schemas.Schema__MGraph__Json__Types import Schema__MGraph__Json__Types
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Edge import Schema__MGraph__Json__Edge
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Graph import Schema__MGraph__Json__Graph
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Graph__Data import Schema__MGraph__Json__Graph__Data
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Node import Schema__MGraph__Json__Node
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Node__Dict import Schema__MGraph__Json__Node__Dict
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Node__List import Schema__MGraph__Json__Node__List
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Node__Property import Schema__MGraph__Json__Node__Property
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Node__Property__Data import Schema__MGraph__Json__Node__Property__Data
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Node__Value import Schema__MGraph__Json__Node__Value
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Node__Value__Data import Schema__MGraph__Json__Node__Value__Data
from mgraph_db.providers.json.schemas.Schema__MGraph__Json__Types import Schema__MGraph__Json__Types
from osbot_utils.type_safe.Type_Safe import Type_Safe

class MGraph__Json__Obj_Factory__Schemas(Type_Safe):
Expand Down
10 changes: 5 additions & 5 deletions _experiments/obj_factories/MGraph__Obj_Factory__Domain.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from mgraph_ai.mgraph.domain.Domain__MGraph__Edge import Domain__MGraph__Edge
from mgraph_ai.mgraph.domain.Domain__MGraph__Graph import Domain__MGraph__Graph
from mgraph_ai.mgraph.domain.Domain__MGraph__Node import Domain__MGraph__Node
from mgraph_ai.mgraph.domain.Domain__MGraph__Types import Domain__MGraph__Types
from mgraph_ai.mgraph.actions.MGraph__Obj_Factory__Models import MGraph__Obj_Factory__Models
from mgraph_db.mgraph.domain.Domain__MGraph__Edge import Domain__MGraph__Edge
from mgraph_db.mgraph.domain.Domain__MGraph__Graph import Domain__MGraph__Graph
from mgraph_db.mgraph.domain.Domain__MGraph__Node import Domain__MGraph__Node
from mgraph_db.mgraph.domain.Domain__MGraph__Types import Domain__MGraph__Types
from mgraph_db.mgraph.actions.MGraph__Obj_Factory__Models import MGraph__Obj_Factory__Models
from osbot_utils.type_safe.Type_Safe import Type_Safe

class MGraph__Obj_Factory__Domain(Type_Safe):
Expand Down
10 changes: 5 additions & 5 deletions _experiments/obj_factories/MGraph__Obj_Factory__Models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from mgraph_ai.mgraph.actions.MGraph__Obj_Factory__Schemas import MGraph__Obj_Factory__Schemas
from mgraph_ai.mgraph.models.Model__MGraph__Edge import Model__MGraph__Edge
from mgraph_ai.mgraph.models.Model__MGraph__Graph import Model__MGraph__Graph
from mgraph_ai.mgraph.models.Model__MGraph__Node import Model__MGraph__Node
from mgraph_ai.mgraph.models.Model__MGraph__Types import Model__MGraph__Types
from mgraph_db.mgraph.actions.MGraph__Obj_Factory__Schemas import MGraph__Obj_Factory__Schemas
from mgraph_db.mgraph.models.Model__MGraph__Edge import Model__MGraph__Edge
from mgraph_db.mgraph.models.Model__MGraph__Graph import Model__MGraph__Graph
from mgraph_db.mgraph.models.Model__MGraph__Node import Model__MGraph__Node
from mgraph_db.mgraph.models.Model__MGraph__Types import Model__MGraph__Types
from osbot_utils.type_safe.Type_Safe import Type_Safe

class MGraph__Obj_Factory__Models(Type_Safe):
Expand Down
16 changes: 8 additions & 8 deletions _experiments/obj_factories/MGraph__Obj_Factory__Schemas.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from osbot_utils.helpers.Obj_Id import Obj_Id
from mgraph_ai.mgraph.schemas.Schema__MGraph__Edge import Schema__MGraph__Edge
from mgraph_ai.mgraph.schemas.Schema__MGraph__Edge__Config import Schema__MGraph__Edge__Config
from mgraph_ai.mgraph.schemas.Schema__MGraph__Edge__Data import Schema__MGraph__Edge__Data
from mgraph_ai.mgraph.schemas.Schema__MGraph__Graph import Schema__MGraph__Graph
from mgraph_ai.mgraph.schemas.Schema__MGraph__Graph__Data import Schema__MGraph__Graph__Data
from mgraph_ai.mgraph.schemas.Schema__MGraph__Node import Schema__MGraph__Node
from mgraph_ai.mgraph.schemas.Schema__MGraph__Node__Data import Schema__MGraph__Node__Data
from mgraph_ai.mgraph.schemas.Schema__MGraph__Types import Schema__MGraph__Types
from mgraph_db.mgraph.schemas.Schema__MGraph__Edge import Schema__MGraph__Edge
from mgraph_db.mgraph.schemas.Schema__MGraph__Edge__Config import Schema__MGraph__Edge__Config
from mgraph_db.mgraph.schemas.Schema__MGraph__Edge__Data import Schema__MGraph__Edge__Data
from mgraph_db.mgraph.schemas.Schema__MGraph__Graph import Schema__MGraph__Graph
from mgraph_db.mgraph.schemas.Schema__MGraph__Graph__Data import Schema__MGraph__Graph__Data
from mgraph_db.mgraph.schemas.Schema__MGraph__Node import Schema__MGraph__Node
from mgraph_db.mgraph.schemas.Schema__MGraph__Node__Data import Schema__MGraph__Node__Data
from mgraph_db.mgraph.schemas.Schema__MGraph__Types import Schema__MGraph__Types
from osbot_utils.type_safe.Type_Safe import Type_Safe

class MGraph__Obj_Factory__Schemas(Type_Safe):
Expand Down
Loading

0 comments on commit 46e59ee

Please sign in to comment.