Mercurial > code > home > repos > homeauto
diff service/mqtt_to_rdf/inference.py @ 1613:03ed8c9abd5b
forget GRAPH_ID optimization in this case
author | drewp@bigasterisk.com |
---|---|
date | Mon, 06 Sep 2021 23:03:51 -0700 |
parents | 272f78d4671a |
children | 97b2c3cfdb83 |
line wrap: on
line diff
--- a/service/mqtt_to_rdf/inference.py Mon Sep 06 18:39:38 2021 -0700 +++ b/service/mqtt_to_rdf/inference.py Mon Sep 06 23:03:51 2021 -0700 @@ -27,10 +27,6 @@ LOG = Namespace('http://www.w3.org/2000/10/swap/log#') MATH = Namespace('http://www.w3.org/2000/10/swap/math#') -# Graph() makes a BNode if you don't pass -# identifier, which can be a bottleneck. -GRAPH_ID = URIRef('dont/care') - @dataclass class Lhs: @@ -80,6 +76,8 @@ yield binding def _allStaticStatementsMatch(self, workingSet: ReadOnlyWorkingSet) -> bool: + # bug: see TestSelfFulfillingRule.test3 for a case where this rule's + # static stmt is matched by a non-static stmt in the rule itself for ruleStmt in self.staticRuleStmts: if ruleStmt not in workingSet: log.debug(f'{INDENT*3} {ruleStmt} not in working set- skip rule') @@ -153,7 +151,7 @@ binding: CandidateBinding def __post_init__(self): - self.usedByFuncs = Graph(identifier=GRAPH_ID) + self.usedByFuncs = Graph() self._applyFunctions() self.graphWithoutEvals = self.lhs.graph - self.usedByFuncs