Schema#
Catalog rows and declarations, importable from agensgraph. The methods that return and take them
are on Connection.
Catalog rows#
See Inspecting a graph.
- class agensgraph.Graph(name: str, schema: str, labels: int)#
A graph.
- name: str#
- schema: str#
the schema it is stored in
- labels: int#
how many labels it has, built-ins included
- class agensgraph.LabelInfo(id: int, name: str, kind: str, parent: str | None)#
A label. Prints as
Label.- id: int#
the label’s id, the first number of its elements’ identities
- name: str#
as stored
- kind: str#
'v'or'e'
- parent: str | None#
the label it inherits from
- property is_vertex: bool#
- property is_edge: bool#
- property is_builtin: bool#
ag_vertexorag_edge.
- class agensgraph.DeclaredProperty(
- label: str,
- name: str,
- type: str,
- nullable: bool,
- inherited: bool = False,
A property kept in a column of its own.
- label: str#
- name: str#
- type: str#
the server’s spelling of its type
- nullable: bool#
- inherited: bool#
whether it comes from the label’s parent
- class agensgraph.Index(label: str, name: str, unique: bool, definition: str)#
A property index.
- label: str#
- name: str#
- unique: bool#
- definition: str#
the statement that would create it again
- class agensgraph.Constraint(label: str, name: str, unique: bool, definition: str)#
A uniqueness or check constraint.
- label: str#
- name: str#
- unique: bool#
true for a uniqueness constraint
- definition: str#
the server’s normalised rendering
- class agensgraph.GraphDescription(
- graph: str,
- labels: tuple[Label, ...],
- properties: dict[str, tuple[PropertyShape, ...]],
- triples: tuple[Triple, ...],
- counts: dict[str, int],
- meta_gathered: bool,
What
describe()returns.- graph: str#
- properties: dict[str, tuple[PropertyShape, ...]]#
for each label but the built-ins, its properties as
PropertyShapes
- counts: dict[str, int]#
elements per label
- meta_gathered: bool#
whether
triplesis current
Declarations#
See Declaring a schema.
- class agensgraph.DesiredLabel(
- name: str,
- kind: str = 'v',
- parent: str | None = None,
- properties: Sequence[PromotedProperty] = (),
A label that should exist.
- name: str#
- kind: str#
'v'or'e'
- parent: str | None#
the label to inherit from
- properties: Sequence[PromotedProperty]#
PromotedPropertys to keep in columns of their own
- class agensgraph.PromotedProperty(name: str, type: str)#
A property to keep in a column of its own.
- name: str#
- type: str#
the column type, written into the statement as given
- rendered() str#
The column’s definition.
- class agensgraph.DesiredIndex(
- label: str,
- properties: tuple[str | IndexElement, ...],
- unique: bool = False,
- name: str | None = None,
- method: str = 'btree',
- where: str | None = None,
A property index that should exist.
- label: str#
- properties: tuple[str | IndexElement, ...]#
names, or
IndexElements
- unique: bool#
- name: str | None#
required with
where
- method: str#
btree,gin,hnsw, …
- where: str | None#
a partial index’s predicate
- property elements: tuple[IndexElement, ...]#
propertiesasIndexElements.
- key() tuple[str, str, tuple[IndexElement, ...]]#
What an index is matched on.
- class agensgraph.IndexElement(
- property: str,
- operator_class: str | None = None,
- descending: bool = False,
- nulls_first: bool | None = None,
- cast: str | None = None,
One property of an index.
- property: str#
- operator_class: str | None#
only when not the default
- descending: bool#
- nulls_first: bool | None#
Nonefor the default
- cast: str | None#
a type to index the property as, such as
vector(4)
- rendered() str#
- resolved() IndexElement#
The same with
nulls_firstmade explicit.
- nulls_come_first() bool#
Statements without a connection#
- agensgraph.create_label_statement(
- name: str,
- kind: str,
- parent: str | None = None,
- properties: Sequence[PromotedProperty] = (),
create vlabelorcreate elabel,if not exists.
- agensgraph.create_index_statement(desired: DesiredIndex, *, if_not_exists: bool = False) str#
create property index; withif_not_exists, which needs a name.