Managing the knowledge graph with the R2R CLI.

Knowledge Graph Management

Create Graph

Create a knowledge graph for a collection using the create-graph command:

$r2r create-graph --collection-id my-collection --run --kg-creation-settings '{"key": "value"}' --force-kg-creation

Deduplicate Entities

Deduplicate entities in a collection using the deduplicate-entities command:

$r2r deduplicate-entities --collection-id my-collection --run --deduplication-settings '{"key": "value"}'

Enrich Graph

Enrich an existing knowledge graph using the enrich-graph command:

$r2r enrich-graph --collection-id my-collection --run --force-kg-enrichment --kg-enrichment-settings '{"key": "value"}'

Get Entities

Retrieve entities from the knowledge graph using the get-entities command:

$r2r get-entities --collection-id my-collection --offset 0 --limit 10 --entity-ids entity1 entity2

Get Triples

Retrieve triples from the knowledge graph using the get-triples command:

$r2r get-triples --collection-id my-collection --offset 0 --limit 10 --triple-ids triple1 triple2 --entity-names entity1 entity2

Delete Graph

Delete the graph for a collection using the delete-graph command:

$r2r delete-graph --collection-id my-collection --cascade