diff service/mqtt_to_rdf/inference.py @ 1609:34f2817320cc

new tests for a smaller part of the inner loop
author drewp@bigasterisk.com
date Mon, 06 Sep 2021 18:06:11 -0700
parents f928eb06a4f6
children 6fc48ef4c696
line wrap: on
line diff
--- a/service/mqtt_to_rdf/inference.py	Mon Sep 06 17:03:19 2021 -0700
+++ b/service/mqtt_to_rdf/inference.py	Mon Sep 06 18:06:11 2021 -0700
@@ -50,6 +50,9 @@
 
         self.evaluations = list(Evaluation.findEvals(self.graph))
 
+    def __repr__(self):
+        return f"Lhs({graphDump(self.graph)})"
+
     def findCandidateBindings(self, workingSet: ReadOnlyWorkingSet, stats) -> Iterator['BoundLhs']:
         """bindings that fit the LHS of a rule, using statements from workingSet and functions
         from LHS"""
@@ -143,7 +146,6 @@
 @dataclass
 class BoundLhs:
     lhs: Lhs
-    binding: CandidateBinding # mutable
 
     def __post_init__(self):
         self.usedByFuncs = Graph(identifier=GRAPH_ID)
@@ -188,7 +190,6 @@
                 return False
         return True
 
-
     def _logVerifyBanner(self, boundLhs, workingSet: ReadOnlyWorkingSet, boundUsedByFuncs):
         if not log.isEnabledFor(logging.DEBUG):
             return