graflo.db.nebula.query¶
Query builders for NebulaGraph nGQL (v3.x) and ISO GQL (v5.x).
Each public function returns a query string ready to be passed to the
adapter's execute method.
aggregate_ngql(tag_name, agg_func, discriminant=None, aggregated_field=None, filter_clause='')
¶
Build an aggregation query using MATCH.
Source code in graflo/db/nebula/query.py
batch_upsert_vertices_ngql(tag_name, docs, match_keys, tag_fields)
¶
Return a list of UPSERT VERTEX statements for a document batch.
Source code in graflo/db/nebula/query.py
create_edge_index_ngql(index_name, edge_type, index_fields, string_index_length=256)
¶
CREATE EDGE INDEX IF NOT EXISTS idx ON edge_type(field(len), ...).
Source code in graflo/db/nebula/query.py
create_edge_type_ngql(edge_type, fields=None)
¶
CREATE EDGE IF NOT EXISTS EdgeType(prop type, ...).
Source code in graflo/db/nebula/query.py
create_tag_index_ngql(index_name, tag_name, index_fields, string_index_length=256, string_fields=None)
¶
CREATE TAG INDEX IF NOT EXISTS idx ON tag(field(len), ...).
Source code in graflo/db/nebula/query.py
create_tag_ngql(tag_name, fields)
¶
CREATE TAG IF NOT EXISTS Tag(prop type, ...).
Source code in graflo/db/nebula/query.py
fetch_docs_ngql(tag_name, filter_clause='', limit=None, return_keys=None)
¶
MATCH (v:Tag) WHERE ... RETURN v LIMIT n.
Source code in graflo/db/nebula/query.py
fetch_edges_ngql(from_tag, from_vid, edge_type=None, to_tag=None, to_vid=None, filter_clause='', limit=None, direction=EdgeDirection.OUT)
¶
Build a GO query for fetching edges incident to one vertex.
$$ is the vertex at the far end of whichever orientation GO walked,
so the to_vid predicate keeps meaning "the other endpoint" under
REVERSELY and BIDIRECT without special-casing.
Source code in graflo/db/nebula/query.py
insert_edges_ngql(edge_type, edges, edge_fields=None)
¶
Batch INSERT EDGE IF NOT EXISTS type(cols) VALUES "src"->"dst":(vals), ....
Source code in graflo/db/nebula/query.py
insert_vertices_ngql(tag_name, docs, match_keys, tag_fields)
¶
Batch INSERT VERTEX IF NOT EXISTS tag(cols) VALUES "vid":(vals), ....
Source code in graflo/db/nebula/query.py
upsert_vertex_gql(tag_name, vid, props, tag_fields)
¶
Source code in graflo/db/nebula/query.py
upsert_vertex_ngql(tag_name, vid, props, tag_fields)
¶
UPSERT VERTEX ON tag "vid" SET prop=val, ....