-
Notifications
You must be signed in to change notification settings - Fork 4
Restrict use of SELECT * in queries with implicit grouping. #379
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4042,8 +4042,9 @@ <h4>Projection</h4> | |
| selects all of the variables that are <a href="#variableScope">in-scope</a> at that point | ||
| in the query. It excludes variables only used in <code>FILTER</code>, in the right-hand | ||
| side of <code>MINUS</code>, and takes account of subqueries.</p> | ||
| <p>Use of <code>SELECT *</code> is only permitted when the query does not have a | ||
| <code>GROUP BY</code> clause.</p> | ||
| <p>Use of <code>SELECT *</code> is only permitted when the query does not use grouping | ||
| (either through the use of a <code>GROUP BY</code> clause, or due to the presence of aggregates | ||
| in <code>HAVING</code> or <code>ORDER BY</code> clauses).</p> | ||
| <div class="exampleGroup"> | ||
| <pre class="data nohighlight"> | ||
| PREFIX foaf: <http://xmlns.com/foaf/0.1/> | ||
|
|
@@ -11420,6 +11421,12 @@ <h3>Grammar</h3> | |
| a simple path (an IRI, the keyword `a`, or a variable), | ||
| and not for other path expressions. | ||
| </li> | ||
| <li> | ||
| The use of `*` in a <a href="#rSelectClause">SELECT</a> clause | ||
| is not allowed in a <a href="#rQueryUnit">query</a> containing a <a href="#rGroupClause"><code>GROUP BY</code></a> clause | ||
| or when <a href="#rAggregate">aggregates</a> appear in either <a href="#rHavingClause"><code>HAVING</code></a> or | ||
| <a href="#rOrderClause"><code>ORDER BY</code></a> clauses. | ||
| </li> | ||
| </ol> | ||
|
|
||
| <!-- GRAMMAR --> | ||
|
|
@@ -12884,7 +12891,7 @@ <h2>Changes between SPARQL 1.1 Query Language and SPARQL 1.2 Query Language</h2> | |
| `LANGDIR`, `hasLANG`, hasLANGDIR, and `STRLANGDIR`</li> | ||
| <li>Define parser input as being an | ||
| <a data-cite="RDF12-CONCEPTS#dfn-rdf-string">RDF string</a>. | ||
| Exclude Unicode surrogates from Unicode escape sequences.</li> | ||
| Exclude Unicode surrogates from Unicode escape sequences</li> | ||
| <li>Remove concepts of plain and simple literals, in favor of explicit mentions of `xsd:string`</li> | ||
| <li>Migrate XML Schema references to 1.1. | ||
| Note that for datatypes involving years, the year 1 BCE is represented by `0000` and not as `-0001`. | ||
|
|
@@ -12893,13 +12900,14 @@ <h2>Changes between SPARQL 1.1 Query Language and SPARQL 1.2 Query Language</h2> | |
| for details. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the third complete sentence in this list item. I agree that it should end with a dot. But for consistency, all list items should end with dots, and for best consistency all list items should be written as complete sentences (which I believe most to be already).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TallTed – This has already been merged. A new PR is probably the best approach for the changes you suggested here and above. |
||
| </li> | ||
| <li>Update references to XPath from 2.0 to 3.1</li> | ||
| <li>Define `EBV` as a functional form.</li> | ||
| <li>Forbid duplicated variables in `VALUES`.</li> | ||
| <li>Add in-between term type ORDER BY support for triple terms in <a href="#modOrderBy" class="sectionRef"></a>.</li> | ||
| <li>Fixes the previously informal definition of `EXISTS` by adding a formal definition in <a href="#func-filter-exists" class="sectionRef"></a>, which includes extending the <a href="#defn_eval" class="evalFct">eval</a> function with a solution mapping <var>μ<sub>ctx</sub></var> as third argument.</li> | ||
| <li>Define `EBV` as a functional form</li> | ||
| <li>Forbid duplicated variables in `VALUES`</li> | ||
| <li>Add in-between term type ORDER BY support for triple terms in <a href="#modOrderBy" class="sectionRef"></a></li> | ||
| <li>Fixes the previously informal definition of `EXISTS` by adding a formal definition in <a href="#func-filter-exists" class="sectionRef"></a>, which includes extending the <a href="#defn_eval" class="evalFct">eval</a> function with a solution mapping <var>μ<sub>ctx</sub></var> as third argument</li> | ||
| <li>Rename function `RDFterm-equal` as <a href="#func-sameValue"></a> and | ||
| expand the definition to cover literal arguments of differing datatypes where the | ||
| values are known to be equal or to be not equal.</li> | ||
| values are known to be equal or to be not equal</li> | ||
| <li>Expand the restriction on the use of `*` projection on queries that have implicit grouping</li> | ||
| </ul> | ||
| </li> | ||
| <li> | ||
|
|
@@ -12933,15 +12941,15 @@ <h2>Changes between SPARQL 1.1 Query Language and SPARQL 1.2 Query Language</h2> | |
| as links to their respective definition</li> | ||
| <li>Rename the function used to define the evaluation of property path expressions | ||
| in <a href="#PropertyPathPatterns" class="sectionRef"></a> | ||
| from <i>eval</i> to <i>ppeval</i>.</li> | ||
| from <i>eval</i> to <i>ppeval</i></li> | ||
| <li>Rename the function used within the definition of | ||
| the <a href="#defn_evalALP">ALP</a> function | ||
| from <i>eval</i> to <i>reachableTerms</i>.</li> | ||
| <li>Add section <a href="#sparql-error" class="sectionRef"></a> about SPARQL expression evaluation errors.</li> | ||
| <li>Rename section "Filter evaluation" as <a href="#expression-evaluation" class="sectionRef"></a>.</li> | ||
| from <i>eval</i> to <i>reachableTerms</i></li> | ||
| <li>Add section <a href="#sparql-error" class="sectionRef"></a> about SPARQL expression evaluation errors</li> | ||
| <li>Rename section "Filter evaluation" as <a href="#expression-evaluation" class="sectionRef"></a></li> | ||
| <li>Improve definitions of all algebra operators that involve expressions | ||
| (<a href="#defn_algFilter" class="algFct">Filter</a>, <a href="#defn_algDiff" class="algFct">Diff</a>, | ||
| <a href="#defn_algLeftJoin" class="algFct">LeftJoin</a>, and <a href="#defn_algExtend" class="algFct">Extend</a>).</li> | ||
| <a href="#defn_algLeftJoin" class="algFct">LeftJoin</a>, and <a href="#defn_algExtend" class="algFct">Extend</a>)</li> | ||
| </ul> | ||
| </li> | ||
| <li> | ||
|
|
||
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 believe this should be 2 list items, not 1. On that basis, a dot should be deleted (though I disagree with this practice when (some of) the list items are complete sentences, on which basis some other list items should be edited).
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.
moved to issue #386 and pr #387