(entities: Entity[])
| 117 | } |
| 118 | |
| 119 | async createEntities(entities: Entity[]): Promise<Entity[]> { |
| 120 | const graph = await this.loadGraph(); |
| 121 | const newEntities = entities.filter(e => !graph.entities.some(existingEntity => existingEntity.name === e.name)); |
| 122 | graph.entities.push(...newEntities); |
| 123 | await this.saveGraph(graph); |
| 124 | return newEntities; |
| 125 | } |
| 126 | |
| 127 | async createRelations(relations: Relation[]): Promise<Relation[]> { |
| 128 | const graph = await this.loadGraph(); |
no test coverage detected