Skip to content

STAMQL: Allow multiple subqueries #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
proycon opened this issue Jul 23, 2024 · 0 comments
Closed

STAMQL: Allow multiple subqueries #28

proycon opened this issue Jul 23, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request ready Implemented, pending release
Milestone

Comments

@proycon
Copy link
Collaborator

proycon commented Jul 23, 2024

Currently a query only allows a single subquery. This was done to ensure all
variables in the results are always bound.

Having multiple subqueries means a combinatorial 'explosion' in the result set.
Given a query (A) and subqueries (X,Y,Z) where X in turn has subqueries (C,D).
We have the following hierarchy:

?A
    ?X
        ?C
        ?D
    ?Y
    ?Z

The result row binds not just a single set of variables now but differs according to the subquery path:

?A * ?X * ?C
?A * ?X * ?D
?A * ?Y
?A * ?Z

Say ?A yields a,b,c and ?Z yields p,q, then for the last bindings alone we get six results:

a p
a q
b p
b q
c p
c q

In spite of the combinatorial explosion, having multiple subqueries may give
necessary flexibility. Most notably, I think we can do away with the concept of
'highlight queries' in visualisation then, as subqueries can take over that role.

@proycon proycon self-assigned this Jul 23, 2024
@proycon proycon added the enhancement New feature or request label Jul 23, 2024
@proycon proycon added this to the v1.1 milestone Jul 23, 2024
proycon added a commit that referenced this issue Jul 25, 2024
proycon added a commit to annotation/stam-rust that referenced this issue Jul 26, 2024
Rather than have just one subquery, multiple will be supported,
separated by a | in the query syntax. This does lead to a combinatorial
explosion, especially if deeply nested and means that not all variables
will be found in the results at all times. It depends on the branch that
is being executed.

Reference: annotation/stam#28
proycon added a commit to annotation/stam-rust that referenced this issue Jul 26, 2024
@proycon proycon added the ready Implemented, pending release label Jul 26, 2024
proycon added a commit to annotation/stam-rust that referenced this issue Jul 26, 2024
Things weren't quite right yet.
The QueryPath representation changed a bit too

Reference: annotation/stam#28
@proycon proycon closed this as completed Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready Implemented, pending release
Projects
None yet
Development

No branches or pull requests

1 participant