Skip to content

Merge Graphs

merge_graphs

The merge-graphs command.

Functions:

  • merge_graphs_cmd –

    Merge multiple graphs into a single PDG with edge probabilities.

merge_graphs_cmd

merge_graphs_cmd(
    inputs: Tuple[str, ...],
    output: str,
    filter_expr: Optional[str],
    weights: Optional[str],
    cpdag: bool,
    strategy: str,
) -> None

Merge multiple graphs into a single PDG with edge probabilities.

Reads GraphML files (.graphml) and/or WorkflowCache databases (.db) and combines them into a Probabilistic Dependency Graph (PDG) using the specified merge strategy.

Input type is auto-detected by file extension: - .graphml: Read as GraphML file (filter/weights not applicable) - .db: Read the graphml object from cache entries (filter/weights apply)

Example

causaliq-analysis merge-graphs -i graph1.graphml -i graph2.graphml \ -o merged.graphml

causaliq-analysis merge-graphs -i results.db \ -f "network == 'asia' and sample_size > 500" \ -o merged.graphml

causaliq-analysis merge-graphs -i results.db -w weights.json \ -o merged.graphml --cpdag

causaliq-analysis merge-graphs -i results.db \ --strategy noisy_or -o merged.graphml