Created
December 9, 2011 09:26
-
-
Save espeed/1450871 to your computer and use it in GitHub Desktop.
Bulbs Vertex Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Vertex(Element): | |
"""A container for Vertex elements returned by the resource.""" | |
def outE(self,label=None): | |
"""Return the outgoing edges of the vertex.""" | |
params = dict(_id=self._id,label=label) | |
script = self._resource.scripts.get('outE',params) | |
return self.gremlin(script) | |
def inE(self,label=None): | |
"""Return the incoming edges of the vertex.""" | |
params = dict(_id=self._id,label=label) | |
script = self._resource.scripts.get('inE',params) | |
return self.gremlin(script) | |
def bothE(self,label=None): | |
"""Return all incoming and outgoing edges of the vertex.""" | |
params = dict(_id=self._id,label=label) | |
script = self._resource.scripts.get('bothE',params) | |
return self.gremlin(script) | |
def outV(self,label=None): | |
"""Return the out-adjacent vertices to the vertex.""" | |
params = dict(_id=self._id,label=label) | |
script = self._resource.scripts.get('outV',params) | |
return self.gremlin(script) | |
def inV(self,label=None): | |
"""Return the in-adjacent vertices of the vertex.""" | |
params = dict(_id=self._id,label=label) | |
script = self._resource.scripts.get('inV',params) | |
return self.gremlin(script) | |
def bothV(self,label=None): | |
"""Return all incoming- and outgoing-adjacent vertices of vertex.""" | |
params = dict(_id=self._id,label=label) | |
script = self._resource.scripts.get('bothV',params) | |
return self.gremlin(script) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment