# HG changeset patch # User drewp@bigasterisk.com # Date 1632291616 25200 # Node ID 9d00adef0b222753f31cef7b25518761f0fc5e04 # Parent 89e53cb8a01ce28619c75988bf7dad2bae0455ea rm used parameter diff -r 89e53cb8a01c -r 9d00adef0b22 service/mqtt_to_rdf/inference.py --- 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') diff -r 89e53cb8a01c -r 9d00adef0b22 service/mqtt_to_rdf/stmt_chunk.py --- 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: