Entry 3228
sparql-p
Submitted by anonymous
on Feb. 19, 2010 at 9:57 p.m.
Language: Python. Code size: 3.3 KB.
if nonGroundPatterns: #Only evaluate at the server if not all the terms are ground booleanResp = False for rtDict in self.tripleStore.graph.store.batch_unify(patterns): self.checkForEagerTermination() if self.tripleStore.graphVariable: if self.tripleStore.DAWG_DATASET_COMPLIANCE and \ isinstance(rtDict[self.tripleStore.graphVariable],BNode): #We can't match the default graph when the active #graph is set via the GRAPH expression continue # create a copy of the current bindings, by also adding the new ones from result of the search new_bindings = self.bindings.copy() if not isinstance(rtDict,dict): import pdb;pdb.set_trace() rt.append(rtDict) new_bindings.update(rtDict) child = _SPARQLNode(self,new_bindings,[],self.tripleStore,expr=self.expr) self.children.append(child) assert isinstance(rtDict,bool) or (not child.clash and child.bindings) for func in constraints : try: if func(new_bindings) == False : child.clash = True break except TypeError: child.clash=True if not child.clash and self.expr in queryProlog.rightMostBGPs: child.noteTopLevelAnswer(queryProlog) # else: # child = _SPARQLNode(self,self.bindings,[],self.tripleStore,expr=self.expr) # self.children.append(child) # if self.expr in queryProlog.rightMostBGPs: # child.noteTopLevelAnswer(queryProlog) # import pdb;pdb.set_trace() # booleanResp = True # self.bound = T else: #If all the patterns are ground, there is no need #to invoke server-side unification (no variables to batch unify) self.expandAtClient(constraints) return if self.statement: if not booleanResp and nonGroundPatterns and len(self.children) == 0: #Nonground conjunctive query without any answers self.clash = True else: for func in constraints: try: if func(self.bindings) == False: self.clash = True break except TypeError: self.clash = True if not self.clash and self.expr in queryProlog.rightMostBGPs: self.noteTopLevelAnswer(queryProlog)
This snippet took 0.01 seconds to highlight.
Back to the Entry List or Home.