diff service/mqtt_to_rdf/candidate_binding.py @ 1632:bd79a2941cab

just (a lot of) debug changes
author drewp@bigasterisk.com
date Sun, 12 Sep 2021 21:46:39 -0700
parents e24058ae4806
children ba59cfc3c747
line wrap: on
line diff
--- a/service/mqtt_to_rdf/candidate_binding.py	Sun Sep 12 04:32:52 2021 -0700
+++ b/service/mqtt_to_rdf/candidate_binding.py	Sun Sep 12 21:46:39 2021 -0700
@@ -1,3 +1,4 @@
+import logging
 from dataclasses import dataclass
 from typing import Dict, Iterable, Iterator, Union
 
@@ -6,7 +7,8 @@
 from rdflib.term import Node, Variable
 
 from inference_types import BindableTerm, BindingUnknown, Triple
-
+log = logging.getLogger()
+INDENT = '    '
 
 @dataclass
 class CandidateBinding:
@@ -24,7 +26,11 @@
                     self._applyTerm(stmt[1], returnBoundStatementsOnly), 
                     self._applyTerm(stmt[2], returnBoundStatementsOnly))
             except BindingUnknown:
+                log.debug(f'{INDENT*7} CB.apply cant bind {stmt} using {self.binding}')
+
                 continue
+            log.debug(f'{INDENT*7} CB.apply took {stmt} to {bound}')
+
             yield bound
 
     def _applyTerm(self, term: Node, failUnbound=True):