pyvgx.Vertex
class pyvgx.Vertex( graph, id[, type_[, mode[, timeout ]]] )-
The
pyvgx.Vertextype represents the Python layer’s view of VGX vertex objects. Objects of this class are wrappers that enable Python code to access core VGX vertices.Parameters
Parameter Type Default Description graph
Parent graph
id
str or bytes or int
Unique vertex identifier string or memory address known to reference vertex
type
str or bytes
Nonemode
chr
"a"
Access mode: "w" (writable), "a" (modify), or "r" (readonly)
timeout
int
0
Milliseconds to block while waiting for access
Remarks
The pyvgx.Vertex type represents VGX core vertex objects. The returned Python object is a wrapper around the internal VGX vertex object.
This constructor creates a new VGX vertex in parent graph or opens an existing VGX vertex. If the vertex already exists id may be given as a string or as a memory address known to reference the vertex. If the vertex does not already exist id must be a string.
The optional type string may only be specified if the mode is "w", otherwise ValueError is raised. If the vertex already exists with a type other than type ValueError is raised. When type is
None(the default) a typeless vertex is created.The optional mode character specifies access type.
Mode Description "w"Open vertex writable and create if it does not exist
"a"Open vertex writable but do not create
"r"Open vertex readonly
Both
"a"and"r"will raise KeyError if vertex does not exist.An optional timeout in milliseconds may be specified to allow blocking while waiting for vertex to become available to the calling thread.
Instead of calling this constructor directly it is recommended to use one of the following pyvgx.Graph API methods:
Example
import pyvgx pyvgx.system.Initialize() g = pyvgx.Graph( "graph1" ) A = pyvgx.Vertex( g, "A", "node", "w" ) # create "A" of type "node" del A A = pyvgx.Vertex( g, "A", mode="r" ) # open "A" readonly
pyvgx.Vertex API
| pyvgx.Vertex API Section | Description |
|---|---|
Vertex object members |
|
Methods for checking and modifying vertex access mode |
|
Methods for managing vertex properties |
|
Methods for accessing vertex ranking coefficients |
|
Methods for managing vertex vectors |
|
Methods for managing vertex expiration |
|
Methods for accessing and managing various vertex attributes |
|
Syntax rules for vertex conditions used in queries
|
