def apply(self, g): super(JSFunction, self).apply(g) register_custom_function(self.node, self.execute_from_sparql, True, True)
def test_register_twice_fail(self): with assert_raises(ValueError): register_custom_function(EX.f, self.f)
def test_register_override(self): register_custom_function(EX.f, self.f, override=True)
def setUp(self): register_custom_function(EX.f, self.f)
po = "<http://dummy>" else: po = '"lit"' return (f"<{ps}> <{p}> {po} .") else: return None ## maybe useless ## just use regular bind... def reify(s, p, o): rs = s + p + o return URIRef("http://" + hashlib.md5(rs.encode('utf-8')).hexdigest()) register_custom_function(URIRef("hello"), myfunc, raw=True) register_custom_function(URIRef("summ"), summary, raw=True) class BindIterator(PreemptableIterator): """A BindIterator evaluates a BIND statement in a pipeline of iterators. Args: * source: Previous iterator in the pipeline. * expression: a text representing the bind expression * bindvar: the bind variable """ def __init__(self, source: PreemptableIterator, bindexpr: str, bindvar: str,