xgt.Vertex¶
-
class
xgt.
Vertex
(name, schema, key)¶ Defines a new vertex type.
Vertex objects capture the names and datatypes of properties on vertices, and they are required in order to define a new graph.
Parameters: - name : str
Vertex type name.
- schema : list of tuples
List of tuples associating property names with xGT data types.
- key : list of strings
List of one or more property names that are used to uniquely identify vertices in the graph.
Examples
>>> import xgt >>> conn = xgt.connect() >>> conn.drop_graph('Company') >>> ng = xgt.Graph('Company') >>> v1 = xgt.Vertex(name = 'Person', ... schema = [('id', xgt.INT), ... ('name', xgt.TEXT)], ... key = ['id']) >>> ng.add(v1) >>> ... >>> conn.create(ng)
Attributes: -
__init__
(name, schema, key)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(name, schema, key)Initialize self. Attributes
key
list: List of property names that identify a single vertex. name
str: Name of the vertex type. schema
list of tuples: List of name-type pairs. -
key
¶ list: List of property names that identify a single vertex.
-
name
¶ str: Name of the vertex type.
-
schema
¶ list of tuples: List of name-type pairs.