MCPcopy Create free account
hub / github.com/cosdata/cosdata / relationship_inference

Function relationship_inference

org/src/cosql.rs:489–517  ·  view source on GitHub ↗
(input: &str)

Source from the content-addressed store, hash-verified

487}
488
489fn relationship_inference(input: &str) -> IResult<&str, Inference> {
490 map(
491 tuple((
492 delimited(
493 ws(char('(')),
494 separated_list1(ws(char(',')), preceded(char('$'), identifier)),
495 ws(char(')')),
496 ),
497 ws(tag("forms")),
498 ws(identifier),
499 opt(delimited(
500 ws(char('(')),
501 separated_list0(ws(char(',')), attribute_value),
502 ws(char(')')),
503 )),
504 )),
505 |(roles, _, relationship_type, attributes)| Inference::RelationshipInference {
506 roles: roles
507 .into_iter()
508 .map(|r| RoleAssignment {
509 role: r.to_string(),
510 entity: r.to_string(),
511 })
512 .collect(),
513 relationship_type: relationship_type.to_string(),
514 attributes: attributes.unwrap_or_default(),
515 },
516 )(input)
517}
518
519fn extend_entity_inference(input: &str) -> IResult<&str, Inference> {
520 map(

Callers

nothing calls this directly

Calls 1

wsFunction · 0.70

Tested by

no test coverage detected