Пример #1
0
 def apply(self, g):
     super(JSFunction, self).apply(g)
     register_custom_function(self.node, self.execute_from_sparql, True,
                              True)
Пример #2
0
 def test_register_twice_fail(self):
     with assert_raises(ValueError):
         register_custom_function(EX.f, self.f)
Пример #3
0
 def test_register_override(self):
     register_custom_function(EX.f, self.f, override=True)
Пример #4
0
 def setUp(self):
     register_custom_function(EX.f, self.f)
Пример #5
0
 def test_register_override(self):
     register_custom_function(EX.f, self.f, override=True)
Пример #6
0
 def test_register_twice_fail(self):
     with assert_raises(ValueError):
         register_custom_function(EX.f, self.f)
Пример #7
0
 def setUp(self):
     register_custom_function(EX.f, self.f)
Пример #8
0
            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,