Skip to main content

read_edges

Function read_edges 

Source
pub fn read_edges(
    dir: &Path,
    rel_name: &str,
    mode: OntologyMode,
) -> Result<Vec<RecordBatch>, DataFusionError>
Expand description

Read all edge rows for relation rel_name from the project at dir.

The on-disk layout mirrors GraphWriter:

  • Strict / Advisory — typed edges in topology/edges/<rel_name>.parquet (TYPED_EDGE_SCHEMA).
  • Exploratory — all edges in topology/edges/_exploratory.parquet (EXPLORATORY_EDGE_SCHEMA, carrying a rel_type_name column). The returned batch is not filtered by rel_name; callers that need a single relation must filter on rel_type_name themselves.

Returns a single (possibly empty) RecordBatch with the mode-appropriate schema; a missing file yields an empty batch rather than an error.

§Errors

Returns DataFusionError::Execution if rel_name is not a plain file stem (contains path separators or ..), and propagates Parquet / Arrow errors encountered while reading.