Example #1
0
 def _outV(self):
     """Returns the outgoing vertex ID of the edge."""
     #return int(self._data['_outV'])
     _outV = self._data.get('_outV')
     if _outV is None and hasattr(self, "__outV"):
         _outV = self.__outV
     return utils.coerce_id(_outV)
Example #2
0
 def _outV(self):
     """Returns the outgoing vertex ID of the edge."""
     #return int(self._data['_outV'])
     _outV = self._data.get('_outV')
     if _outV is None and hasattr(self,"__outV"):
         _outV = self.__outV
     return utils.coerce_id(_outV)
Example #3
0
 def _inV(self):
     """Returns the incoming vertex ID of the edge."""
     #return int(self._data['_inV'])
     #return utils.coerce_id(self._data['_inV'])
     _inV = self._data.get('_inV')
     if _inV is None and hasattr(self, "__inV"):
         _inV = self.__inV
     return utils.coerce_id(_inV)
Example #4
0
 def _inV(self):
     """Returns the incoming vertex ID of the edge."""
     #return int(self._data['_inV'])
     #return utils.coerce_id(self._data['_inV'])
     _inV = self._data.get('_inV')
     if _inV is None and hasattr(self,"__inV"):
         _inV = self.__inV
     return utils.coerce_id(_inV)
Example #5
0
 def _coerce_vertex_id(self, v):
     """Returns the vertex ID coerced into an int if need be."""
     # param v is either a Vertex object or a vertex ID.
     # the vertex ID may have been passed in as a string
     if isinstance(v, Vertex):
         vertex_id = v._id
     else:
         # using corece_id to support linked-data URI IDs
         vertex_id = coerce_id(v)
     return vertex_id
Example #6
0
 def _coerce_vertex_id(self,v):
     """Returns the vertex ID coerced into an int if need be."""
     # param v is either a Vertex object or a vertex ID.
     # the vertex ID may have been passed in as a string
     if isinstance(v,Vertex):
         vertex_id = v._id
     else:
         # using corece_id to support linked-data URI IDs
         vertex_id = coerce_id(v)
     return vertex_id
Example #7
0
 def _id(self):
     """
     Returns the element ID. This is the element's "primary key"; however,
     some DBs (such as neo4j) reuse IDs if they are deleted so 
     be careful with how you use them. If you want to guarantee
     they are unique across the DB's lifetime either don't 
     physically delete elements and just set a deleted flag, or
     use some other mechanism, such as an external sequence or 
     a hash.
     
     """
     #int(self._data['_id'])
     return utils.coerce_id(self._data['_id'])
Example #8
0
 def _id(self):
     """
     Returns the element ID. This is the element's "primary key"; however,
     some DBs (such as neo4j) reuse IDs if they are deleted so 
     be careful with how you use them. If you want to guarantee
     they are unique across the DB's lifetime either don't 
     physically delete elements and just set a deleted flag, or
     use some other mechanism, such as an external sequence or 
     a hash.
     
     """
     #int(self._data['_id'])
     return utils.coerce_id(self._data['_id'])
Example #9
0
    def _coerce_vertex_id(self, v):
        """ 
        Returns the vertex ID coerced into an int if need be.

        :param v: Either a Vertex object or a vertex ID.

        """
        if isinstance(v, Vertex):
            vertex_id = v._id
        else:
            # the vertex ID may have been passed in as a string
            #vertex_id = int(v)
            vertex_id = utils.coerce_id(v)
        return vertex_id
Example #10
0
    def _coerce_vertex_id(self,v):
        """ 
        Returns the vertex ID coerced into an int if need be.

        :param v: Either a Vertex object or a vertex ID.

        """
        if isinstance(v,Vertex):
            vertex_id = v._id
        else:
            # the vertex ID may have been passed in as a string
            #vertex_id = int(v)
            vertex_id = utils.coerce_id(v)
        return vertex_id
Example #11
0
 def _inV(self):
     """Returns the incoming vertex ID of the edge."""
     #return int(self._data['_inV'])
     return utils.coerce_id(self._data['_inV'])
Example #12
0
 def _outV(self):
     """Returns the outgoing vertex ID of the edge."""
     #return int(self._data['_outV'])
     return utils.coerce_id(self._data['_outV'])