(
record_attributes: list[str],
chunk_key: str,
)
| 322 | |
| 323 | |
| 324 | async def _handle_single_relationship_extraction( |
| 325 | record_attributes: list[str], |
| 326 | chunk_key: str, |
| 327 | ): |
| 328 | if len(record_attributes) < 5 or record_attributes[0] != '"relationship"': |
| 329 | return None |
| 330 | # add this record as edge |
| 331 | source = clean_str(record_attributes[1].upper()) |
| 332 | target = clean_str(record_attributes[2].upper()) |
| 333 | edge_description = clean_str(record_attributes[3]) |
| 334 | edge_source_id = chunk_key |
| 335 | weight = ( |
| 336 | float(record_attributes[-1]) if is_float_regex(record_attributes[-1]) else 1.0 |
| 337 | ) |
| 338 | return dict( |
| 339 | src_id=source, |
| 340 | tgt_id=target, |
| 341 | weight=weight, |
| 342 | description=edge_description, |
| 343 | source_id=edge_source_id, |
| 344 | ) |
| 345 | |
| 346 | |
| 347 | class ClusteringAlgorithm(ABC): |
nothing calls this directly
no test coverage detected