(relations: Relation[])
| 170 | } |
| 171 | |
| 172 | async deleteRelations(relations: Relation[]): Promise<void> { |
| 173 | const graph = await this.loadGraph(); |
| 174 | graph.relations = graph.relations.filter(r => !relations.some(delRelation => |
| 175 | r.from === delRelation.from && |
| 176 | r.to === delRelation.to && |
| 177 | r.relationType === delRelation.relationType |
| 178 | )); |
| 179 | await this.saveGraph(graph); |
| 180 | } |
| 181 | |
| 182 | async readGraph(): Promise<KnowledgeGraph> { |
| 183 | return this.loadGraph(); |
no test coverage detected