comparison service/mqtt_to_rdf/stmt_chunk.py @ 1652:dddfa09ea0b9

debug logging and comments
author drewp@bigasterisk.com
date Sun, 19 Sep 2021 13:19:20 -0700
parents 20474ad4968e
children e7d594c065d4
comparison
equal deleted inserted replaced
1651:20474ad4968e 1652:dddfa09ea0b9
56 return outBinding 56 return outBinding
57 57
58 def myMatches(self, g: 'ChunkedGraph') -> List['Chunk']: 58 def myMatches(self, g: 'ChunkedGraph') -> List['Chunk']:
59 """Chunks from g where self, which may have BindableTerm wildcards, could match that chunk in g.""" 59 """Chunks from g where self, which may have BindableTerm wildcards, could match that chunk in g."""
60 out: List['Chunk'] = [] 60 out: List['Chunk'] = []
61 log.debug(f'{self}.myMatches({g}') 61 log.debug(f'{INDENT*6} {self}.myMatches({g}')
62 for ch in g.allChunks(): 62 for ch in g.allChunks():
63 if self.matches(ch): 63 if self.matches(ch):
64 out.append(ch) 64 out.append(ch)
65 #out.sort() # probably leftover- remove? 65 #out.sort() # probably leftover- remove?
66 return out 66 return out
111 yield bound 111 yield bound
112 112
113 113
114 class ChunkedGraph: 114 class ChunkedGraph:
115 """a Graph converts 1-to-1 with a ChunkedGraph, where the Chunks have 115 """a Graph converts 1-to-1 with a ChunkedGraph, where the Chunks have
116 combined some statements together. (The only excpetion is that bnodes for 116 combined some statements together. (The only exception is that bnodes for
117 rdf lists are lost)""" 117 rdf lists are lost)"""
118 118
119 def __init__( 119 def __init__(
120 self, 120 self,
121 graph: Graph, 121 graph: Graph,