MCPcopy
hub / github.com/apache/caldera / create_relationships

Method create_relationships

app/objects/secondclass/c_link.py:262–270  ·  view source on GitHub ↗
(self, relationships, operation)

Source from the content-addressed store, hash-verified

260 return getattr(module, module_type)(module_info)
261
262 async def create_relationships(self, relationships, operation):
263 for relationship in relationships:
264 relationship.origin = operation.id if operation else self.id
265 await self.save_fact(operation, relationship.source, relationship.score, relationship.shorthand)
266 await self.save_fact(operation, relationship.target, relationship.score, relationship.shorthand)
267 if all((relationship.source.trait, relationship.edge)):
268 knowledge_svc_handle = BaseService.get_service('knowledge_svc')
269 await knowledge_svc_handle.add_relationship(relationship)
270 self.relationships.append(relationship)
271
272 async def save_fact(self, operation, fact, score, relationship):
273 knowledge_svc_handle = BaseService.get_service('knowledge_svc')

Callers 4

parseMethod · 0.95
_store_resultsMethod · 0.80

Calls 3

save_factMethod · 0.95
get_serviceMethod · 0.80
add_relationshipMethod · 0.45