koi_net.components.knowledge_handlers.edge_negotiation_handler

Classes

EdgeNegotiationHandler(log, pipeline, ...)

Handles edge negotiation process.

class koi_net.components.knowledge_handlers.edge_negotiation_handler.EdgeNegotiationHandler(log, pipeline, identity, cache, event_queue, kobj_queue)[source]

Bases: KnowledgeHandler

Handles edge negotiation process.

Automatically approves proposed edges if they request RID types this node can provide (or KOI node, edge RIDs). Validates the edge type is allowed for the node type (partial nodes cannot use webhooks). If edge is invalid, a FORGET event is sent to the other node.

Parameters:
cache: Cache
event_queue: EventQueue
event_types: tuple[EventType | None] = (EventType.NEW, EventType.UPDATE)
handle(kobj)[source]
Parameters:

kobj (KnowledgeObject)

handler_type: HandlerType = 'bundle'
identity: NodeIdentity
kobj_queue: KobjQueue
rid_types: tuple[RIDType] = (<RIDType 'orn:koi-net.edge'>,)