Graph storage for entities and relationships
nameGraph name
new()Create a new KnowledgeGraph
KnowledgeGraph$new(name = "default")nameGraph name
add_entity()Add an entity
KnowledgeGraph$add_entity(entity)entityEntity object
add_relationship()Add a relationship
KnowledgeGraph$add_relationship(relationship)relationshipRelationship object
get_entity()Get entity by ID
KnowledgeGraph$get_entity(entity_id)entity_idEntity ID
Entity or NULL
get_all_entities()Get all entities
KnowledgeGraph$get_all_entities()List of Entity objects
get_all_relationships()Get all relationships
KnowledgeGraph$get_all_relationships()List of Relationship objects
get_neighbors()Get neighbors of an entity
KnowledgeGraph$get_neighbors(entity_id, direction = "both")entity_idEntity ID
direction"out", "in", or "both"
List of Entity objects
traverse()Traverse graph from seed entities
KnowledgeGraph$traverse(seed_ids, max_depth = 2)seed_idsStarting entity IDs
max_depthMaximum depth
SubGraph object
entity_count()Get entity count
KnowledgeGraph$entity_count()Integer
relationship_count()Get relationship count
KnowledgeGraph$relationship_count()Integer
search_entities()Search entities by name
KnowledgeGraph$search_entities(query, limit = 10)queryQuery string
limitMax results
List of Entity objects
clone()The objects of this class are cloneable with this method.
KnowledgeGraph$clone(deep = FALSE)deepWhether to make a deep clone.