afs commented on issue #1615:
URL: https://github.com/apache/jena/issues/1615#issuecomment-1312709453
@tpt - thanks for the comments.
In the `OX_LATERAL ?v1 ?v2` those are inputs to the evaluation/ What appens
if the evaluation retuns say `?x` and `?x` is also in the LHS? Does it do an
inner join at that point?
> how to you plan to represents LATERALs in SPARQL S-Expressions?
The current design is to have a operator in the algebra `lateral`. I'll PR a
working branch (it's in my development clone ATM).
While it is related to `sequence` of one or two elements, my preference is
to have a separate operator which can have it's own definition. `sequence` is
specific to the ARQ optimizer and implies certain conditions on its arguments.
> LATERAL is modifying pattern <pattern> evaluation, opposite to e.g.
OPTIONAL, UNION or MINUS
An existing example that is not so different is `FILTER ( NOT EXISTS { ... }
)`.
At the moment, I'm looking to what are the fundamental operations. Is there
one algebra operator needed? For syntax, it may be worth while having syntax
forms for that translate to this/these funamental operations.
May be LATERAL should be `FOREACH`, `EACH`, or `LOOP`. A more direct
statement of what it does in SPARQL++ rather than the technical sense of
"variables flowing laterally into an pattern evaluation".
`FOR { } DO { }` breaks up the query appearance and the sense that it is
adding variable bindings to previous pattern. c.f. `BIND` and `OPTIONAL`. It is
not the style (prefix function) elsewhere and if nested the outer is the last
not the first part.
In PostgreSQL, `LATERAL` seems to be a modifier to one of the join
operations. To some, people, it's not then a join operator but a web search
finds "lateral join" [such
usage](https://docs.snowflake.com/en/sql-reference/constructs/join-lateral.html).
It is still a "combining operator".
In that style, there could be `OPTIONAL LATERAL`, c.f. `LEFT JOIN LATERAL`,
or reversed which IMO reads better in SPARQL, but wouldn't here still be
`LATERAL {...` because in SPARQL `INNER JOIN` is the empty string :-).
It is not a strict functional from (but again, this is not the first in
SPARQL - as well as `EXISTS`, there are several expressions that are not strict
functions; `IF`, `COALESCE`, `BOUND` and some others).
From the point of view of fundamental operations, `LATERAL OPTIONAL` looks
to be the same as `LATERAL { OPTIONAL { ... } }` but its early days and more
investigation necessary.
Do you have some examples we can explore?
If this is the case, and these are common, these can be syntax forms that
translate to the same `lateral` algebra operator.
Digression: It would be nice to have "SELECT-less" (sub)queries: `{ ?s ?p ?o
} LIMIT 1`
But one thing at a time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]