changeset 1669:9d00adef0b22

rm used parameter
author drewp@bigasterisk.com
date Tue, 21 Sep 2021 23:20:16 -0700
parents 89e53cb8a01c
children 6fa7ddee9ba8
files service/mqtt_to_rdf/inference.py service/mqtt_to_rdf/stmt_chunk.py
diffstat 2 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/service/mqtt_to_rdf/inference.py	Tue Sep 21 22:29:19 2021 -0700
+++ b/service/mqtt_to_rdf/inference.py	Tue Sep 21 23:20:16 2021 -0700
@@ -90,7 +90,7 @@
             augmentedWorkingSet = self._alignedMatches
         else:
             augmentedWorkingSet = list(
-                applyChunky(self.prev.currentBinding(), self._alignedMatches, returnBoundStatementsOnly=False))
+                applyChunky(self.prev.currentBinding(), self._alignedMatches))
 
         if self._advanceWithPlainMatches(augmentedWorkingSet):
             ringlog.debug(f'{INDENT*6} <-- {self}.advance finished with plain matches')
--- a/service/mqtt_to_rdf/stmt_chunk.py	Tue Sep 21 22:29:19 2021 -0700
+++ b/service/mqtt_to_rdf/stmt_chunk.py	Tue Sep 21 23:20:16 2021 -0700
@@ -8,7 +8,7 @@
 from rdflib.term import BNode, Literal, Node, URIRef, Variable
 
 from candidate_binding import CandidateBinding
-from inference_types import BindingUnknown, Inconsistent
+from inference_types import Inconsistent
 
 log = logging.getLogger('infer')
 
@@ -128,10 +128,10 @@
     def isStatic(self) -> bool:
         return all(_termIsStatic(s) for s in self._allTerms())
 
-    def apply(self, cb: CandidateBinding, returnBoundStatementsOnly=True) -> 'Chunk':
+    def apply(self, cb: CandidateBinding) -> 'Chunk':
         """Chunk like this one but with cb substitutions applied. If the flag is
         True, we raise BindingUnknown instead of leaving a term unbound"""
-        fn = lambda t: cb.applyTerm(t, returnBoundStatementsOnly)
+        fn = lambda t: cb.applyTerm(t, failUnbound=False)
         return Chunk(
             (
                 fn(self.primary[0]) if self.primary[0] is not None else None,  #
@@ -147,10 +147,9 @@
 
 
 def applyChunky(cb: CandidateBinding,
-                g: Iterable[AlignedRuleChunk],
-                returnBoundStatementsOnly=True) -> Iterator[AlignedRuleChunk]:
+                g: Iterable[AlignedRuleChunk]) -> Iterator[AlignedRuleChunk]:
     for aligned in g:
-        bound = aligned.ruleChunk.apply(cb, returnBoundStatementsOnly=returnBoundStatementsOnly)
+        bound = aligned.ruleChunk.apply(cb)
         try:
             yield AlignedRuleChunk(bound, aligned.workingSetChunk)
         except Inconsistent: