-
Notifications
You must be signed in to change notification settings - Fork 2
Definitions for Values Insertion #177
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
base: main
Are you sure you want to change the base?
Conversation
spec/index.html
Outdated
This applies to `BIND`, variables introduced by `AS` in a `SELECT` clause, variables in a `VALUES` | ||
clause, and variables intrucded by `AS` in `GROUP BY`. | ||
Extend the "in-scope" rules to include the variables in-scope from the current row: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p>Extend the "in-scope" rules to include the variables in-scope from the current row:p> | |
<p>Extend the "in-scope" rules to include the variables that are in-scope for the current row:p> |
spec/index.html
Outdated
|
||
A variable inside a project expression that is not in the variables projected | ||
is not affected by the values insertion operation because it is renamed apart. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is not affected by the values insertion operation because it is renamed apart. | |
is not affected by the value insertion operation because it is renamed apart. |
Values Insertion and `EXISTS` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Values Insertion
reads very oddly to me. Can this be changed (throughout) to Value Insertion
?
<section> | |
<h3>Values Insertion and `EXISTS`h3> | |
<section> | |
<h3>Value Insertion and `EXISTS`h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is inserting multiple values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you use an "eggs beater" or an "egg beater"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In US English, if not global English, the common phrasing for such things uses the singular — "rule book" (not "rules book"), "tool box" (not "tools box"), "book shelf" (not "books shelf").
Also, is this only and always "inserting multiple values", or can it be "inserting a single value"?
spec/index.html
Outdated
|
||
Definition: Values Insertion | ||
Define the Values Insertion function `ValuesInsert(X, μ)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If, as I suggested above, Values Insertion
is being changed to Value Insertion
, then ValuesInsert
should likewise be changed to ValueInsert
Define the Values Insertion function `ValuesInsert(X, μ)` | |
Define the Value Insertion function `ValueInsert(X, μ)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is in algebra space, the syntax analogy is VALUES
.
The μ can have several bindings, correlating several variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not simply InsertValues
?
exists(X) = true |
||
if eval( D(G), ValuesInsert(PrjMap(X), μ) ) | ||
is a non-empty solution sequence. | ||
exists(X) = false otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exists(X) = false otherwisepre> | |
Otherwise, exists(X) = false.pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The style here is that for function definition, with each case being aligned. It is not running text.
0818131
to
95b4b0a
Compare
c00cb1b
to
a0ccbd5
Compare
In my view "values insertion" is the correct phrase to use. |
a partial mapping `F` from | ||
`V`, | ||
the set of all variables, to `V` where: | ||
F(v) = v1 if v is in PV, where v1 is a fresh variable |
||
F(v) = v if v is not in PV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering the second line of this definition, it seems to me that F
is actually not partial.
If I am wrong with this assumption, can you explain which variables are mapped by F
and which ones are not.
The Projection Expression Variable Remapping yields an algrebra expression that | ||
evaluates to the same results as the Project argument. No variable of `ProjectMap(Project(A, PV))` | ||
that is not in `PV` is mentioned anywhere else in the algebra expression for the query. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's true based on the current version of this definition. By the current definition, the projection variables are renamed from A
to A1
, but not in PV
. As a consequence, the evaluation of A1
will not even produce bindings for the projection variables.
Is it possible that you have a mistake in the earlier part of this definition? In particular, I have the feeling that the first line of the definition of F
should have been as follows.
F(v) = v1 if v is mentioned in A but is not in PV , where v1 is a fresh variable
PrjMap(X) = replace all project operations Project(P, PV) |
||
with ProjectMap(P, PV) for each projection in X. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the ProjectMap(P, PV)
here actually meant to be ProjectMap( Project(P, PV) )
as introduced in the previous definition? If not, how is ProjectMap(P, PV)
defined?
if eval( D(G), ValuesInScope(PrjMap(X)), μ) | ||
is a non-empty solution sequence. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is ValuesInScope( .. )
? Where is this defined?
No matter how it is defined, there is another problem here. The formula uses the eval function with three arguments: i) D(G)
, ii) the output of ValuesInScope( .. )
, whatever that might be, and iii) some solution mapping μ. Yet, eval is not defined for such arguments; it is defined for two arguments: i) D(G)
and ii) an algebraic expression.
Replace each occurence of `Y` in X where `Y` is one of | ||
Basic Graph Pattern, | ||
Property Path Expression, | ||
`Graph(Var, pattern)`, | ||
Inline Data | ||
with `join(Y, BindingInScope())`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- What is X?
- Instead of Property Path Expression, do you actually mean Property Path Pattern?
I note that this PR is for deep values insertion where values are insterted into subqueries. |
Define the function `BindingInScope()`. | ||
Evaluation of `BindingInScope()` results in a table of one row, | ||
being the current binding of the enclosing filter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXIST can be used not only within FILTER.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bind, select expression, order by…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only variables are "in-scope" are affected. This query has a sub-query that exposes SELECT * {
?s :p ?o .
FILTER EXISTS{ SELECT ?o { :s :q ?o }} whereas the inner SELECT * {
?s :p ?o .
FILTER EXISTS{ SELECT ?s { ?s :q :?o }} is not correlated. As algebra expressions: SELECT * {
?s :p ?o .
FILTER EXISTS { SELECT * { ?s :q ?z} } SELECT * {
?s :p ?o .
FILTER EXISTS { ?s :q :?z } are the same. |
A replacement for
substitute
.The context is taken from SEP-0007.
Currently, all new material is in a single section.
I am submitting this PR to put the content under the WG agreement for IP and Licensing.
Preview | Diff