Skip to content

Commit

Permalink
Vocabulary Links
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Sep 9, 2024
1 parent 6d43233 commit 4bc32ab
Show file tree
Hide file tree
Showing 23 changed files with 124 additions and 121 deletions.
20 changes: 10 additions & 10 deletions docs/odata-data-aggregation-ext/odata-data-aggregation-ext.html
Original file line number Diff line number Diff line change
Expand Up @@ -1639,7 +1639,7 @@ <h3 id="311-type-structure-and-context-url"><a id="TypeStructureandContextURL" h
<li>During <a href="#Transformationconcat">concatenation</a>, the same instances are transformed multiple times and the output sets with their potentially different structures are concatenated.</li>
</ul>
<p>An output set thus consists of instances with different structures. This is the same situation as with a collection of an open type <a href="$$$OData-CSDL$$$#OpenEntityType">OData-CSDL, sections “Open Entity Type”</a> and ["Open Complex Type"]($$$OData-CSDL$$$#OpenComplexType) and it is handled in the same way.</p>
<p>If the first input set is a collection of entities from a given entity set, then so are all input sets and output sets in the transformation sequence. The <code>{select-list}</code> in the context URL <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#ContextURL">OData-Protocol, section “Context URL”</a> MUST describe only properties that are present or annotated as absent (for example, if <code>Core.Permissions</code> is <code>None</code> <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#RequestingIndividualEntities">OData-Protocol, section “Requesting Individual Entities”</a>) in all instances of the collection, after applying any <code>$select</code> and <code>$expand</code> system query options. The <code>{select-list}</code> SHOULD describe as many such properties as possible, even if the request involves a concatenation that leads to a non-homogeneous structure. If the server cannot determine any such properties, the <code>{select-list}</code> MUST consist of just the instance annotation <code>AnyStructure</code> defined in the <code>Core</code> vocabulary <a href="#ODataVocCore">OData-VocCore</a>. (See <a href="#anystructure">example 75</a>.)</p>
<p>If the first input set is a collection of entities from a given entity set, then so are all input sets and output sets in the transformation sequence. The <code>{select-list}</code> in the context URL <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#ContextURL">OData-Protocol, section “Context URL”</a> MUST describe only properties that are present or annotated as absent (for example, if <code>Core.Permissions</code> is <code>None</code> <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#RequestingIndividualEntities">OData-Protocol, section “Requesting Individual Entities”</a>) in all instances of the collection, after applying any <code>$select</code> and <code>$expand</code> system query options. The <code>{select-list}</code> SHOULD describe as many such properties as possible, even if the request involves a concatenation that leads to a non-homogeneous structure. If the server cannot determine any such properties, the <code>{select-list}</code> MUST consist of just the instance annotation <code>AnyStructure</code> defined in the <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#AnyStructure"><code>Core</code> vocabulary</a>. (See <a href="#anystructure">example 75</a>.)</p>
</details>
<details open><summary>
<h3 id="312-sameness-and-order"><a id="SamenessandOrder" href="#SamenessandOrder">3.1.2 Sameness and Order</a></h3>
Expand Down Expand Up @@ -2843,7 +2843,7 @@ <h3 id="552-recursive-hierarchy"><a id="RecursiveHierarchy" href="#RecursiveHier
<details open><summary>
<h4 id="5521-hierarchy-functions"><a id="HierarchyFunctions" href="#HierarchyFunctions">5.5.2.1 Hierarchy Functions</a></h4>
</summary>
<p>For testing the position of a given entity in a recursive hierarchy, the Aggregation vocabulary <a href="#ODataVocAggr">OData-VocAggr</a> defines unbound functions. These have</p>
<p>For testing the position of a given entity in a recursive hierarchy, the <code>Aggregation</code> vocabulary <a href="#ODataVocAggr">OData-VocAggr</a> defines unbound functions. These have</p>
<ul>
<li>a parameter pair <code>HierarchyNodes</code>, <code>HierarchyQualifier</code> where <code>HierarchyNodes</code> is a collection and <code>HierarchyQualifier</code> is the qualifier of a <code>RecursiveHierarchy</code> annotation on its common entity type. The node identifiers in this collection define the recursive hierarchy.</li>
<li>a parameter <code>Node</code> that contains the node identifier of the entity to be tested. Note that the test result depends only on this node identifier, not on any other property of the given entity</li>
Expand All @@ -2852,12 +2852,12 @@ <h4 id="5521-hierarchy-functions"><a id="HierarchyFunctions" href="#HierarchyFun
</ul>
<p>The following functions are defined:</p>
<ul>
<li><code>isnode</code> tests if the given entity is a node of the hierarchy.</li>
<li><code>isroot</code> tests if the given entity is a root node of the hierarchy.</li>
<li><code>isdescendant</code> tests if the given entity is a descendant with maximum distance <code>MaxDistance</code> of an ancestor node (whose node identifier is given in a parameter <code>Ancestor</code>), or equals the ancestor if <code>IncludeSelf</code> is true.</li>
<li><code>isancestor</code> tests if the given entity is an ancestor with maximum distance <code>MaxDistance</code> of a descendant node (whose node identifier is given in a parameter <code>Descendant</code>), or equals the descendant if <code>IncludeSelf</code> is true.</li>
<li><code>issibling</code> tests if the given entity and another entity (whose node identifier is given in a parameter <code>Other</code>) are sibling nodes.</li>
<li><code>isleaf</code> tests if the given entity is a leaf node.</li>
<li><a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md#isnode"><code>isnode</code></a> tests if the given entity is a node of the hierarchy.</li>
<li><a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md#isroot"><code>isroot</code></a> tests if the given entity is a root node of the hierarchy.</li>
<li><a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md#isdescendant"><code>isdescendant</code></a> tests if the given entity is a descendant with maximum distance <code>MaxDistance</code> of an ancestor node (whose node identifier is given in a parameter <code>Ancestor</code>), or equals the ancestor if <code>IncludeSelf</code> is true.</li>
<li><a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md#isancestor"><code>isancestor</code></a> tests if the given entity is an ancestor with maximum distance <code>MaxDistance</code> of a descendant node (whose node identifier is given in a parameter <code>Descendant</code>), or equals the descendant if <code>IncludeSelf</code> is true.</li>
<li><a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md#issibling"><code>issibling</code></a> tests if the given entity and another entity (whose node identifier is given in a parameter <code>Other</code>) are sibling nodes.</li>
<li><a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md#isleaf"><code>isleaf</code></a> tests if the given entity is a leaf node.</li>
</ul>
<p>Another function <code>rollupnode</code> is defined that can only be used in connection with <a href="#Groupingwithrolluprecursive"><code>rolluprecursive</code></a>.</p>
</details>
Expand Down Expand Up @@ -3248,7 +3248,7 @@ <h4 id="6221-standard-case-of-traverse"><a id="StandardCaseoftraverse" href="#St
<h4 id="6222-general-case-of-traverse"><a id="GeneralCaseoftraverse" href="#GeneralCaseoftraverse">6.2.2.2 General Case of <code>traverse</code></a></h4>
</summary>
<p>In the general case, the recursive algorithm can reach a node <span class="math inline">\(x\)</span> multiple times, via different parents or ancestors, or because <span class="math inline">\(x\)</span> is a start node and a descendant of another start node. Then the algorithm computes <span class="math inline">\(R(x)\)</span> and hence <span class="math inline">\(σ(x)\)</span> multiple times. In order to distinguish these computation results, information about the ancestors up to the start node is injected into each <span class="math inline">\(σ(x)\)</span> by annotating <span class="math inline">\(x\)</span> differently before each <span class="math inline">\(σ(x)\)</span> is computed. On the other hand, certain nodes can be unreachable from any start node, these are called orphans of the traversal (see <a href="#weight">example 117</a>).</p>
<p>More precisely, in the general case every node <span class="math inline">\(y\)</span> is annotated with the term <code>UpPath</code> from the <code>Aggregation</code> vocabulary <a href="#ODataVocAggr">OData-VocAggr</a>. The annotation has <span class="math inline">\(Q\)</span> as qualifier and the annotation value is a collection of string values of node identifiers. The first member of that collection is the node identifier of the parent node <span class="math inline">\(x\)</span> such that <span class="math inline">\(R(y)\)</span> appears on the right-hand side of the recursive formula for <span class="math inline">\(R(x)\)</span>. The following members are the members of the <code>Aggregation.UpPath</code> collection of <span class="math inline">\(x\)</span>. Every instance in the output set of <code>traverse</code> is related to one node with <code>Aggregation.UpPath</code> annotation. Start nodes appear annotated with an empty collection.</p>
<p>More precisely, in the general case every node <span class="math inline">\(y\)</span> is annotated with the term <code>UpPath</code> from the <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md#UpPath"><code>Aggregation</code> vocabulary</a>. The annotation has <span class="math inline">\(Q\)</span> as qualifier and the annotation value is a collection of string values of node identifiers. The first member of that collection is the node identifier of the parent node <span class="math inline">\(x\)</span> such that <span class="math inline">\(R(y)\)</span> appears on the right-hand side of the recursive formula for <span class="math inline">\(R(x)\)</span>. The following members are the members of the <code>Aggregation.UpPath</code> collection of <span class="math inline">\(x\)</span>. Every instance in the output set of <code>traverse</code> is related to one node with <code>Aggregation.UpPath</code> annotation. Start nodes appear annotated with an empty collection.</p>
<div class="example">
<p>⚠ Example 64: A sales organization <a href="#weight">Atlantis</a> with two parents US and EMEA would occur twice in the result of a <code>traverse</code> transformation:</p>
<pre><code>GET /service/SalesOrganizations?$apply=
Expand Down Expand Up @@ -3354,7 +3354,7 @@ <h2 id="63-grouping-with-rolluprecursive"><a id="Groupingwithrolluprecursive" hr
<span id="cb115-17"><a href="#cb115-17" aria-hidden="true" tabindex="-1"></a> <span class="ot">]</span></span>
<span id="cb115-18"><a href="#cb115-18" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
</div>
<p>The value of the property <span class="math inline">\(χ_N\)</span> in the <code>rolluprecursive</code> algorithm is the node <span class="math inline">\(x\)</span> at recursion level <span class="math inline">\(N\)</span>. In a common expression, <span class="math inline">\(χ_N\)</span> cannot be accessed by its name, but can only be read as the return value of the unbound function <span class="math inline">\({\tt rollupnode}({\tt Position}=N)\)</span> defined in the <code>Aggregation</code> vocabulary <a href="#ODataVocAggr">OData-VocAggr</a>, with <span class="math inline">\(1≤N≤M\)</span>, and only during the application of the transformation sequence <span class="math inline">\(T\)</span> in the formula for <span class="math inline">\(R(x)\)</span> above (the function is undefined otherwise). If <span class="math inline">\(N=1\)</span>, the <code>Position</code> parameter can be omitted.</p>
<p>The value of the property <span class="math inline">\(χ_N\)</span> in the <code>rolluprecursive</code> algorithm is the node <span class="math inline">\(x\)</span> at recursion level <span class="math inline">\(N\)</span>. In a common expression, <span class="math inline">\(χ_N\)</span> cannot be accessed by its name, but can only be read as the return value of the unbound function <span class="math inline">\({\tt rollupnode}({\tt Position}=N)\)</span> defined in the <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Aggregation.V1.md#rollupnode"><code>Aggregation</code> vocabulary</a>, with <span class="math inline">\(1≤N≤M\)</span>, and only during the application of the transformation sequence <span class="math inline">\(T\)</span> in the formula for <span class="math inline">\(R(x)\)</span> above (the function is undefined otherwise). If <span class="math inline">\(N=1\)</span>, the <code>Position</code> parameter can be omitted.</p>
<div class="example">
<p>⚠ Example <a id="rollupnode" href="#rollupnode">66</a>: Total sales amounts per organization, both including and excluding sub-organizations, in the US sub-hierarchy defined in <a href="#HierarchyExamples">Hierarchy Examples</a> with <span class="math inline">\(p=p&#39;/q={\tt SalesOrganization}/{\tt ID}\)</span> and <span class="math inline">\(p&#39;={\tt SalesOrganization}\)</span> (case 2 of the <a href="#Transformationtraverse">definition</a> of <span class="math inline">\(σ(x)\)</span>). The Boolean expression <span class="math inline">\(p&#39;\hbox{\tt\ eq Aggregation.rollupnode}()\)</span> is true for sales in the organization for which the aggregate is computed, but not for sales in sub-organizations.</p>
<pre><code>GET /service/Sales?$apply=groupby(
Expand Down
Loading

0 comments on commit 4bc32ab

Please sign in to comment.