diff --git a/bulbs/element.py b/bulbs/element.py index 5d474eb..5e41931 100644 --- a/bulbs/element.py +++ b/bulbs/element.py @@ -342,6 +342,17 @@ def map(self): log.debug("This is deprecated; use data() instead.") return self.data() + def custom_step(self,script,params={}): + """ + Execute a custom gremlin step starting from the current element. + Do not use "_id" as a key in params. + e.g.: >>> node.custom_step('outE(x).bothV',{'x':'A'}) + """ + full_script = 'g.v(_id).'+script + params['_id']=self._id + resp = self._client.gremlin(full_script,params) + return initialize_elements(self._client,resp) + #