Skip to content

[#212] Implementation of CHAIN operator in pattern matching query#1049

Merged
andre-senna merged 18 commits intomasterfrom
senna-212-1
Mar 5, 2026
Merged

[#212] Implementation of CHAIN operator in pattern matching query#1049
andre-senna merged 18 commits intomasterfrom
senna-212-1

Conversation

@andre-senna
Copy link
Contributor

@andre-senna andre-senna commented Mar 4, 2026

WIP towards #212

Still missing the integration of the operator with the query parse. I.e. for now, it's not possible to use the query client or MeTTa to put CHAIN operators in query. This PR covers only the implementation of the QueryElement.

The idea of this operator is to allow the caller to search for a chain of links connecting a SOURCE to a TARGET. This is another operator to be used in a query (like AND, OR etc). Whenever a CHAIN operator appears in a query tree (together with a SOURCE and a TARGET parameters) the operator will use its input to search for paths connecting SOURCE and TARGET.

Paths are passed through to the next query element in the query tree in QueryAnswers with N handles meaning a path of size N where source is the first handle and target is the last one.

Depending on an optional parameter, incomplete paths (connected only to either the source or the target) are also forwarded.

Paths are searched in a combinatorial fashion but STI is used to direct the search through the search space in a way that paths with the largest STI are searched and reported earlier.

In this version, the input links are supposed to be ternary. Something like (Similarty $v1 $v2). Actually, the first target (Similarituy in this example) is totally disregarded.

@andre-senna andre-senna changed the title [#212] Implementation of CHAIN operator in pattern mining query [#212] Implementation of CHAIN operator in pattern matching query Mar 4, 2026
@andre-senna andre-senna merged commit 89842fd into master Mar 5, 2026
2 checks passed
@andre-senna andre-senna deleted the senna-212-1 branch March 5, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants