Skip to content

Commit

Permalink
TC 2024-10-16
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Oct 17, 2024
1 parent 39e9a53 commit 68993ff
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 63 deletions.
22 changes: 10 additions & 12 deletions docs/odata-protocol/odata-protocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -1302,15 +1302,15 @@ <h1 id="10-context-url"><a id="ContextURL" href="#ContextURL">10 Context URL</a>
<p>The following subsections describe how the context URL is constructed for each category of payload by providing a <em>context URL template</em>. The context URL template uses the following terms:</p>
<ul>
<li><code>{context-url}</code> is the canonical resource path to the <code>$metadata</code> document,</li>
<li><code>{entity-set}</code> is the name of an entity set or the canonical path to a collection-valued containment navigation property,</li>
<li><code>{entity}</code> is the canonical URL for an entity,</li>
<li><code>{entity-set}</code> is the name of an entity set <a href="https://docs.oasis-open.org/odata/odata-csdl-json/v4.02/odata-csdl-json-v4.02.html#EntitySet">OData-CSDL, section 13.2</a> or the canonical path to a collection-valued containment navigation property (implicit entity set <a href="https://docs.oasis-open.org/odata/odata-csdl-json/v4.02/odata-csdl-json-v4.02.html#ContainmentNavigationProperty">OData-CSDL, section 8.4</a>),</li>
<li><code>{single-entity}</code> is the name of a singleton or the canonical path to a single-valued containment navigation property,</li>
<li><code>{entity}</code> is the canonical URL for an entity,</li>
<li><code>{select-list}</code> is an optional parenthesized comma-separated list of selected properties, instance annotations, functions, and actions,</li>
<li><code>{property-path}</code> is the path to a structural property of the entity,</li>
<li><code>{type-name}</code> is a qualified type name,</li>
<li><code>{/type-name}</code> is an optional type-cast segment containing the qualified name of a derived or implemented type prefixed with a forward slash.</li>
</ul>
<p>Key values in the canonical path in <code>{entity-set}</code> and <code>{single-entity}</code> are represented in canonical form (parentheses-style) without percent-encoding.</p>
<p>Key values in the canonical path in <code>{entity-set}</code>, <code>{single-entity}</code>, and <code>{entity}</code> are represented in canonical form (parentheses-style) without percent-encoding.</p>
<p>The full grammar for the context URL is defined in <a href="#ODataABNF">OData-ABNF</a>. Note that the syntax of the context URL is independent of whatever URL conventions the service uses for addressing individual entities.</p>
<details open><summary>
<h2 id="101-service-document"><a id="ServiceDocument" href="#ServiceDocument">10.1 Service Document</a></h2>
Expand All @@ -1330,13 +1330,12 @@ <h2 id="102-collection-of-entities"><a id="CollectionofEntities" href="#Collecti
<p>Context URL template:</p>
<pre><code>{context-url}#{entity-set}
{context-url}#Collection({type-name})</code></pre>
<p>If all entities in the collection are members of one entity set, its name is the context URL fragment.</p>
<p>If all entities in the collection are members of one (named or implicit) entity set, the context URL fragment is the canonical path <code>{entity-set}</code> to the entity set.</p>
<div class="example">
<p>Example 11: resource URL and corresponding context URL</p>
<pre><code>http://host/service/Customers
http://host/service/$metadata#Customers</code></pre>
</div>
<p>If the entities are contained, then <code>{entity-set}</code> is the top-level entity set or singleton followed by the canonical path to the containment navigation property of the containing entity.</p>
<div class="example">
<p>Example 12: resource URL and corresponding context URL for contained entities</p>
<pre><code>http://host/service/Orders(4711)/Items
Expand All @@ -1351,19 +1350,18 @@ <h2 id="103-entity"><a id="Entity" href="#Entity">10.3 Entity</a></h2>
<pre><code>{context-url}#{entity-set}/$entity
{context-url}#{single-entity}
{context-url}#{type-name}</code></pre>
<p>If a response or response part is a single entity of the declared type of an entity set, the context URL fragment is the entity set’s name with <code>/$entity</code> appended.</p>
<p>If a response or response part is an entity of the declared type of a (named or implicit) entity set, the context URL fragment is the canonical path <code>{entity-set}</code> to the entity set with <code>/$entity</code> appended.</p>
<div class="example">
<p>Example 13: resource URL and corresponding context URL</p>
<p>Example 13: resource URL and corresponding context URL for named entity set. Note the absence of the key predicate <code>(1)</code> in the context URL.</p>
<pre><code>http://host/service/Customers(1)
http://host/service/$metadata#Customers/$entity</code></pre>
</div>
<p>If the entity is bound to a contained entity set, then <code>{entity-set}</code> is the canonical path to the collection-valued containment navigation property of the containing entity.</p>
<div class="example">
<p>Example 14: resource URL and corresponding context URL for contained entity</p>
<p>Example 14: resource URL and corresponding context URL for contained entity (implicit entity set)</p>
<pre><code>http://host/service/Orders(4711)/Items(1)
http://host/service/$metadata#Orders(4711)/Items/$entity</code></pre>
</div>
<p>If the entity is the target of a single-valued containment navigation property, then the context URL fragment is the canonical path <code>{single-entity}</code> to the single-valued containment navigation property of the containing entity without <code>/$entity</code> appended.</p>
<p>If a response or response part is an entity of the declared type of a single-valued containment navigation property, the context URL fragment is the canonical path <code>{single-entity}</code> to that navigation property without <code>/$entity</code> appended.</p>
<div class="example">
<p>Example 15: resource URL and corresponding context URL for entity targeted by a single-valued containment navigation property</p>
<pre><code>http://host/service/Orders(4711)/DeliveryAddress
Expand Down Expand Up @@ -1400,7 +1398,7 @@ <h2 id="106-derived-entity"><a id="DerivedEntity" href="#DerivedEntity">10.6 Der
</summary>
<p>Context URL template:</p>
<pre><code>{context-url}#{entity-set}{/type-name}/$entity</code></pre>
<p>If a response or response part is a single entity of a type derived from the declared type of an entity set, a type-cast segment is appended to the entity set name.</p>
<p>If a response or response part is an entity of a type derived from the declared type of an entity set, a type-cast segment is appended to the entity set name.</p>
<div class="example">
<p>Example 18: resource URL and corresponding context URL</p>
<pre><code>http://host/service/Customers(2)/Model.VipCustomer
Expand Down Expand Up @@ -1432,7 +1430,7 @@ <h2 id="108-projected-entity"><a id="ProjectedEntity" href="#ProjectedEntity">10
<pre><code>{context-url}#{entity-set}{/type-name}{select-list}/$entity
{context-url}#{single-entity}{select-list}
{context-url}#{type-name}{select-list}</code></pre>
<p>If a single entity contains a subset of properties, the parenthesized comma-separated list of the selected defined or dynamic properties, instance annotations, navigation properties, functions, and actions is appended to the <code>{entity-set}</code> after an optional type-cast segment and prior to appending <code>/$entity</code>. If the response is not a subset of a single entity set, the <code>{select-list}</code> is instead appended to the <code>{type-name}</code> of the returned entity.</p>
<p>If an entity contains a subset of properties, the parenthesized comma-separated list of the selected defined or dynamic properties, instance annotations, navigation properties, functions, and actions is appended to the <code>{entity-set}</code> after an optional type-cast segment and prior to appending <code>/$entity</code>, or to the <code>{single-entity}</code>. If the response is not a subset of a single entity set, the <code>{select-list}</code> is instead appended to the <code>{type-name}</code> of the returned entity.</p>
<p>Regardless of how contained structural properties are represented in the request URL (as paths or as select options) they are represented in the context URL using path syntax, as defined in OData 4.0.</p>
<p>The shortcut <code>*</code> represents the list of all structural properties. Properties defined on types derived from the type of the entity set (or type specified in the type-cast segment if specified) are prefixed with the qualified name of the derived type as defined in <a href="#ODataABNF">OData-ABNF</a>. Note that expanded properties are automatically included in the response.</p>
<p>The list also contains explicitly selected or expanded instance annotations. It is possible to select or expand only instance annotations, in which case only those selected or expanded annotations appear in the result. Note that annotations specified only in the <a href="#Preferenceincludeannotationsodataincludeannotations"><code>include-annotations</code></a> preference do not appear in the context URL and do not affect the selected/expanded properties.</p>
Expand Down
47 changes: 22 additions & 25 deletions docs/odata-protocol/odata-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -1999,10 +1999,12 @@ for each category of payload by providing a *context URL template*. The
context URL template uses the following terms:
- `{context-url}` is the canonical
resource path to the `$metadata` document,
- `{entity-set}` is the name of an entity set or the canonical path to a collection-valued containment navigation property,
- `{entity-set}` is the name of an entity set [OData-CSDL, section 13.2](https://docs.oasis-open.org/odata/odata-csdl-json/v4.02/odata-csdl-json-v4.02.html#EntitySet)
or the canonical path to a collection-valued containment navigation property
(implicit entity set [OData-CSDL, section 8.4](https://docs.oasis-open.org/odata/odata-csdl-json/v4.02/odata-csdl-json-v4.02.html#ContainmentNavigationProperty)),
- `{single-entity}` is the name of a singleton or the canonical path to a single-valued containment navigation property,
- `{entity}` is the canonical URL for an
entity,
- `{single-entity}` is the name of a singleton or the canonical path to a single-valued containment navigation property,
- `{select-list}` is an optional
parenthesized comma-separated list of selected properties, instance
annotations, functions, and actions,
Expand All @@ -2013,7 +2015,7 @@ path to a structural property of the entity,
segment containing the qualified name of a derived or implemented type
prefixed with a forward slash.

Key values in the canonical path in `{entity-set}` and `{single-entity}` are represented in canonical form
Key values in the canonical path in `{entity-set}`, `{single-entity}`, and `{entity}` are represented in canonical form
(parentheses-style) without percent-encoding.

The full grammar for the context URL is defined in
Expand Down Expand Up @@ -2045,8 +2047,9 @@ Context URL template:
{context-url}#{entity-set}
{context-url}#Collection({type-name})

If all entities in the collection are members of one entity set, its
name is the context URL fragment.
If all entities in the collection are members of one (named or implicit)
entity set, the context URL fragment is the canonical path `{entity-set}` to the
entity set.

::: example
Example 11: resource URL and corresponding context URL
Expand All @@ -2056,10 +2059,6 @@ http://host/service/$metadata#Customers
```
:::

If the entities are contained, then `{entity-set}` is the top-level entity
set or singleton followed by the canonical path to the containment navigation
property of the containing entity.

::: example
Example 12: resource URL and corresponding context URL for contained
entities
Expand All @@ -2083,35 +2082,32 @@ Context URL template:
{context-url}#{single-entity}
{context-url}#{type-name}

If a response or response part is a single entity of the declared type
of an entity set, the context URL fragment is the entity set's
name with `/$entity` appended.
If a response or response part is an entity of the declared type
of a (named or implicit) entity set, the context URL fragment is the canonical path
`{entity-set}` to the entity set with `/$entity` appended.

::: example
Example 13: resource URL and corresponding context URL
Example 13: resource URL and corresponding context URL for named entity set.
Note the absence of the key predicate `(1)` in the context URL.
```
http://host/service/Customers(1)
http://host/service/$metadata#Customers/$entity
```
:::

If the entity is bound to a contained entity set, then `{entity-set}` is the
canonical path to the collection-valued containment navigation
property of the containing entity.

::: example
Example 14: resource URL and corresponding context URL for contained
entity
entity (implicit entity set)
```
http://host/service/Orders(4711)/Items(1)
http://host/service/$metadata#Orders(4711)/Items/$entity
```
:::

If the entity is the target of a single-valued containment navigation property,
then the context URL fragment is the canonical path `{single-entity}`
to the single-valued containment navigation
property of the containing entity without `/$entity` appended.
If a response or response part is an entity of the declared type of
a single-valued containment navigation property,
the context URL fragment is the canonical path `{single-entity}`
to that navigation property without `/$entity` appended.

::: example
Example 15: resource URL and corresponding context URL for
Expand Down Expand Up @@ -2168,7 +2164,7 @@ Context URL template:

{context-url}#{entity-set}{/type-name}/$entity

If a response or response part is a single entity of a type derived from
If a response or response part is an entity of a type derived from
the declared type of an entity set, a type-cast segment is appended to
the entity set name.

Expand Down Expand Up @@ -2237,11 +2233,12 @@ Context URL templates:
{context-url}#{single-entity}{select-list}
{context-url}#{type-name}{select-list}

If a single entity contains a subset of properties, the parenthesized
If an entity contains a subset of properties, the parenthesized
comma-separated list of the selected defined or dynamic properties,
instance annotations, navigation properties, functions, and actions is
appended to the `{entity-set}` after an optional type-cast segment and
prior to appending `/$entity`. If the response is not a subset of a
prior to appending `/$entity`, or to the `{single-entity}`.
If the response is not a subset of a
single entity set, the `{select-list}` is instead appended to the
`{type-name}` of the returned entity.

Expand Down
47 changes: 22 additions & 25 deletions odata-protocol/10 Context URL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ for each category of payload by providing a *context URL template*. The
context URL template uses the following terms:
- `{context-url}` is the canonical
resource path to the `$metadata` document,
- `{entity-set}` is the name of an entity set or the canonical path to a collection-valued containment navigation property,
- `{entity-set}` is the name of an entity set [#OData-CSDL#EntitySet]
or the canonical path to a collection-valued containment navigation property
(implicit entity set [#OData-CSDL#ContainmentNavigationProperty]),
- `{single-entity}` is the name of a singleton or the canonical path to a single-valued containment navigation property,
- `{entity}` is the canonical URL for an
entity,
- `{single-entity}` is the name of a singleton or the canonical path to a single-valued containment navigation property,
- `{select-list}` is an optional
parenthesized comma-separated list of selected properties, instance
annotations, functions, and actions,
Expand All @@ -36,7 +38,7 @@ path to a structural property of the entity,
segment containing the qualified name of a derived or implemented type
prefixed with a forward slash.

Key values in the canonical path in `{entity-set}` and `{single-entity}` are represented in canonical form
Key values in the canonical path in `{entity-set}`, `{single-entity}`, and `{entity}` are represented in canonical form
(parentheses-style) without percent-encoding.

The full grammar for the context URL is defined in
Expand Down Expand Up @@ -68,8 +70,9 @@ Context URL template:
{context-url}#{entity-set}
{context-url}#Collection({type-name})

If all entities in the collection are members of one entity set, its
name is the context URL fragment.
If all entities in the collection are members of one (named or implicit)
entity set, the context URL fragment is the canonical path `{entity-set}` to the
entity set.

::: example
Example ##ex: resource URL and corresponding context URL
Expand All @@ -79,10 +82,6 @@ http://host/service/$metadata#Customers
```
:::

If the entities are contained, then `{entity-set}` is the top-level entity
set or singleton followed by the canonical path to the containment navigation
property of the containing entity.

::: example
Example ##ex: resource URL and corresponding context URL for contained
entities
Expand All @@ -106,35 +105,32 @@ Context URL template:
{context-url}#{single-entity}
{context-url}#{type-name}

If a response or response part is a single entity of the declared type
of an entity set, the context URL fragment is the entity set's
name with `/$entity` appended.
If a response or response part is an entity of the declared type
of a (named or implicit) entity set, the context URL fragment is the canonical path
`{entity-set}` to the entity set with `/$entity` appended.

::: example
Example ##ex: resource URL and corresponding context URL
Example ##ex: resource URL and corresponding context URL for named entity set.
Note the absence of the key predicate `(1)` in the context URL.
```
http://host/service/Customers(1)
http://host/service/$metadata#Customers/$entity
```
:::

If the entity is bound to a contained entity set, then `{entity-set}` is the
canonical path to the collection-valued containment navigation
property of the containing entity.

::: example
Example ##ex: resource URL and corresponding context URL for contained
entity
entity (implicit entity set)
```
http://host/service/Orders(4711)/Items(1)
http://host/service/$metadata#Orders(4711)/Items/$entity
```
:::

If the entity is the target of a single-valued containment navigation property,
then the context URL fragment is the canonical path `{single-entity}`
to the single-valued containment navigation
property of the containing entity without `/$entity` appended.
If a response or response part is an entity of the declared type of
a single-valued containment navigation property,
the context URL fragment is the canonical path `{single-entity}`
to that navigation property without `/$entity` appended.

::: example
Example ##ex: resource URL and corresponding context URL for
Expand Down Expand Up @@ -191,7 +187,7 @@ Context URL template:

{context-url}#{entity-set}{/type-name}/$entity

If a response or response part is a single entity of a type derived from
If a response or response part is an entity of a type derived from
the declared type of an entity set, a type-cast segment is appended to
the entity set name.

Expand Down Expand Up @@ -260,11 +256,12 @@ Context URL templates:
{context-url}#{single-entity}{select-list}
{context-url}#{type-name}{select-list}

If a single entity contains a subset of properties, the parenthesized
If an entity contains a subset of properties, the parenthesized
comma-separated list of the selected defined or dynamic properties,
instance annotations, navigation properties, functions, and actions is
appended to the `{entity-set}` after an optional type-cast segment and
prior to appending `/$entity`. If the response is not a subset of a
prior to appending `/$entity`, or to the `{single-entity}`.
If the response is not a subset of a
single entity set, the `{select-list}` is instead appended to the
`{type-name}` of the returned entity.

Expand Down
2 changes: 1 addition & 1 deletion scripts/folding.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var page = location.href.match(/:\/\/.*?(\/.*?)(#|$)/)[1];
var folding = JSON.parse(localStorage.getItem(page) || "{}");
for (var id in folding) {
var target = document.getElementById(id).parentElement.parentElement;
var target = document.getElementById(id)?.parentElement.parentElement;
if (target) {
if (folding[id]) target.removeAttribute("open");
else target.setAttribute("open", "");
Expand Down

0 comments on commit 68993ff

Please sign in to comment.