INNER CODE UNIT · Python

export_jsonld_cmd

yifanfeng97/Hyper-Extract · hyperextract/cli/cli.py:675

def export_jsonld_cmd(
    ka_path: str = typer.Argument(..., help="Knowledge Abstract directory"),
    output: str = typer.Option(..., "--output", "-o", help="Output JSON-LD file"),
    force: bool = typer.Option(
        False, "--force", "-f", help="Overwrite an existing JSON-LD file"
    ),
):
    """Export a knowledge graph to JSON-LD.

    Binary edges are `@type: Edge` with source/target. Edges with three
    or more endpoints are `@type: Hyperedge` with an endpoint list.
    """
    from hyperextract.utils.exporters.common import resolve_export_file
    from hyperextract.utils.exporters.ka import GraphTypeError, export_ka_jsonld

    logger.info("command=export-jsonld ka_path=%s output=%s", ka_path, output)

    output_path = Path(output)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…