Skip to content

Commit

Permalink
ODATA-1397
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Jul 31, 2023
1 parent 70bb405 commit b2612ec
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 133 deletions.
60 changes: 32 additions & 28 deletions docs/odata-csdl-json/odata-csdl-json.html
Original file line number Diff line number Diff line change
Expand Up @@ -3101,34 +3101,38 @@ <h3 id="14412-record"><a name="Record" href="#Record">14.4.12 Record</a></h3>
</div>
<div class="varjson example">
<p>Example 87: this annotation "morphs" the entity type from <a href="#entitytype">example 8</a> into a structured type with two structural properties <code>GivenName</code> and <code>Surname</code> and two navigation properties <code>DirectSupervisor</code> and <code>CostCenter</code>. The first three properties simply rename properties of the annotated entity type, the fourth adds a calculated navigation property that is pointing to a different service</p>
<div class="sourceCode" id="cb94"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb94-1"><a href="#cb94-1" aria-hidden="true" tabindex="-1"></a><span class="er">&quot;@person.Employee&quot;:</span> <span class="fu">{</span></span>
<span id="cb94-2"><a href="#cb94-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@type&quot;</span><span class="fu">:</span> <span class="st">&quot;https://example.org/vocabs/person#org.example.person.Manager&quot;</span><span class="fu">,</span></span>
<span id="cb94-3"><a href="#cb94-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@Core.Description&quot;</span><span class="fu">:</span> <span class="st">&quot;Annotation on record&quot;</span><span class="fu">,</span></span>
<span id="cb94-4"><a href="#cb94-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;GivenName&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-5"><a href="#cb94-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;FirstName&quot;</span></span>
<span id="cb94-6"><a href="#cb94-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb94-7"><a href="#cb94-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;[email protected]&quot;</span><span class="fu">:</span> <span class="st">&quot;Annotation on record member&quot;</span><span class="fu">,</span></span>
<span id="cb94-8"><a href="#cb94-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Surname&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-9"><a href="#cb94-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;LastName&quot;</span></span>
<span id="cb94-10"><a href="#cb94-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb94-11"><a href="#cb94-11" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;DirectSupervisor&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-12"><a href="#cb94-12" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;Manager&quot;</span></span>
<span id="cb94-13"><a href="#cb94-13" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb94-14"><a href="#cb94-14" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;CostCenter&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-15"><a href="#cb94-15" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$UrlRef&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-16"><a href="#cb94-16" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Apply&quot;</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb94-17"><a href="#cb94-17" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;http://host/anotherservice/CostCenters(&#39;{ccid}&#39;)&quot;</span><span class="ot">,</span></span>
<span id="cb94-18"><a href="#cb94-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">{</span></span>
<span id="cb94-19"><a href="#cb94-19" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$LabeledElement&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-20"><a href="#cb94-20" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;CostCenterID&quot;</span></span>
<span id="cb94-21"><a href="#cb94-21" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb94-22"><a href="#cb94-22" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Name&quot;</span><span class="fu">:</span> <span class="st">&quot;ccid&quot;</span></span>
<span id="cb94-23"><a href="#cb94-23" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb94-24"><a href="#cb94-24" aria-hidden="true" tabindex="-1"></a> <span class="ot">]</span><span class="fu">,</span></span>
<span id="cb94-25"><a href="#cb94-25" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Function&quot;</span><span class="fu">:</span> <span class="st">&quot;odata.fillUriTemplate&quot;</span></span>
<span id="cb94-26"><a href="#cb94-26" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb94-27"><a href="#cb94-27" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb94-28"><a href="#cb94-28" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
<div class="sourceCode" id="cb94"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb94-1"><a href="#cb94-1" aria-hidden="true" tabindex="-1"></a><span class="er">&quot;$Annotations&quot;:</span> <span class="fu">{</span></span>
<span id="cb94-2"><a href="#cb94-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;org.example.Person&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-3"><a href="#cb94-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@org.example.hcm.Employee&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-4"><a href="#cb94-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@type&quot;</span><span class="fu">:</span> <span class="st">&quot;https://example.org/vocabs/person#org.example.person.Manager&quot;</span><span class="fu">,</span></span>
<span id="cb94-5"><a href="#cb94-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@Core.Description&quot;</span><span class="fu">:</span> <span class="st">&quot;Annotation on record&quot;</span><span class="fu">,</span></span>
<span id="cb94-6"><a href="#cb94-6" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;GivenName&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-7"><a href="#cb94-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;FirstName&quot;</span></span>
<span id="cb94-8"><a href="#cb94-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb94-9"><a href="#cb94-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;[email protected]&quot;</span><span class="fu">:</span> <span class="st">&quot;Annotation on record member&quot;</span><span class="fu">,</span></span>
<span id="cb94-10"><a href="#cb94-10" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Surname&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-11"><a href="#cb94-11" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;LastName&quot;</span></span>
<span id="cb94-12"><a href="#cb94-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb94-13"><a href="#cb94-13" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;DirectSupervisor&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-14"><a href="#cb94-14" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;Manager&quot;</span></span>
<span id="cb94-15"><a href="#cb94-15" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb94-16"><a href="#cb94-16" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;CostCenter&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-17"><a href="#cb94-17" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$UrlRef&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-18"><a href="#cb94-18" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Apply&quot;</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb94-19"><a href="#cb94-19" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;http://host/anotherservice/CostCenters(&#39;{ccid}&#39;)&quot;</span><span class="ot">,</span></span>
<span id="cb94-20"><a href="#cb94-20" aria-hidden="true" tabindex="-1"></a> <span class="fu">{</span></span>
<span id="cb94-21"><a href="#cb94-21" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$LabeledElement&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb94-22"><a href="#cb94-22" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;CostCenterID&quot;</span></span>
<span id="cb94-23"><a href="#cb94-23" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb94-24"><a href="#cb94-24" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Name&quot;</span><span class="fu">:</span> <span class="st">&quot;ccid&quot;</span></span>
<span id="cb94-25"><a href="#cb94-25" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb94-26"><a href="#cb94-26" aria-hidden="true" tabindex="-1"></a> <span class="ot">]</span><span class="fu">,</span></span>
<span id="cb94-27"><a href="#cb94-27" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Function&quot;</span><span class="fu">:</span> <span class="st">&quot;odata.fillUriTemplate&quot;</span></span>
<span id="cb94-28"><a href="#cb94-28" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb94-29"><a href="#cb94-29" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb94-30"><a href="#cb94-30" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb94-31"><a href="#cb94-31" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb94-32"><a href="#cb94-32" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
</div>
<h3 id="14413-url-reference"><a name="URLReference" href="#URLReference">14.4.13 URL Reference</a></h3>
<p>The URL reference expression enables a value to be obtained by sending a <code>GET</code> request.</p>
Expand Down
52 changes: 28 additions & 24 deletions docs/odata-csdl-json/odata-csdl-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -5338,31 +5338,35 @@ a structured type with two structural properties `GivenName` and
annotated entity type, the fourth adds a calculated navigation property
that is pointing to a different service
```json
"@person.Employee": {
"@type": "https://example.org/vocabs/person#org.example.person.Manager",
"@Core.Description": "Annotation on record",
"GivenName": {
"$Path": "FirstName"
},
"[email protected]": "Annotation on record member",
"Surname": {
"$Path": "LastName"
},
"DirectSupervisor": {
"$Path": "Manager"
},
"CostCenter": {
"$UrlRef": {
"$Apply": [
"http://host/anotherservice/CostCenters('{ccid}')",
{
"$LabeledElement": {
"$Path": "CostCenterID"
},
"$Name": "ccid"
"$Annotations": {
"org.example.Person": {
"@org.example.hcm.Employee": {
"@type": "https://example.org/vocabs/person#org.example.person.Manager",
"@Core.Description": "Annotation on record",
"GivenName": {
"$Path": "FirstName"
},
"[email protected]": "Annotation on record member",
"Surname": {
"$Path": "LastName"
},
"DirectSupervisor": {
"$Path": "Manager"
},
"CostCenter": {
"$UrlRef": {
"$Apply": [
"http://host/anotherservice/CostCenters('{ccid}')",
{
"$LabeledElement": {
"$Path": "CostCenterID"
},
"$Name": "ccid"
}
],
"$Function": "odata.fillUriTemplate"
}
],
"$Function": "odata.fillUriTemplate"
}
}
}
}
Expand Down
40 changes: 21 additions & 19 deletions docs/odata-csdl-xml/odata-csdl-xml.html
Original file line number Diff line number Diff line change
Expand Up @@ -2892,25 +2892,27 @@ <h3 id="-attribute-property-1"><a name="AttributeProperty62.1" href="#AttributeP
</div>
<div class="varxml example">
<p>Example 86: this annotation "morphs" the entity type from <a href="#entitytype">example 8</a> into a structured type with two structural properties <code>GivenName</code> and <code>Surname</code> and two navigation properties <code>DirectSupervisor</code> and <code>CostCenter</code>. The first three properties simply rename properties of the annotated entity type, the fourth adds a calculated navigation property that is pointing to a different service</p>
<pre><code>&lt;Annotation Term=&quot;org.example.person.Employee&quot;&gt;
&lt;Record&gt;
&lt;Annotation Term=&quot;Core.Description&quot; String=&quot;Annotation on record&quot; /&gt;
&lt;PropertyValue Property=&quot;GivenName&quot; Path=&quot;FirstName&quot;&gt;
&lt;Annotation Term=&quot;Core.Description&quot;
String=&quot;Annotation on record member&quot; /&gt;
&lt;/PropertyValue&gt;
&lt;PropertyValue Property=&quot;Surname&quot; Path=&quot;LastName&quot; /&gt;
&lt;PropertyValue Property=&quot;DirectSupervisor&quot; Path=&quot;Manager&quot; /&gt;
&lt;PropertyValue Property=&quot;CostCenter&quot;&gt;
&lt;UrlRef&gt;
&lt;Apply Function=&quot;odata.fillUriTemplate&quot;&gt;
&lt;String&gt;http://host/anotherservice/CostCenters(&#39;{ccid}&#39;)&lt;/String&gt;
&lt;LabeledElement Name=&quot;ccid&quot; Path=&quot;CostCenterID&quot; /&gt;
&lt;/Apply&gt;
&lt;/UrlRef&gt;
&lt;/PropertyValue&gt;
&lt;/Record&gt;
&lt;/Annotation&gt;</code></pre>
<pre><code>&lt;Annotations Target=&quot;org.example.Person&quot;&gt;
&lt;Annotation Term=&quot;org.example.hcm.Employee&quot;&gt;
&lt;Record Type=&quot;org.example.hcm.Manager&quot;&gt;
&lt;Annotation Term=&quot;Core.Description&quot; String=&quot;Annotation on record&quot; /&gt;
&lt;PropertyValue Property=&quot;GivenName&quot; Path=&quot;FirstName&quot;&gt;
&lt;Annotation Term=&quot;Core.Description&quot;
String=&quot;Annotation on record member&quot; /&gt;
&lt;/PropertyValue&gt;
&lt;PropertyValue Property=&quot;Surname&quot; Path=&quot;LastName&quot; /&gt;
&lt;PropertyValue Property=&quot;DirectSupervisor&quot; Path=&quot;Manager&quot; /&gt;
&lt;PropertyValue Property=&quot;CostCenter&quot;&gt;
&lt;UrlRef&gt;
&lt;Apply Function=&quot;odata.fillUriTemplate&quot;&gt;
&lt;String&gt;http://host/anotherservice/CostCenters(&#39;{ccid}&#39;)&lt;/String&gt;
&lt;LabeledElement Name=&quot;ccid&quot; Path=&quot;CostCenterID&quot; /&gt;
&lt;/Apply&gt;
&lt;/UrlRef&gt;
&lt;/PropertyValue&gt;
&lt;/Record&gt;
&lt;/Annotation&gt;
&lt;/Annotations&gt;</code></pre>
</div>
<h3 id="14413-url-reference"><a name="URLReference" href="#URLReference">14.4.13 URL Reference</a></h3>
<p>The URL reference expression enables a value to be obtained by sending a <code>GET</code> request.</p>
Expand Down
40 changes: 21 additions & 19 deletions docs/odata-csdl-xml/odata-csdl-xml.md
Original file line number Diff line number Diff line change
Expand Up @@ -5169,25 +5169,27 @@ a structured type with two structural properties `GivenName` and
annotated entity type, the fourth adds a calculated navigation property
that is pointing to a different service
```
<Annotation Term="org.example.person.Employee">
<Record>
<Annotation Term="Core.Description" String="Annotation on record" />
<PropertyValue Property="GivenName" Path="FirstName">
<Annotation Term="Core.Description"
String="Annotation on record member" />
</PropertyValue>
<PropertyValue Property="Surname" Path="LastName" />
<PropertyValue Property="DirectSupervisor" Path="Manager" />
<PropertyValue Property="CostCenter">
<UrlRef>
<Apply Function="odata.fillUriTemplate">
<String>http://host/anotherservice/CostCenters('{ccid}')</String>
<LabeledElement Name="ccid" Path="CostCenterID" />
</Apply>
</UrlRef>
</PropertyValue>
</Record>
</Annotation>
<Annotations Target="org.example.Person">
<Annotation Term="org.example.hcm.Employee">
<Record Type="org.example.hcm.Manager">
<Annotation Term="Core.Description" String="Annotation on record" />
<PropertyValue Property="GivenName" Path="FirstName">
<Annotation Term="Core.Description"
String="Annotation on record member" />
</PropertyValue>
<PropertyValue Property="Surname" Path="LastName" />
<PropertyValue Property="DirectSupervisor" Path="Manager" />
<PropertyValue Property="CostCenter">
<UrlRef>
<Apply Function="odata.fillUriTemplate">
<String>http://host/anotherservice/CostCenters('{ccid}')</String>
<LabeledElement Name="ccid" Path="CostCenterID" />
</Apply>
</UrlRef>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
```
:::

Expand Down
Loading

0 comments on commit b2612ec

Please sign in to comment.