Mercurial > code > home > repos > homeauto
comparison service/mqtt_to_rdf/inference.py @ 1591:668958454ae2
shuffle some logging
author | drewp@bigasterisk.com |
---|---|
date | Sat, 04 Sep 2021 15:34:29 -0700 |
parents | 327202020892 |
children | d7b66234064b |
comparison
equal
deleted
inserted
replaced
1590:327202020892 | 1591:668958454ae2 |
---|---|
220 yield cast(Triple, stmt) | 220 yield cast(Triple, stmt) |
221 | 221 |
222 | 222 |
223 def verifyBinding(lhs: Graph, binding: Dict[BindableTerm, Node], workingSet: Graph, usedByFuncs: Graph) -> bool: | 223 def verifyBinding(lhs: Graph, binding: Dict[BindableTerm, Node], workingSet: Graph, usedByFuncs: Graph) -> bool: |
224 """Can this lhs be true all at once in workingSet? Does it match with these bindings?""" | 224 """Can this lhs be true all at once in workingSet? Does it match with these bindings?""" |
225 log.debug(f' verify all bindings against this lhs:') | |
226 boundLhs = list(withBinding(lhs, binding)) | 225 boundLhs = list(withBinding(lhs, binding)) |
227 for stmt in boundLhs: | |
228 log.debug(f' {stmt}') | |
229 | |
230 log.debug(f' and against this workingSet:') | |
231 for stmt in workingSet: | |
232 log.debug(f' {stmt}') | |
233 | |
234 log.debug(f' ignoring these usedByFuncs:') | |
235 boundUsedByFuncs = list(withBinding(usedByFuncs, binding)) | 226 boundUsedByFuncs = list(withBinding(usedByFuncs, binding)) |
236 for stmt in boundUsedByFuncs: | 227 if log.isEnabledFor(logging.DEBUG): |
237 log.debug(f' {stmt}') | 228 log.debug(f' verify all bindings against this lhs:') |
229 for stmt in boundLhs: | |
230 log.debug(f' {stmt}') | |
231 | |
232 log.debug(f' and against this workingSet:') | |
233 for stmt in workingSet: | |
234 log.debug(f' {stmt}') | |
235 | |
236 log.debug(f' ignoring these usedByFuncs:') | |
237 for stmt in boundUsedByFuncs: | |
238 log.debug(f' {stmt}') | |
238 # The static stmts in lhs are obviously going | 239 # The static stmts in lhs are obviously going |
239 # to match- we only need to verify the ones | 240 # to match- we only need to verify the ones |
240 # that needed bindings. | 241 # that needed bindings. |
241 for stmt in boundLhs: #withBinding(lhs, binding, includeStaticStmts=False): | 242 for stmt in boundLhs: #withBinding(lhs, binding, includeStaticStmts=False): |
242 log.debug(f' check for {stmt}') | 243 log.debug(f' check for {stmt}') |