Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

Fix: JenaStore empty graph issue (Issue #257)

ZohaibHassan1631c90b0d194b
diff --git a/semantica/triplet_store/jena_store.py b/semantica/triplet_store/jena_store.py
index 9a49a300..11bfd7be 100644
--- a/semantica/triplet_store/jena_store.py
+++ b/semantica/triplet_store/jena_store.py
@@ -132,7 +132,7 @@ class JenaStore:
)
try:
- if not self.graph:
+ if self.graph is None:
self.progress_tracker.stop_tracking(
tracking_id, status="failed", message="Graph not initialized"
)
@@ -175,14 +175,14 @@ class JenaStore:
return self.add_triplets([triplet], **options)
def get_triplets(
- self,
- subject: Optional[str] = None,
- predicate: Optional[str] = None,
- object: Optional[str] = None,
- **options,
+ self,
+ subject: Optional[str] = None,
+ predicate: Optional[str] = None,
+ object: Optional[str] = None,
+ **options,
) -> List[Triplet]:
"""Get triplets matching criteria."""
- if not self.graph:
+ if self.graph is None:
return []
try:
@@ -218,7 +218,7 @@ class JenaStore:
def delete_triplet(self, triplet: Triplet, **options) -> Dict[str, Any]:
"""Delete triplet."""
- if not self.graph:
+ if self.graph is None:
raise ProcessingError("Graph not initialized")
try:
@@ -273,7 +273,7 @@ class JenaStore:
Returns:
Query results
"""
- if not self.graph:
+ if self.graph is None:
raise ProcessingError("Graph not initialized")
try:
@@ -319,7 +319,7 @@ class JenaStore:
Returns:
Serialized RDF string
"""
- if not self.graph:
+ if self.graph is None:
return ""
try: