Skip to content

Commit 2a2f71f

Browse files
committed
update odata-dd 1-6
1 parent 12b777b commit 2a2f71f

8 files changed

Lines changed: 284 additions & 20 deletions

File tree

tutorials/odata-dd-1-origins/odata-dd-1-origins.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ primary_tag: software-product>sap-business-technology-platform
77
tags: [ software-product>sap-business-technology-platform, topic>cloud, programming-tool>odata, tutorial>beginner ]
88
time: 20
99
---
10-
10+
1111
# Learn about OData's origins
1212

1313
<!-- description --> Discover OData's origins in RSS and Atom.
@@ -124,7 +124,7 @@ Beyond news feeds like this, the archetypal use case for RSS (and indeed Atom) i
124124

125125
### Examine the Atom Syndication Format
126126

127-
Atom is a format very similar to RSS, serving the same purpose, that came about for reasons that are not relevant for this tutorial (but see the Further Info section for a link to more background details if you're curious). It's known as the [Atom Syndication Format](https://tools.ietf.org/html/rfc4287).
127+
Atom is a format very similar to RSS, serving the same purpose, that came about for reasons that are not relevant for this tutorial (but see the Further Info section for a link to more background details if you're curious). It's known as the Atom Syndication Format, described in [RFC 4287](https://tools.ietf.org/html/rfc4287).
128128

129129
Some may call Atom a successor to RSS. Unlike RSS, which is just a _format_ specification, Atom also has a related _protocol_ which we'll look at shortly.
130130

@@ -458,5 +458,5 @@ The use of "OData-Protocol" is a reference to a related document in the OData V4
458458

459459
### Further info
460460

461-
- [Accuracy and precision in language](https://qmacro.org/blog/posts/2024/01/22/accuracy-and-precision-in-language/) on the distinction between "blog" and "post".
462-
- [Monday morning thoughts: OData](https://qmacro.org/blog/posts/2018/08/20/monday-morning-thoughts-odata/) has further details on the journey from RSS, through Atom and AtomPub, to OData.
461+
- [Accuracy and precision in language](https://qmacro.org/blog/posts/2024/01/22/accuracy-and-precision-in-language/) on the distinction between "blog" and "post"
462+
- [Monday morning thoughts: OData](https://qmacro.org/blog/posts/2018/08/20/monday-morning-thoughts-odata/) has further details on the journey from RSS, through Atom and AtomPub, to OData

tutorials/odata-dd-2-standards/odata-dd-2-standards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ primary_tag: software-product>sap-business-technology-platform
77
tags: [ software-product>sap-business-technology-platform, topic>cloud, programming-tool>odata, tutorial>beginner ]
88
time: 20
99
---
10-
10+
1111
# Get to know the OData standards resources on the Web
1212

1313
<!-- description --> Get acquainted with the OData standards and how to navigate them.

tutorials/odata-dd-3-northbreeze/odata-dd-3-northbreeze.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ You will need:
4040

4141
The OData service is deliberately simple and contains a small handful of entities in the domain model, and a single service made available via the OData V4 protocol.
4242

43-
Head to <https://github.com/qmacro/northbreeze> and take a look around, especially in the CAP project directory [northbreeze](https://github.com/qmacro/odata-dd-server/tree/main/northbreeze).
43+
Head to <https://github.com/qmacro/odata-dd-server> and take a look around, especially in the CAP project directory [northbreeze](https://github.com/qmacro/odata-dd-server/tree/main/northbreeze).
4444

4545
### Run as a Docker container
4646

@@ -104,10 +104,10 @@ Links to the Northbreeze OData service document, metadata document, and entityse
104104

105105
### Visit the publicly available read-only service
106106

107-
In case you haven't yet got round to running your own instance of the Northbreeze service, there's a publicly available instance that is read-only. So you can try out any of the read-only activities in subsequent tutorials in this mission (for other activities you will have to set up and run your own, as described in this tutorial).
107+
In case you haven't yet got round to running your own instance of the Northbreeze service, there's a publicly available instance that is fully read-only. So you can try out any of the read-only activities in subsequent tutorials in this mission (for other activities you will have to set up and run your own, as described in this tutorial).
108108

109109
Head over to <https://odd.cfapps.eu10.hana.ondemand.com/> ("odd" is short for "OData Deep Dive") to see the start page, and take a look around.
110110

111-
## Further info
111+
### Further info
112112

113113
- [Capire](https://cap.cloud.sap/docs/) - the official CAP documentation

tutorials/odata-dd-5-vocabularies/odata-dd-5-vocabularies.md

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ time: 20
1414

1515
## You will learn
1616

17-
- How annotations are organized into vocabularies
17+
- How vocabularies are used to organize annotations
1818
- How they're included within an OData metadata document
1919

2020
## Intro
@@ -30,7 +30,6 @@ In the previous [Metadata](https://developers.sap.com/tutorials/odata-dd-4-metad
3030
Here's what the relevant section of the wrapper in [the Northbreeze OData service's metadata document](https://odd.cfapps.eu10.hana.ondemand.com/northbreeze/$metadata) looks like:
3131

3232
```xml
33-
<?xml version="1.0" encoding="utf-8"?>
3433
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
3534
<edmx:Reference
3635
Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml">
@@ -80,12 +79,23 @@ we see that:
8079

8180
- the reference points to an [XML representation](https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml) of a CSDL document "Org.OData.Capabilities.V1"
8281
- moving one level up from that CSDL document resource's location, there is a [vocabularies overview page](https://oasis-tcs.github.io/odata-vocabularies/vocabularies/) listing each of the OASIS Technical Committee vocabularies, including this "Capabilities" one.
82+
![OASIS OData TC - Vocabularies](oasis-vocabularies-toc.png)
8383
- for each of these vocabulary resources there are HTML, XML and JSON representations
8484
- the HTML representation is especially useful for us as it describes the vocabulary's purpose in general, and gives details for each of the terms and types contained within it
8585

86-
![OASIS OData TC - Vocabularies](oasis-vocabularies-toc.png)
86+
Here's a visual representation of those resources at <https://oasis-tcs.github.io/odata-vocabularies/>:
87+
88+
```text
89+
vocabularies/ <-- vocabularies overview page
90+
|
91+
+-- Org.OData.Capabilities.V1.html <-- detailed info on the vocabulary & its terms
92+
|
93+
+-- Org.OData.Capabilities.V1.xml <-- an XML representation of the vocabulary
94+
|
95+
+-- Org.OData.Capabilities.V1.json <-- a JSON representation of the vocabulary
96+
```
8797

88-
If we look specifically at the [XML source](https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml) representation of the "Capabilities" vocabulary in CSDL form, we see this:
98+
If we look specifically at the [XML representation](https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml) of the "Capabilities" vocabulary in CSDL form, we see this:
8999

90100
```xml
91101
<?xml version="1.0" encoding="utf-8"?>
@@ -120,7 +130,7 @@ Anyway, there are two thing of note here:
120130
- this document _also_ has references to vocabularies
121131
- there is a single `<Schema>` element, with the OData namespace "Org.Data.Capabilities.V1"
122132

123-
And that specific schema is exactly the one that's referenced in the `<edmx:Include>` element within the `<edmx:Reference>` element:
133+
And that specific schema is exactly the one that's referenced in the `<edmx:Include>` element within our first `<edmx:Reference>` element:
124134

125135
```xml
126136
<edmx:Include Alias="Capabilities" Namespace="Org.OData.Capabilities.V1"/>
@@ -136,7 +146,7 @@ The `<edmx:Include>` element serves to identify a particular schema to be includ
136146

137147
### Take a first look at the annotations
138148

139-
Now we understand how vocabulary resources are referenced to be included into an OData metadata document, let's now take a first look at what annotations are used in this particular OData metadata document, and how.
149+
Now we understand how vocabulary resources are referenced to be included into an OData metadata document, and how they're used to organize annotations, let's now take a first look at what annotations are used in this particular OData metadata document, and how.
140150

141151
To set the scene, if we take brief look at the CSDL specification, we learn that:
142152

@@ -165,10 +175,21 @@ First, we see the "annotation as child element" approach where the annotation "C
165175
</Schema>
166176
```
167177

168-
Further on in the metadata document we see an example of the other approach, where `<Annotation>` elements appear as direct children of a containing `<Annotations>` element, and the schema elements to which the annotations are applied are specified in `Target` attributes):
178+
Here, "Core" is the annotation vocabulary, and "Links" is the term (we'll look in more detail at this in the next tutorial).
179+
180+
So in this case, the (entire) schema is being annotated with "Core.Links":
181+
182+
```text
183+
+--------+ +------+
184+
| | annotates | Core |
185+
| Schema | <-------------- +----------+
186+
| | | Links |
187+
+--------+ +----------+
188+
```
169189

170-
> Again, as explained in the previous [Metadata](https://developers.sap.com/tutorials/odata-dd-4-metadata.html) tutorial, in the "Get acquainted with the schema element" step, we'll leave out the XML namespace prefix `edm` her when writing elements that belong to that namespace.
190+
Further on in the metadata document we see an example of the other approach, where `<Annotation>` elements appear as direct children of a containing `<Annotations>` element, and the schema element to which the annotations are to be applied are specified in the `Target` attribute of that `<Annotations>` container:
171191

192+
> Again, as explained in the previous [Metadata](https://developers.sap.com/tutorials/odata-dd-4-metadata.html) tutorial, in the "Get acquainted with the schema element" step, we'll leave out the XML namespace prefix `edm` here when writing elements that belong to that namespace.
172193
173194
```xml
174195
<Schema Namespace="Main" xmlns="http://docs.oasis-open.org/odata/ns/edm">
@@ -207,4 +228,28 @@ Here, three different annotations terms:
207228

208229
are being applied via `Target="Main.EntityContainer/Categories"` to the "Categories" entityset in the entity container named "EntityContainer" in the "Main" OData namespace.
209230

231+
```text
232+
+--------------+
233+
| Capabilities |
234+
+--- +--------------------+
235+
| | DeleteRestrictions |
236+
| +--------------------+
237+
+----------------------+ |
238+
| Main.EntityContainer | | +--------------+
239+
+--------------------------+ annotates | | Capabilities |
240+
| Categories | <-----------+--- +--------------------+
241+
+--------------------------+ | | InsertRestrictions |
242+
| +--------------------+
243+
|
244+
| +--------------+
245+
| | Capabilities |
246+
+--- +--------------------+
247+
| UpdateRestrictions |
248+
+--------------------+
249+
```
250+
210251
In the next tutorial we'll dig in to the detail of the annotations used in this OData metadata document.
252+
253+
### Further info
254+
255+
- [OData @ SAP - SAP Vocabularies](https://sap.github.io/odata-vocabularies/)
94.9 KB
Loading
297 KB
Loading
185 KB
Loading

0 commit comments

Comments
 (0)