Skip to content
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

Bound actions and function overloads via container and structured type #233

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9c937e0
Bound actions and function overloads via container
HeikoTheissen Jan 11, 2024
8ab36ad
@ralfhandl's suggestions
HeikoTheissen Jan 11, 2024
1680d8e
Actions/Functions bound to a property via structured type
HeikoTheissen Jan 13, 2024
edaf880
Rephrased
HeikoTheissen Jan 15, 2024
c858774
style
HeikoTheissen Jan 15, 2024
cbd551c
@ralfhandl's suggestions
HeikoTheissen Jan 15, 2024
419986c
Action/Function via complex or entity type
HeikoTheissen Jan 15, 2024
584f5fd
Rephrased
HeikoTheissen Jan 15, 2024
8ab0389
Rephrased again
HeikoTheissen Jan 15, 2024
728c907
Fine-tuning
HeikoTheissen Jan 15, 2024
ffb1079
Parameters and return types
HeikoTheissen Jan 15, 2024
48dc875
Merge branch 'main' into ODATA-1626
HeikoTheissen Jan 18, 2024
d522e99
Explain "addressed via resource path"
HeikoTheissen Jan 18, 2024
2c63eb7
Rephrased
HeikoTheissen Jan 18, 2024
99fa5de
Fine-tuning
HeikoTheissen Jan 18, 2024
36ce19c
Redefine the "Property via structured type" case
HeikoTheissen Jan 19, 2024
3a76fca
Merge branch 'main' into ODATA-1626
ralfhandl Jan 26, 2024
fcfd147
Merge branch 'main' into ODATA-1626
ralfhandl Feb 1, 2024
dda4091
Merge branch 'main' into ODATA-1626
ralfhandl Feb 5, 2024
ca3bdea
Merge branch 'main' into ODATA-1626
ralfhandl Feb 15, 2024
528b59e
Merge branch 'main' into ODATA-1626
ralfhandl Feb 22, 2024
21159e2
Merge branch 'main' into ODATA-1626
ralfhandl Feb 29, 2024
6061f24
Merge remote-tracking branch 'origin/main' into ODATA-1626
HeikoTheissen Jul 11, 2024
e405cda
Merge branch 'ODATA-1626' of [email protected]:oasis-tcs/odata-specs.git
HeikoTheissen Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 67 additions & 7 deletions docs/odata-csdl-json/odata-csdl-json.html
Original file line number Diff line number Diff line change
Expand Up @@ -410,26 +410,31 @@ <h2 id="11-changes-from-earlier-versions"><a name="ChangesfromEarlierVersions" h
<td></td>
</tr>
<tr class="even">
<td><a href="#Target">Section 14.2.2</a></td>
<td>External targeting of bound action/function overloads via container or structured type</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/393">393</a></td>
</tr>
<tr class="odd">
<td><a href="#GeoValues">Section 14.3.13</a></td>
<td>Constant Geo values in annotations</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/654">654</a></td>
</tr>
<tr class="odd">
<tr class="even">
<td><a href="#StreamValues">Section 14.3.14</a></td>
<td>Constant Stream values in annotations</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/654">654</a></td>
</tr>
<tr class="even">
<tr class="odd">
<td><a href="#PathEvaluation">Section 14.4.1.2</a></td>
<td>New path evaluation rules for annotations targeting annotations and external targeting via container</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/575">575</a></td>
</tr>
<tr class="odd">
<tr class="even">
<td><a href="#IfThenElse">Section 14.4.7</a></td>
<td>Nested <code>If</code> without else part in collections</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/326">326</a></td>
</tr>
<tr class="even">
<tr class="odd">
<td><a href="#Conformance">Section 17</a></td>
<td>Additional conformance clauses for version 4.02</td>
<td></td>
Expand Down Expand Up @@ -2581,8 +2586,8 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
<thead>
<tr class="header">
<th>Model element</th>
<th>External targeting syntax</th>
<th><div class="example"><p>Example 42: Target expressions</p></div></th>
<th>Can be targeted with path expression (see also <a href="#PathSyntax">section 14.4.1.1</a>)</th>
<th><div class="example"><p style="margin-top:0">Example 42: Target expressions</p></div></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -2674,7 +2679,7 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
<tr class="even">
<td><a href="#StructuralProperty">Property</a> via container</td>
<td>qualified name of entity container followed by a segment containing a singleton or entity set name and zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast</td>
<td><pre><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MySchema.MyEntityType/MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyComplexProperty/MyProperty</code></pre></td>
<td><pre><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MySchema.MyEntityType/MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyComplexProperty/MyProperty</code></pre></td>
</tr>
<tr class="odd">
<td><a href="#StructuralProperty">Property</a> via structured type</td>
Expand Down Expand Up @@ -2710,6 +2715,61 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
</table>
<p>All <a href="#QualifiedName">qualified names</a> used in a target expression MUST be in scope.</p>
<p>External targeting is possible for properties and navigation properties of singletons or entities in a particular entity set. These annotations override annotations on the properties or navigation properties targeted via the declaring structured type.</p>
<p>External targeting is also possible for bound action and function overloads whose binding parameter is addressed via a certain path or has a certain type, as well as for parameters and return types thereof. The targeting expression then consists of two path expressions from the table above separated by a forward slash. The first path expression references one of the following model elements:</p>
<table>
<thead>
<tr class="header">
<th>Model element</th>
<th>means the binding parameter must be</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Entity Set</td>
<td>an instance or collection of instances from the entity set</td>
</tr>
<tr class="even">
<td>Singleton</td>
<td>the singleton</td>
</tr>
<tr class="odd">
<td>Navigation Property via container</td>
<td>addressed via a resource path to the navigation property</td>
</tr>
<tr class="even">
<td>Property via container</td>
<td>addressed via a resource path to the structural property</td>
</tr>
<tr class="odd">
<td>Navigation Property via structured type</td>
<td>addressed via a resource path to the navigation property that traverses an instance or collection of the structured type</td>
</tr>
<tr class="even">
<td>Property via structured type</td>
<td>addressed via a resource path to the structural property that traverses an instance or collection of the structured type</td>
</tr>
<tr class="odd">
<td>Complex Type</td>
<td>an instance or collection of the type or a subtype thereof</td>
</tr>
<tr class="even">
<td>Entity Type</td>
<td>an instance or collection of the type or a subtype thereof</td>
</tr>
</tbody>
</table>
<p>A binding parameter is “addressed via a resource path” if the path expression addressing the binding parameter starts with the resource path, it may then continue with segments described in <a href="#ODataURL">OData-URL</a>, sections 4.6 through 4.12. If the resource path addresses a collection, the binding parameter can also be a single instance of that collection if a segment described in <a href="#ODataURL">OData-URL</a>, sections 4.9 and 4.10, follows.</p>
<p>The second path expression references one of the following model elements:</p>
<ul>
<li>Action overload</li>
<li>all overloads of an Action</li>
<li>Function overload</li>
<li>all overloads of a Function</li>
<li>Parameter</li>
<li>Return Type</li>
</ul>
<p>where the overload is bound and the binding parameter meets the condition imposed by the first path expression.</p>
<p>These annotations override annotations targeting the action or function overloads directly.</p>
</details>
</details>
<details open><summary>
Expand Down
43 changes: 41 additions & 2 deletions docs/odata-csdl-json/odata-csdl-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ Section | Feature / Change | Issue
[Section 3.3](#PrimitiveTypes)| Allow stream-valued non-binding parameters| [525](https://github.com/oasis-tcs/odata-specs/issues/525)
[Section 3.4.5](#SRID)| SRID value `variable` is deprecated| [1935](https://github.com/oasis-tcs/odata-specs/issues/1935)
[Section 4](#CSDLJSONDocument) | Additional `$Version` value `4.02` |
[Section 14.2.2](#Target)| External targeting of bound action/function overloads via container or structured type| [393](https://github.com/oasis-tcs/odata-specs/issues/393)
[Section 14.3.13](#GeoValues) | Constant Geo values in annotations | [654](https://github.com/oasis-tcs/odata-specs/issues/654)
[Section 14.3.14](#StreamValues) | Constant Stream values in annotations | [654](https://github.com/oasis-tcs/odata-specs/issues/654)
[Section 14.4.1.2](#PathEvaluation)| New path evaluation rules for annotations targeting annotations and external targeting via container| [575](https://github.com/oasis-tcs/odata-specs/issues/575)
Expand Down Expand Up @@ -3887,7 +3888,7 @@ These are the direct children of a schema with a unique name (i.e.
except actions and functions whose overloads to not possess a natural
identifier), and all direct children of an entity container.

Model element| External targeting syntax| <div class="example"><p>Example 42: Target expressions</p></div>
Model element| Can be targeted with path expression (see also [section 14.4.1.1](#PathSyntax))| <div class="example"><p style="margin-top:0">Example 42: Target expressions</p></div>
-----|-----|-----
[Action](#Action) overload| qualified name of action followed by parentheses containing the binding parameter type of a bound action overload to identify that bound overload, or by empty parentheses to identify the unbound overload| <pre>`MySchema.MyAction(MySchema.MyBindingType)` <br>`MySchema.MyAction(Collection(MySchema.BindingType))` <br>`MySchema.MyAction()`</pre>
all overloads of an [Action](#Action)| qualified name of action| <pre>`MySchema.MyAction`</pre>
Expand All @@ -3906,7 +3907,7 @@ all overloads of a [Function](#Function)| qualified name of function| <pre>`MySc
[Navigation Property](#NavigationProperty) via structured type| qualified name of structured type followed by zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast| <pre>`MySchema.MyEntityType/MyNavigationProperty` <br>`MySchema.MyComplexType/MyNavigationProperty`</pre>
[Parameter](#Parameter)| qualified name of entity container followed by a segment containing an action or function import name followed by a segment containing a parameter name| <pre>`MySchema.MyEntityContainer/MyFunctionImport/MyParameter`</pre>
[Parameter](#Parameter)| qualified name of action or function optionally followed by a parenthesized expression as in the first row followed by a segment containing the name of a child element| <pre>`MySchema.MyFunction/MyParameter`</pre>
[Property](#StructuralProperty) via container| qualified name of entity container followed by a segment containing a singleton or entity set name and zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast| <pre>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MyProperty` <br>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MySchema.MyEntityType/MyProperty` <br>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MyComplexProperty/MyProperty`</pre>
[Property](#StructuralProperty) via container| qualified name of entity container followed by a segment containing a singleton or entity set name and zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast| <pre>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MyProperty` <br>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MySchema.MyEntityType/MyProperty` <br>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MyComplexProperty/MyProperty`</pre>
[Property](#StructuralProperty) via structured type| qualified name of structured type followed by zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast| <pre>`MySchema.MyEntityType/MyProperty` <br>`MySchema.MyComplexType/MyProperty`</pre>
[Return Type](#ReturnType)| qualified name of entity container followed by a segment containing an action or function import name followed by a segment containing `$ReturnType`| <pre>`MySchema.MyEntityContainer/MyFunctionImport/$ReturnType`</pre>
[Return Type](#ReturnType)| qualified name of action or function optionally followed by a parenthesized expression as in the first row followed by a segment containing `$ReturnType`| <pre>`MySchema.MyFunction/$ReturnType` <br>`MySchema.MyFunction(MySchema.MyBindingParamType,` <br>` First.NonBinding.ParamType)/$ReturnType`</pre>
Expand All @@ -3921,6 +3922,44 @@ properties of singletons or entities in a particular entity set. These
annotations override annotations on the properties or navigation
properties targeted via the declaring structured type.

External targeting is also possible for bound action and function overloads
whose binding parameter is addressed via a certain path or has a certain type,
as well as for parameters and return types thereof. The targeting expression then
consists of two path expressions from the table above separated by a forward
slash. The first path expression references one of the following model
elements:

Model element|means the binding parameter must be
-------------|-----------------------------------
Entity Set|an instance or collection of instances from the entity set
Singleton|the singleton
Navigation Property via container|addressed via a resource path to the navigation property
Property via container|addressed via a resource path to the structural property
Navigation Property via structured type|addressed via a resource path to the navigation property that traverses an instance or collection of the structured type
Property via structured type|addressed via a resource path to the structural property that traverses an instance or collection of the structured type
Complex Type|an instance or collection of the type or a subtype thereof
Entity Type|an instance or collection of the type or a subtype thereof

A binding parameter is "addressed via a resource path" if the path expression addressing the
binding parameter starts with the resource path, it may then continue with segments
described in [OData-URL](#ODataURL), sections 4.6 through 4.12. If the resource path
addresses a collection, the binding parameter can also be a single instance of that
collection if a segment described in [OData-URL](#ODataURL), sections 4.9 and 4.10, follows.

The second path expression references one of the following model elements:
- Action overload
- all overloads of an Action
- Function overload
- all overloads of a Function
- Parameter
- Return Type

where the overload is bound and the binding parameter meets the condition
imposed by the first path expression.

These annotations override annotations targeting the action or function
overloads directly.

## <a name="ConstantExpression" href="#ConstantExpression">14.3 Constant Expression</a>

Constant expressions allow assigning a constant value to an applied
Expand Down
74 changes: 67 additions & 7 deletions docs/odata-csdl-xml/odata-csdl-xml.html
Original file line number Diff line number Diff line change
Expand Up @@ -414,26 +414,31 @@ <h2 id="11-changes-from-earlier-versions"><a name="ChangesfromEarlierVersions" h
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/464">464</a></td>
</tr>
<tr class="odd">
<td><a href="#Target">Section 14.2.2</a></td>
<td>External targeting of bound action/function overloads via container or structured type</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/393">393</a></td>
</tr>
<tr class="even">
<td><a href="#GeoValues">Section 14.3.13</a></td>
<td>Constant Geo values in annotations</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/654">654</a></td>
</tr>
<tr class="even">
<tr class="odd">
<td><a href="#StreamValues">Section 14.3.14</a></td>
<td>Constant Stream values in annotations</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/654">654</a></td>
</tr>
<tr class="odd">
<tr class="even">
<td><a href="#PathEvaluation">Section 14.4.1.2</a></td>
<td>New path evaluation rules for annotations targeting annotations and external targeting via container</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/575">575</a></td>
</tr>
<tr class="even">
<tr class="odd">
<td><a href="#IfThenElse">Section 14.4.7</a></td>
<td>Nested <code>If</code> without else part in collections</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/326">326</a></td>
</tr>
<tr class="odd">
<tr class="even">
<td><a href="#Conformance">Section 17</a></td>
<td>Additional conformance clauses for version 4.02</td>
<td></td>
Expand Down Expand Up @@ -2393,8 +2398,8 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
<thead>
<tr class="header">
<th>Model element</th>
<th>External targeting syntax</th>
<th><div class="example"><p>Example 42: Target expressions</p></div></th>
<th>Can be targeted with path expression (see also <a href="#PathSyntax">section 14.4.1.1</a>)</th>
<th><div class="example"><p style="margin-top:0">Example 42: Target expressions</p></div></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -2486,7 +2491,7 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
<tr class="even">
<td><a href="#StructuralProperty">Property</a> via container</td>
<td>qualified name of entity container followed by a segment containing a singleton or entity set name and zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast</td>
<td><pre><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MySchema.MyEntityType/MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyComplexProperty/MyProperty</code></pre></td>
<td><pre><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MySchema.MyEntityType/MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyComplexProperty/MyProperty</code></pre></td>
</tr>
<tr class="odd">
<td><a href="#StructuralProperty">Property</a> via structured type</td>
Expand Down Expand Up @@ -2522,6 +2527,61 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
</table>
<p>All <a href="#QualifiedName">qualified names</a> used in a target expression MUST be in scope.</p>
<p>External targeting is possible for properties and navigation properties of singletons or entities in a particular entity set. These annotations override annotations on the properties or navigation properties targeted via the declaring structured type.</p>
<p>External targeting is also possible for bound action and function overloads whose binding parameter is addressed via a certain path or has a certain type, as well as for parameters and return types thereof. The targeting expression then consists of two path expressions from the table above separated by a forward slash. The first path expression references one of the following model elements:</p>
<table>
<thead>
<tr class="header">
<th>Model element</th>
<th>means the binding parameter must be</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Entity Set</td>
<td>an instance or collection of instances from the entity set</td>
</tr>
<tr class="even">
<td>Singleton</td>
<td>the singleton</td>
</tr>
<tr class="odd">
<td>Navigation Property via container</td>
<td>addressed via a resource path to the navigation property</td>
</tr>
<tr class="even">
<td>Property via container</td>
<td>addressed via a resource path to the structural property</td>
</tr>
<tr class="odd">
<td>Navigation Property via structured type</td>
<td>addressed via a resource path to the navigation property that traverses an instance or collection of the structured type</td>
</tr>
<tr class="even">
<td>Property via structured type</td>
<td>addressed via a resource path to the structural property that traverses an instance or collection of the structured type</td>
</tr>
<tr class="odd">
<td>Complex Type</td>
<td>an instance or collection of the type or a subtype thereof</td>
</tr>
<tr class="even">
<td>Entity Type</td>
<td>an instance or collection of the type or a subtype thereof</td>
</tr>
</tbody>
</table>
<p>A binding parameter is “addressed via a resource path” if the path expression addressing the binding parameter starts with the resource path, it may then continue with segments described in <a href="#ODataURL">OData-URL</a>, sections 4.6 through 4.12. If the resource path addresses a collection, the binding parameter can also be a single instance of that collection if a segment described in <a href="#ODataURL">OData-URL</a>, sections 4.9 and 4.10, follows.</p>
<p>The second path expression references one of the following model elements:</p>
<ul>
<li>Action overload</li>
<li>all overloads of an Action</li>
<li>Function overload</li>
<li>all overloads of a Function</li>
<li>Parameter</li>
<li>Return Type</li>
</ul>
<p>where the overload is bound and the binding parameter meets the condition imposed by the first path expression.</p>
<p>These annotations override annotations targeting the action or function overloads directly.</p>
</details>
</details>
<details open><summary>
Expand Down
Loading