Skip to content

Commit

Permalink
$Apply and $Function in Appendix B (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen authored Nov 27, 2023
1 parent 48a734e commit 6e49337
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 32 deletions.
33 changes: 17 additions & 16 deletions docs/odata-csdl-json/odata-csdl-json.html
Original file line number Diff line number Diff line change
Expand Up @@ -2979,8 +2979,8 @@ <h3 id="-add--sub--mul--div--divby-and--mod"><a name="Add21.14" href="#Add21.14"
</div>
<h3 id="1444-apply-client-side-functions"><a name="ApplyClientSideFunctions" href="#ApplyClientSideFunctions">14.4.4 Apply Client-Side Functions</a></h3>
<p>The apply expression enables a value to be obtained by applying a client-side function. The apply expression MAY have operand expressions. The operand expressions are used as parameters to the client-side function.</p>
<section id="-apply" class="varjson rep">
<h3><a name="Apply21.20" href="#Apply21.20"> <code>$Apply</code></a></h3>
<section id="-apply-and--function" class="varjson rep">
<h3><a name="Apply21.20" href="#Apply21.20"> <code>$Apply</code></a> and <a name="Function21.21" href="#Function21.21"> <code>$Function</code></a></h3>
<p>Apply expressions are represented as an object with a member <code>$Apply</code> whose value is an array of annotation expressions, and a member <code>$Function</code> whose value is a string containing the <a href="#QualifiedName">qualified name</a> of the client-side function to be applied.</p>
<p>It MAY contain <a href="#Annotation">annotations</a>.</p>
</section>
Expand Down Expand Up @@ -3073,7 +3073,7 @@ <h4 id="14444-function-odatauriencode"><a name="FunctionodatauriEncode" href="#F
<h3 id="1445-cast"><a name="Cast" href="#Cast">14.4.5 Cast</a></h3>
<p>The cast expression casts the value obtained from its single child expression to the specified type. The cast expression follows the same rules as the <code>cast</code> canonical function defined in <a href="#ODataURL">OData-URL</a>.</p>
<section id="-cast" class="varjson rep">
<h3><a name="Cast21.21" href="#Cast21.21"> <code>$Cast</code></a></h3>
<h3><a name="Cast21.22" href="#Cast21.22"> <code>$Cast</code></a></h3>
<p>Cast expressions are represented as an object with a member <code>$Cast</code> whose value is an annotation expression, a member <code>$Type</code> whose value is a string containing the qualified type name, and optionally a member <code>$Collection</code> with a value of <code>true</code>.</p>
<p>It MAY contain <a href="#Annotation">annotations</a>.</p>
<p>If the specified type is a primitive type or a collection of primitive types, the facet members <a href="#MaxLength"><code>$MaxLength</code></a>, <a href="#Unicode"><code>$Unicode</code></a>, <a href="#Precision"><code>$Precision</code></a>, <a href="#Scale"><code>$Scale</code></a>, and <a href="#SRID"><code>$SRID</code></a> MAY be specified if applicable to the specified primitive type. If the facet members are not specified, their values are considered unspecified.</p>
Expand Down Expand Up @@ -3106,7 +3106,7 @@ <h3 id="1447-if-then-else"><a name="IfThenElse" href="#IfThenElse">14.4.7 If-The
<p>The second and third child expressions are evaluated conditionally. The result MUST be type compatible with the type expected by the surrounding expression.</p>
<p>If the first expression evaluates to <code>true</code>, the second expression MUST be evaluated and its value MUST be returned as the result of the if-then-else expression. If the first expression evaluates to <code>false</code> and a third child element is present, it MUST be evaluated and its value MUST be returned as the result of the if-then-else expression. If no third expression is present, nothing is added to the surrounding collection.</p>
<section id="-if" class="varjson rep">
<h3><a name="If21.22" href="#If21.22"> <code>$If</code></a></h3>
<h3><a name="If21.23" href="#If21.23"> <code>$If</code></a></h3>
<p>Conditional expressions are represented as an object with a member <code>$If</code> whose value is an array of two or three annotation expressions.</p>
<p>It MAY contain <a href="#Annotation">annotations</a>.</p>
</section>
Expand All @@ -3125,7 +3125,7 @@ <h3><a name="If21.22" href="#If21.22"> <code>$If</code></a></h3>
<h3 id="1448-is-of"><a name="IsOf" href="#IsOf">14.4.8 Is-Of</a></h3>
<p>The <code>is-of</code> expression checks whether the value obtained from its single child expression is compatible with the specified type. It returns <code>true</code> if the child expression returns a type that is compatible with the specified type, and <code>false</code> otherwise.</p>
<section id="-isof" class="varjson rep">
<h3><a name="IsOf21.23" href="#IsOf21.23"> <code>$IsOf</code></a></h3>
<h3><a name="IsOf21.24" href="#IsOf21.24"> <code>$IsOf</code></a></h3>
<p>Is-of expressions are represented as an object with a member <code>$IsOf</code> whose value is an annotation expression, a member <code>$Type</code> whose value is a string containing an qualified type name, and optionally a member <code>$Collection</code> with a value of <code>true</code>.</p>
<p>It MAY contain <a href="#Annotation">annotations</a>.</p>
<p>If the specified type is a primitive type or a collection of primitive types, the facet members <a href="#MaxLength"><code>$MaxLength</code></a>, <a href="#Unicode"><code>$Unicode</code></a>, <a href="#Precision"><code>$Precision</code></a>, <a href="#Scale"><code>$Scale</code></a>, and <a href="#SRID"><code>$SRID</code></a> MAY be specified if applicable to the specified primitive type. If the facet members are not specified, their values are considered unspecified.</p>
Expand All @@ -3144,7 +3144,7 @@ <h3 id="1449-labeled-element"><a name="LabeledElement" href="#LabeledElement">14
<p>A labeled element expression MUST contain exactly one child expression. The value of the child expression is also the value of the labeled element expression.</p>
<p>A labeled element expression MUST provide a <a href="#SimpleIdentifier">simple identifier</a> value as its name that MUST be unique within the schema containing the expression.</p>
<section id="-labeledelement" class="varjson rep">
<h3><a name="LabeledElement21.24" href="#LabeledElement21.24"> <code>$LabeledElement</code></a></h3>
<h3><a name="LabeledElement21.25" href="#LabeledElement21.25"> <code>$LabeledElement</code></a></h3>
<p>Labeled element expressions are represented as an object with a member <code>$LabeledElement</code> whose value is an annotation expression, and a member <code>$Name</code> whose value is a string containing the labeled element’s name.</p>
<p>It MAY contain <a href="#Annotation">annotations</a>.</p>
</section>
Expand All @@ -3160,7 +3160,7 @@ <h3><a name="LabeledElement21.24" href="#LabeledElement21.24"> <code>$LabeledEle
<h3 id="14410-labeled-element-reference"><a name="LabeledElementReference" href="#LabeledElementReference">14.4.10 Labeled Element Reference</a></h3>
<p>The labeled element reference expression MUST specify the <a href="#QualifiedName">qualified name</a> of a <a href="#LabeledElement">labeled element expression</a> in scope and returns the value of the identified labeled element expression as its value.</p>
<section id="-labeledelementreference" class="varjson rep">
<h3><a name="LabeledElementReference21.25" href="#LabeledElementReference21.25"> <code>$LabeledElementReference</code></a></h3>
<h3><a name="LabeledElementReference21.26" href="#LabeledElementReference21.26"> <code>$LabeledElementReference</code></a></h3>
<p>Labeled element reference expressions are represented as an object with a member <code>$LabeledElementReference</code> whose value is a string containing an qualified name.</p>
</section>
<div class="varjson example">
Expand All @@ -3179,7 +3179,7 @@ <h3 id="14411-null"><a name="Null" href="#Null">14.4.11 Null</a></h3>
<div class="sourceCode" id="cb93"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb93-1"><a href="#cb93-1" aria-hidden="true" tabindex="-1"></a><span class="er">&quot;@UI.DisplayName&quot;:</span> <span class="er">null,</span></span></code></pre></div>
</div>
<section id="-null" class="varjson rep">
<h3><a name="Null21.26" href="#Null21.26"> <code>$Null</code></a></h3>
<h3><a name="Null21.27" href="#Null21.27"> <code>$Null</code></a></h3>
<p>Null expression containing <a href="#Annotations">annotations</a> are represented as an object with a member <code>$Null</code> whose value is the literal <code>null</code>.</p>
</section>
<div class="varjson example">
Expand Down Expand Up @@ -3235,7 +3235,7 @@ <h3 id="14413-url-reference"><a name="URLReference" href="#URLReference">14.4.13
<p>The URL reference expression MUST contain exactly one expression of type <code>Edm.String</code>. Its value is treated as a URL that MAY be relative or absolute; relative URLs are relative to the URL of the document containing the URL reference expression, or relative to a base URL specified in a format-specific way.</p>
<p>The response body of the <code>GET</code> request MUST be returned as the result of the URL reference expression. The result of the URL reference expression MUST be type compatible with the type expected by the surrounding expression.</p>
<section id="-urlref" class="varjson rep">
<h3><a name="UrlRef21.27" href="#UrlRef21.27"> <code>$UrlRef</code></a></h3>
<h3><a name="UrlRef21.28" href="#UrlRef21.28"> <code>$UrlRef</code></a></h3>
<p>URL reference expressions are represented as an object with a single member <code>$UrlRef</code> whose value is an annotation expression.</p>
<p>It MAY contain <a href="#Annotation">annotations</a>.</p>
</section>
Expand Down Expand Up @@ -3799,13 +3799,14 @@ <h1 id="appendix-b-table-of-json-objects-and-members"><a name="TableofJSONObject
<li><a href="#DivBy21.18"><code>$DivBy</code></a></li>
<li><a href="#Mod21.19"><code>$Mod</code></a></li>
<li><a href="#Apply21.20"><code>$Apply</code></a></li>
<li><a href="#Cast21.21"><code>$Cast</code></a></li>
<li><a href="#If21.22"><code>$If</code></a></li>
<li><a href="#IsOf21.23"><code>$IsOf</code></a></li>
<li><a href="#LabeledElement21.24"><code>$LabeledElement</code></a></li>
<li><a href="#LabeledElementReference21.25"><code>$LabeledElementReference</code></a></li>
<li><a href="#Null21.26"><code>$Null</code></a></li>
<li><a href="#UrlRef21.27"><code>$UrlRef</code></a></li>
<li><a href="#Function21.21"><code>$Function</code></a></li>
<li><a href="#Cast21.22"><code>$Cast</code></a></li>
<li><a href="#If21.23"><code>$If</code></a></li>
<li><a href="#IsOf21.24"><code>$IsOf</code></a></li>
<li><a href="#LabeledElement21.25"><code>$LabeledElement</code></a></li>
<li><a href="#LabeledElementReference21.26"><code>$LabeledElementReference</code></a></li>
<li><a href="#Null21.27"><code>$Null</code></a></li>
<li><a href="#UrlRef21.28"><code>$UrlRef</code></a></li>
</ul></li>
</ul>
</div>
Expand Down
31 changes: 16 additions & 15 deletions docs/odata-csdl-json/odata-csdl-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -4909,7 +4909,7 @@ The operand expressions are used as parameters to the client-side
function.

::: {.varjson .rep}
### <a name="Apply21.20" href="#Apply21.20"> `$Apply`</a>
### <a name="Apply21.20" href="#Apply21.20"> `$Apply`</a> and <a name="Function21.21" href="#Function21.21"> `$Function`</a>

Apply expressions are represented as an object with a member `$Apply`
whose value is an array of annotation expressions, and a member
Expand Down Expand Up @@ -5090,7 +5090,7 @@ rules as the `cast` canonical function defined in
[OData-URL](#ODataURL).

::: {.varjson .rep}
### <a name="Cast21.21" href="#Cast21.21"> `$Cast`</a>
### <a name="Cast21.22" href="#Cast21.22"> `$Cast`</a>

Cast expressions are represented as an object with a member `$Cast`
whose value is an annotation expression, a member `$Type` whose value is
Expand Down Expand Up @@ -5173,7 +5173,7 @@ third expression is present, nothing is added to the surrounding
collection.

::: {.varjson .rep}
### <a name="If21.22" href="#If21.22"> `$If`</a>
### <a name="If21.23" href="#If21.23"> `$If`</a>

Conditional expressions are represented as an object with a member `$If`
whose value is an array of two or three annotation expressions.
Expand Down Expand Up @@ -5208,7 +5208,7 @@ child expression is compatible with the specified type. It returns
the specified type, and `false` otherwise.

::: {.varjson .rep}
### <a name="IsOf21.23" href="#IsOf21.23"> `$IsOf`</a>
### <a name="IsOf21.24" href="#IsOf21.24"> `$IsOf`</a>

Is-of expressions are represented as an object with a member `$IsOf`
whose value is an annotation expression, a member `$Type` whose value is
Expand Down Expand Up @@ -5255,7 +5255,7 @@ identifier](#SimpleIdentifier) value as its name that MUST be unique
within the schema containing the expression.

::: {.varjson .rep}
### <a name="LabeledElement21.24" href="#LabeledElement21.24"> `$LabeledElement`</a>
### <a name="LabeledElement21.25" href="#LabeledElement21.25"> `$LabeledElement`</a>

Labeled element expressions are represented as an object with a member
`$LabeledElement` whose value is an annotation expression, and a member
Expand Down Expand Up @@ -5286,7 +5286,7 @@ in scope and returns the value of the identified labeled element
expression as its value.

::: {.varjson .rep}
### <a name="LabeledElementReference21.25" href="#LabeledElementReference21.25"> `$LabeledElementReference`</a>
### <a name="LabeledElementReference21.26" href="#LabeledElementReference21.26"> `$LabeledElementReference`</a>

Labeled element reference expressions are represented as an object with
a member `$LabeledElementReference` whose value is a string containing
Expand Down Expand Up @@ -5322,7 +5322,7 @@ Example 85:
:::

::: {.varjson .rep}
### <a name="Null21.26" href="#Null21.26"> `$Null`</a>
### <a name="Null21.27" href="#Null21.27"> `$Null`</a>

Null expression containing [annotations](#Annotations) are represented
as an object with a member `$Null` whose value is the literal `null`.
Expand Down Expand Up @@ -5433,7 +5433,7 @@ expression MUST be type compatible with the type expected by the
surrounding expression.

::: {.varjson .rep}
### <a name="UrlRef21.27" href="#UrlRef21.27"> `$UrlRef`</a>
### <a name="UrlRef21.28" href="#UrlRef21.28"> `$UrlRef`</a>

URL reference expressions are represented as an object with a single
member `$UrlRef` whose value is an annotation expression.
Expand Down Expand Up @@ -6072,13 +6072,14 @@ https://openui5.hana.ondemand.com/1.40.10/#docs/guide/87aac894a40640f89920d7b2a4
- [`$DivBy`](#DivBy21.18)
- [`$Mod`](#Mod21.19)
- [`$Apply`](#Apply21.20)
- [`$Cast`](#Cast21.21)
- [`$If`](#If21.22)
- [`$IsOf`](#IsOf21.23)
- [`$LabeledElement`](#LabeledElement21.24)
- [`$LabeledElementReference`](#LabeledElementReference21.25)
- [`$Null`](#Null21.26)
- [`$UrlRef`](#UrlRef21.27)
- [`$Function`](#Function21.21)
- [`$Cast`](#Cast21.22)
- [`$If`](#If21.23)
- [`$IsOf`](#IsOf21.24)
- [`$LabeledElement`](#LabeledElement21.25)
- [`$LabeledElementReference`](#LabeledElementReference21.26)
- [`$Null`](#Null21.27)
- [`$UrlRef`](#UrlRef21.28)
:::

-------
Expand Down
3 changes: 2 additions & 1 deletion odata-csdl/14 Vocabulary and Annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,8 @@ The operand expressions are used as parameters to the client-side
function.

::: {.varjson .rep}
### ##subisec `$Apply`
### ##subisec `$Apply`
and ##subisec `$Function`

Apply expressions are represented as an object with a member `$Apply`
whose value is an array of annotation expressions, and a member
Expand Down

0 comments on commit 6e49337

Please sign in to comment.