pyvgx.Vertex

class pyvgx.Vertex( graph, id[, type_[, mode[, timeout ]]] )

The pyvgx.Vertex type 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

pyvgx.Graph instance

Parent graph

id

str or bytes or int

Unique vertex identifier string or memory address known to reference vertex

type

str or bytes

None

mode

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 Members

Vertex object members

Vertex Access Methods

Methods for checking and modifying vertex access mode

Vertex Property Methods

Methods for managing vertex properties

Vertex Rank Methods

Methods for accessing vertex ranking coefficients

Vertex Vector Methods

Methods for managing vertex vectors

Vertex TTL Methods

Methods for managing vertex expiration

Vertex Miscellaneous Methods

Methods for accessing and managing various vertex attributes

Vertex Condition Syntax

Syntax rules for vertex conditions used in queries
General Syntax
Constraints
Evaluation Order
Vertex Filters


PYVGX