KGX CLI

kgx

Knowledge Graph Exchange CLI entrypoint.

kgx [OPTIONS] COMMAND [ARGS]...

Options

--version

Show the version and exit.

graph-summary

Loads and summarizes a knowledge graph from a set of input files.

kgx graph-summary [OPTIONS] INPUTS...

Options

-i, --input-format <input_format>

The input format. Can be one of (‘tsv’, ‘csv’, ‘graph’, ‘json’, ‘jsonl’, ‘obojson’, ‘obo-json’, ‘trapi-json’, ‘neo4j’, ‘nt’, ‘owl’, ‘sssom’) [required]

-c, --input-compression <input_compression>

The input compression type

-o, --output <output>

[required]

-r, --report-type <report_type>

The summary report type. Must be one of (‘kgx-map’, ‘meta-knowledge-graph’)

-f, --report-format <report_format>

The input format. Can be one of (‘yaml’, ‘json’)

-s, --stream

Parse input as a stream

-n, --graph-name <graph_name>

User specified name of graph being summarized (default: ‘Graph’)

--node-facet-properties <node_facet_properties>

A list of node properties from which to generate counts per value for those properties

--edge-facet-properties <edge_facet_properties>

A list of edge properties from which to generate counts per value for those properties

-l, --error-log <error_log>

File within which to report graph data parsing errors (default: “stderr”)

Arguments

INPUTS

Required argument(s)

merge

Load nodes and edges from files and KGs, as defined in a config YAML, and merge them into a single graph. The merged graph can then be written to a local/remote Neo4j instance OR be serialized into a file.

kgx merge [OPTIONS]

Options

--merge-config <merge_config>

[required]

--source <source>

Source(s) from the YAML to process

--destination <destination>

Destination(s) from the YAML to process

-p, --processes <processes>

Number of processes to use

neo4j-download

Download nodes and edges from Neo4j database.

kgx neo4j-download [OPTIONS]

Options

-l, --uri <uri>

Neo4j URI to download from. For example, https://localhost:7474 [required]

-u, --username <username>

Neo4j username [required]

-p, --password <password>

Neo4j password [required]

-o, --output <output>

Output [required]

-f, --output-format <output_format>

The output format. Can be one of (‘tsv’, ‘csv’, ‘graph’, ‘json’, ‘jsonl’, ‘obojson’, ‘obo-json’, ‘trapi-json’, ‘neo4j’, ‘nt’, ‘owl’, ‘sssom’) [required]

-d, --output-compression <output_compression>

The output compression type

-s, --stream

Parse input as a stream

-n, --node-filters <node_filters>

Filters for filtering nodes from the input graph

-e, --edge-filters <edge_filters>

Filters for filtering edges from the input graph

neo4j-upload

Upload a set of nodes/edges to a Neo4j database.

kgx neo4j-upload [OPTIONS] INPUTS...

Options

-i, --input-format <input_format>

The input format. Can be one of (‘tsv’, ‘csv’, ‘graph’, ‘json’, ‘jsonl’, ‘obojson’, ‘obo-json’, ‘trapi-json’, ‘neo4j’, ‘nt’, ‘owl’, ‘sssom’) [required]

-c, --input-compression <input_compression>

The input compression type

-l, --uri <uri>

Neo4j URI to upload to. For example, https://localhost:7474 [required]

-u, --username <username>

Neo4j username [required]

-p, --password <password>

Neo4j password [required]

-s, --stream

Parse input as a stream

-n, --node-filters <node_filters>

Filters for filtering nodes from the input graph

-e, --edge-filters <edge_filters>

Filters for filtering edges from the input graph

Arguments

INPUTS

Required argument(s)

transform

Transform a Knowledge Graph from one serialization form to another.

kgx transform [OPTIONS] [INPUTS]...

Options

-i, --input-format <input_format>

The input format. Can be one of (‘tsv’, ‘csv’, ‘graph’, ‘json’, ‘jsonl’, ‘obojson’, ‘obo-json’, ‘trapi-json’, ‘neo4j’, ‘nt’, ‘owl’, ‘sssom’)

-c, --input-compression <input_compression>

The input compression type

-o, --output <output>

Output

-f, --output-format <output_format>

The output format. Can be one of (‘tsv’, ‘csv’, ‘graph’, ‘json’, ‘jsonl’, ‘obojson’, ‘obo-json’, ‘trapi-json’, ‘neo4j’, ‘nt’, ‘owl’, ‘sssom’)

-d, --output-compression <output_compression>

The output compression type

--stream

Parse input as a stream

-n, --node-filters <node_filters>

Filters for filtering nodes from the input graph

-e, --edge-filters <edge_filters>

Filters for filtering edges from the input graph

--transform-config <transform_config>

Transform config YAML

--source <source>

Source(s) from the YAML to process

-k, --knowledge-sources <knowledge_sources>

A named knowledge source with (string, boolean or tuple rewrite) specification

--infores-catalog <infores_catalog>

Optional dump of a CSV file of InfoRes CURIE to Knowledge Source mappings

-p, --processes <processes>

Number of processes to use

Arguments

INPUTS

Optional argument(s)

validate

Run KGX validator on an input file to check for Biolink Model compliance.

kgx validate [OPTIONS] INPUTS...

Options

-i, --input-format <input_format>

The input format. Can be one of (‘tsv’, ‘csv’, ‘graph’, ‘json’, ‘jsonl’, ‘obojson’, ‘obo-json’, ‘trapi-json’, ‘neo4j’, ‘nt’, ‘owl’, ‘sssom’) [required]

-c, --input-compression <input_compression>

The input compression type

-o, --output <output>

File to write validation reports to

-s, --stream

Parse input as a stream

-b, --biolink-release <biolink_release>

Biolink Model Release (SemVer) used for validation (default: latest Biolink Model Toolkit version)

Arguments

INPUTS

Required argument(s)