Graph-Native Infrastructure for Context and Accountable AI Systems
Python agent-memoryaiai-governanceai-infrastructureartificial-intelligencecontext-engineeringcontext-graphsdata-engineeringdecision-intelligencedeveloper-toolsexplainable-aigenerative-aigraph-ragknowledge-graphllmontologyprovenancepythonreasoningsemantic-search
fix: correct critical bugs and typos in delta processing implementation
KaifAhmad1e3c17487e390
diff --git a/semantica/change_management/managers.py b/semantica/change_management/managers.pyindex 0dc24d04..bbbdc74c 100644--- a/semantica/change_management/managers.py+++ b/semantica/change_management/managers.py@@ -340,10 +340,10 @@ class TemporalVersionManager(BaseVersionManager):"""Prune old snapshots, keeping only the most recent N versions.Optionally deletes the backend graphs from the triplet store to free space.-+Args:keep_last_n: Number of recent versions to retain.- triplet_store: Optional TripletScore instance to execute DROP GRAPH.+ triplet_store: Optional TripletStore instance to execute DROP GRAPH.Returns:Dict containing counts and labels of pruned versions.diff --git a/semantica/change_management/version_storage.py b/semantica/change_management/version_storage.pyindex b5e7e4b4..69767233 100644--- a/semantica/change_management/version_storage.py+++ b/semantica/change_management/version_storage.py@@ -49,13 +49,13 @@ def create_graph_snapshot_record() -> Dict[str, Any]:"""Creates a standardized snapshot metadata record for a named graph.-+Args:version_id: Unique identifier for this snapshotgraph_uri: The underlying named graph URI in the triplet storeauthor: Creator of the snapshotdescription: Purpose or context of the snapshot- metadata: Additional tags or piepline context+ metadata: Additional tags or pipeline context"""record = {diff --git a/semantica/triplet_store/triplet_store.py b/semantica/triplet_store/triplet_store.pyindex 4183a2da..dd244a76 100644--- a/semantica/triplet_store/triplet_store.py+++ b/semantica/triplet_store/triplet_store.py@@ -445,7 +445,7 @@ class TripletStore:tracking_id = self.progress_tracker.start_tracking(module="triplet_store",- submodule="COmputeDelta",+ submodule="ComputeDelta",message=f"Computing delta: {old_graph_uri} -> {new_graph_uri}",)@@ -453,7 +453,7 @@ class TripletStore:added_query = f"""SELECT ?s ?p ?o WHERE {{GRAPH <{new_graph_uri} > {{ ?s ?p ?o }}- FILTER NOT EXISTS {{ GRAPH <{old_graph_uri}> {{ ?s ?o ?p}} }}+ FILTER NOT EXISTS {{ GRAPH <{old_graph_uri}> {{ ?s ?p ?o}} }}}}"""@@ -478,10 +478,10 @@ class TripletStore:s = b.get("s", {}).get("value") if isinstance(b.get("s"), dict) else b.get("s")p = b.get("p", {}).get("value") if isinstance(b.get("p"), dict) else b.get("p")o = b.get("o", {}).get("value") if isinstance(b.get("o"), dict) else b.get("o")-+if s and p and o:- triplets.append(Triplets(s, p, o))-+ triplets.append(Triplet(s, p, o))+return tripletsadded_triples = extract_triplets(added_res.bindings)@@ -490,7 +490,7 @@ class TripletStore:self.progress_tracker.stop_tracking(tracking_id,status="completed",- message=f"Delte computed: +{len(added_triples)} / -{len(removed_triples)}"+ message=f"Delta computed: +{len(added_triples)} / -{len(removed_triples)}")return {@@ -499,7 +499,7 @@ class TripletStore:"added_triples": added_triples,"removed_triples": removed_triples,"added_count": len(added_triples),- "removed_triples": len(removed_triples),+ "removed_count": len(removed_triples),}except Exception as e: