Skip to content

e.g. to for example #1081

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

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion about/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Following is an index of the features currently covered by CAP, with status and
| [Draft Support](../advanced/fiori#draft-support) | <X/> | <X/> | <X/> |
| [Draft for Localized Data](../advanced/fiori#draft-for-localized-data) | <X/> | <X/> | <X/> |
| [Support for Fiori Analytics](../advanced/analytics) | <X/> | <D/> | <X/> |
| [Support for other UI technologies, e.g. Vue.js](../get-started/in-a-nutshell#vue) <sup>1</sup> | <X/> | <X/> | <X/> |
| [Support for other UI technologies, for example Vue.js](../get-started/in-a-nutshell#vue) <sup>1</sup> | <X/> | <X/> | <X/> |

> <sup>1</sup> through standard REST/AJAX

Expand Down
2 changes: 1 addition & 1 deletion about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ cds.service.impl (function(){


// Emitting Events
// e.g. in this.on ('cancelOrder', ...)
// in this.on ('cancelOrder', ...)
let { ID } = req.data
this.emit ('orderCancelled', {ID})

Expand Down
2 changes: 1 addition & 1 deletion advanced/analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ You can use the following aggregations: `#SUM`, `#MAX`, `#MIN`, `#AVG`, `#COUNT_
### Introduction

An application can implement the Cloud Data Integration (CDI) protocol for exposing its data,
e.g. to act as a data provider for Data Plane Services (DPS).
for example, to act as a data provider for Data Plane Services (DPS).
Basically, this means that the app has to provide a set of OData V4 services as described
in the [CDI specification](https://github.tools.sap/DataPlane/cloud-data-integration-specification).
This is easy to achieve for a CAP application, as CAP provides generic OData exposure based on CDS models.
Expand Down
2 changes: 1 addition & 1 deletion advanced/hybrid-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ cds bind --exec [--] <command> <args ...>

Use the double-dash (`--`) if your command has args starting with a dash (`-`) character. Otherwise the `cds` command line will try to parse them as their own options.

On PowerShell you need to quote the double dash (`--`) when an option with double dash follows, e.g.
On PowerShell you need to quote the double dash (`--`) when an option with double dash follows:

```powershell
cds bind --exec '--' somecmd --someflag --some-double-dash-parameter 42
Expand Down
10 changes: 7 additions & 3 deletions advanced/odata.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ status: released

# Serving OData APIs

[[toc]]

## Feature Overview { #overview}

OData is an OASIS standard, which essentially enhances plain REST with standardized system query options like `$select`, `$expand`, `$filter`, etc. Find a rough overview of the feature coverage in the following table:
Expand Down Expand Up @@ -1201,12 +1203,14 @@ The cds build for OData v4 will render the entity type `Book` in `edmx` with the
</EntityType>
```

The entity `Book` is open, allowing the client to enrich the entity with additional properties, e.g.:
The entity `Book` is open, allowing the client to enrich the entity with additional properties.

Example 1:

```json
{"id": 1, "title": "Tow Sawyer"}
```
or
Example 2:

```json
{"title": "Tow Sawyer",
Expand All @@ -1226,7 +1230,7 @@ service CatalogService {
type Book {} // [!code focus]
}
```
Following payload for `Order` is allowed:
The following payload for `Order` is allowed:

`{"guid": 1, "book": {"id": 2, "title": "Tow Sawyer"}}`

Expand Down
1 change: 1 addition & 0 deletions advanced/publishing-apis/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ status: released

You can convert events in CDS models to the [AsyncAPI specification](https://www.asyncapi.com), a widely adopted standard used to describe and document message-driven asynchronous APIs.

[[toc]]

## Usage from CLI { #cli}

Expand Down
2 changes: 2 additions & 0 deletions advanced/publishing-apis/openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ status: released

You can convert CDS models to the [OpenAPI Specification](https://www.openapis.org), a widely adopted API description standard.

[[toc]]

## Usage from CLI { #cli}

For example, this is how you convert all services in `srv/` and store the API files in the `docs/` folder:
Expand Down
2 changes: 1 addition & 1 deletion cds/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ using sap from '@sap/cds/common';

// new code list for regions
entity Regions : sap.common.CodeList {
key code : String(5); // ISO 3166-2 alpha5 codes, e.g. DE-BW
key code : String(5); // ISO 3166-2 alpha5 codes, like DE-BW
country : Association to sap.common.Countries;
}

Expand Down
2 changes: 1 addition & 1 deletion guides/data-privacy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The first and frequently only task to do as an application developer is to ident

## Automatic Audit Logging {#transparency}

The **Transparancy** obligation, requests to be able to report with whom data stored about an individual is shared and where that came from (e.g., [EU GDPR Article 15(1)(c,g)](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:02016R0679-20160504&qid=1692819634946#tocId22)).
The **Transparancy** obligation, requests to be able to report with whom data stored about an individual is shared and where that came from (for example, [EU GDPR Article 15(1)(c,g)](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:02016R0679-20160504&qid=1692819634946#tocId22)).

The [SAP Audit Log Service](https://help.sap.com/docs/btp/sap-business-technology-platform/audit-logging-in-cloud-foundry-environment) stores all audit logs for a tenant in a common, compliant data store and allows auditors to search through and retrieve the respective logs when necessary.

Expand Down
2 changes: 1 addition & 1 deletion guides/databases-hana.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ let similarBooks = await SELECT.from('Books')
```

```java [Java]
// Vector embedding of text, e.g. from SAP GenAI Hub or via LangChain4j
// Vector embedding of text, for example, from SAP GenAI Hub or via LangChain4j
float[] embedding = embeddingModel.embed(bookDescription).content().vector();

Result similarBooks = service.run(Select.from(BOOKS).where(b ->
Expand Down
2 changes: 1 addition & 1 deletion guides/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The afore-mentioned packages use `cds-plugin` techniques to automatically config

The previous setups auto-wire things through configuration presets, which are automatically enabled via `cds-plugin` techniques. You can always use the basic configurations for other setups, or override individual properties as follows:

1. Install a database driver package, e.g.
1. Install a database driver package, for example:
```sh
npm add @cap-js/sqlite
```
Expand Down
14 changes: 7 additions & 7 deletions guides/domain-modeling.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,26 +178,26 @@ To easily distinguish type / entity names from elements names we recommend to..

::: tip Capitalize *Type / Entity* Names

* Start **_entity_** and **_type_** names with capital letters — e.g., `Authors`
* Start **_elements_** with a lowercase letter — e.g., `name`
* Start **_entity_** and **_type_** names with capital letters — for example, `Authors`
* Start **_elements_** with a lowercase letter — for example, `name`

:::

As entities represent not only data types, but also data sets, from which we can read from, we recommend following common SQL convention:

::: tip Pluralize *Entity* Names

* Use **plural** form for **_entities_** — e.g., `Authors`
* Use **singular** form for **_types_** — e.g., `Genre`
* Use **plural** form for **_entities_** — for example, `Authors`
* Use **singular** form for **_types_** — for example, `Genre`

:::

In general always prefer conciseness, comprehensibility and readability, and avoid overly lengthy names, probably dictated by overly strict systematics:

::: tip Prefer *Concise* Names

- Don't repeat contexts &rarr; e.g. `Authors.name` instead of `Authors.authorName`
- Prefer one-word names &rarr; e.g. `address` instead of `addressInformation`
- Don't repeat contexts &rarr; for example `Authors.name` instead of `Authors.authorName`
- Prefer one-word names &rarr; for example `address` instead of `addressInformation`
- Use `ID` for technical primary keys &rarr; see also [Use Canonic Primary Keys](#prefer-canonic-keys)

:::
Expand Down Expand Up @@ -498,7 +498,7 @@ entity Authors { ...
}
```

> The `on` condition can either compare a backlink association to `$self`, or a backlink foreign key to the own primary key, e.g. `books.author.ID = ID`.
> The `on` condition can either compare a backlink association to `$self`, or a backlink foreign key to the own primary key, for example `books.author.ID = ID`.

#### Many-to-Many Associations

Expand Down
2 changes: 1 addition & 1 deletion guides/localized-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ service CatalogService {

### `localized.` Helper Views

For each exposed entity in a service definition, and all intermediate views, a corresponding `localized.` entity is created. It has the same query clauses and all annotations, except for the `from` clause being redirected to the underlying entity's `localized.` counterpart. A helper view is only created if the corresponding entity contains at least one element with a `localized` property, or it exposes an association to an entity that is localized. You may need to cast an element if that property is not propagated, e.g. for expressions such as in `CatalogService.BooksShort`.
For each exposed entity in a service definition, and all intermediate views, a corresponding `localized.` entity is created. It has the same query clauses and all annotations, except for the `from` clause being redirected to the underlying entity's `localized.` counterpart. A helper view is only created if the corresponding entity contains at least one element with a `localized` property, or it exposes an association to an entity that is localized. You may need to cast an element if that property is not propagated, for example for expressions such as in `CatalogService.BooksShort`.

```cds
using { localized.Books } from './books_localized';
Expand Down
Loading
Loading