Skip to content

Commit 11bcde3

Browse files
committed
Formatting texts
1 parent 6aad140 commit 11bcde3

24 files changed

Lines changed: 186 additions & 208 deletions

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,27 @@
44
[![License: MIT](https://img.shields.io/github/license/fiware/tutorials.Step-by-Step.svg)](https://opensource.org/licenses/MIT)
55
[![Support badge](https://img.shields.io/badge/tag-fiware-orange.svg?logo=stackoverflow)](https://stackoverflow.com/questions/tagged/fiware)
66
[![Docker](https://img.shields.io/docker/pulls/fiware/tutorials.context-provider.svg)](https://hub.docker.com/r/fiware/tutorials.context-provider/)
7-
<br>
8-
[![Documentation](https://img.shields.io/readthedocs/fiware-tutorials.svg)](https://fiware-tutorials.rtfd.io)
7+
<br> [![Documentation](https://img.shields.io/readthedocs/fiware-tutorials.svg)](https://fiware-tutorials.rtfd.io)
98
[![CI](https://github.com/FIWARE/tutorials.Step-by-Step/workflows/CI/badge.svg)](https://github.com/FIWARE/tutorials.Step-by-Step/actions?query=workflow%3ACI)
109

1110
This is a collection of tutorials for the FIWARE ecosystem designed for **NGSI-v2** developers. Each tutorial consists
1211
of a series of exercises to demonstrate the correct use of individual FIWARE components and shows the flow of context
1312
data within a simple Smart Solution either by connecting to a series of dummy IoT devices or manipulating the context
1413
directly or programmatically.
1514

16-
| :books: [NGSI-v2<br>Documentation](https://fiware-tutorials.rtfd.io) | <img src="https://assets.getpostman.com/common-share/postman-logo-stacked.svg" align="center" height="25"> [Postman<br>Collections](https://explore.postman.com/team/3mM5EY6ChBYp9D) | [![Docker Hub](https://nexus.lab.fiware.org/repository/raw/public/badges/docker/fiware.svg)](https://hub.docker.com/u/fiware) <br> [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/fiware)](https://artifacthub.io/packages/search?repo=fiware) | <img src="https://fiware.github.io/catalogue/img/fiware-emoji.png" height="20px" width="20px"/><br/> [**developer&ZeroWidthSpace;.fiware.org**](https://www.fiware.org/developers/) |
17-
| --------------------------------------------------------- | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
18-
15+
| :books: [NGSI-v2<br>Documentation](https://fiware-tutorials.rtfd.io) | <img src="https://assets.getpostman.com/common-share/postman-logo-stacked.svg" align="center" height="25"> [Postman<br>Collections](https://explore.postman.com/team/3mM5EY6ChBYp9D) | [![Docker Hub](https://nexus.lab.fiware.org/repository/raw/public/badges/docker/fiware.svg)](https://hub.docker.com/u/fiware) <br> [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/fiware)](https://artifacthub.io/packages/search?repo=fiware) | <img src="https://fiware.github.io/catalogue/img/fiware-emoji.png" height="20px" width="20px"/><br/> [**developer&ZeroWidthSpace;.fiware.org**](https://www.fiware.org/developers/) |
16+
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1917

2018
🇯🇵 このチュートリアルは[日本語](https://fiware-tutorials.letsfiware.jp/)でもご覧いただけます。<br/>
2119

2220
<h3>Data models</h3>
2321

2422
The following NGSI-v2 and NGSI-LD Data models are used within the tutorials:
2523

26-
- <img src="https://json-ld.org/favicon.ico" align="center" height="25"> [Tutorial-specific Data Models](https://fiware.github.io/tutorials.Step-by-Step/schema/)
27-
- <img src="https://json-ld.org/favicon.ico" align="center" height="25"> [Smart Data Models](https://smartdatamodels.org)
28-
24+
- <img src="https://json-ld.org/favicon.ico" align="center" height="25">
25+
[Tutorial-specific Data Models](https://fiware.github.io/tutorials.Step-by-Step/schema/)
26+
- <img src="https://json-ld.org/favicon.ico" align="center" height="25">
27+
[Smart Data Models](https://smartdatamodels.org)
2928

3029
## Install
3130

docs/accessing-context.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const options = {
8181
qs: { options: "keyValues" }
8282
};
8383

84-
request(options, function(error, response, body) {
84+
request(options, function (error, response, body) {
8585
if (error) throw new Error(error);
8686
console.log(body);
8787
});
@@ -307,7 +307,7 @@ GET request and make the necessary HTTP call:
307307

308308
```javascript
309309
function retrieveEntity(entityId, opts) {
310-
return new Promise(function(resolve, reject) {
310+
return new Promise(function (resolve, reject) {
311311
const apiInstance = new NgsiV2.EntitiesApi();
312312
apiInstance.retrieveEntity(entityId, opts, (error, data) => {
313313
return error ? reject(error) : resolve(data);
@@ -321,11 +321,11 @@ This enables us to wrap the requests in `Promises` as shown:
321321
```javascript
322322
function displayStore(req, res) {
323323
retrieveEntity(req.params.storeId, { options: "keyValues", type: "Store" })
324-
.then(store => {
324+
.then((store) => {
325325
// If a store has been found display it on screen
326326
return res.render("store", { title: store.name, store });
327327
})
328-
.catch(error => {
328+
.catch((error) => {
329329
debug(error);
330330
// If no store has been found, display an error screen
331331
return res.render("store-error", { title: "Error", error });
@@ -427,22 +427,22 @@ function displayTillInfo(req, res) {
427427
type: "InventoryItem"
428428
})
429429
])
430-
.then(values => {
430+
.then((values) => {
431431
// If values have been found display it on screen
432432
return res.render("till", {
433433
products: values[0],
434434
inventory: values[1]
435435
});
436436
})
437-
.catch(error => {
437+
.catch((error) => {
438438
debug(error);
439439
// An error occurred, return with no results
440440
return res.render("till", { products: {}, inventory: {} });
441441
});
442442
}
443443

444444
function listEntities(opts) {
445-
return new Promise(function(resolve, reject) {
445+
return new Promise(function (resolve, reject) {
446446
const apiInstance = new NgsiV2.EntitiesApi();
447447
apiInstance.listEntities(opts, (error, data) => {
448448
return error ? reject(error) : resolve(data);
@@ -516,7 +516,7 @@ async function buyItem(req, res) {
516516
}
517517

518518
function updateExistingEntityAttributes(entityId, body, opts) {
519-
return new Promise(function(resolve, reject) {
519+
return new Promise(function (resolve, reject) {
520520
const apiInstance = new NgsiV2.EntitiesApi();
521521
apiInstance.updateExistingEntityAttributes(entityId, body, opts, (error, data) => {
522522
return error ? reject(error) : resolve(data);

docs/administrating-xacml.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ function authorizeAdvancedXACML(req, res, next, resource = req.url) {
10361036
10371037
return oa
10381038
.get(keyrockUserUrl)
1039-
.then(response => {
1039+
.then((response) => {
10401040
const user = JSON.parse(response);
10411041
return azf.policyDomainRequest(
10421042
user.app_azf_domain,
@@ -1047,11 +1047,11 @@ function authorizeAdvancedXACML(req, res, next, resource = req.url) {
10471047
user.email
10481048
);
10491049
})
1050-
.then(authzforceResponse => {
1050+
.then((authzforceResponse) => {
10511051
res.locals.authorized = authzforceResponse === "Permit";
10521052
return next();
10531053
})
1054-
.catch(error => {
1054+
.catch((error) => {
10551055
debug(error);
10561056
res.locals.authorized = false;
10571057
return next();
@@ -1082,9 +1082,9 @@ function policyDomainRequest(domain, roles, resource, action, username, email) {
10821082
};
10831083
10841084
return new Promise((resolve, reject) => {
1085-
request(options, function(error, response, body) {
1085+
request(options, function (error, response, body) {
10861086
let decision;
1087-
xml2js.parseString(body, { tagNameProcessors: [xml2js.processors.stripPrefix] }, function(err, jsonRes) {
1087+
xml2js.parseString(body, { tagNameProcessors: [xml2js.processors.stripPrefix] }, function (err, jsonRes) {
10881088
// The decision is found within the /Response/Result[0]/Decision[0] XPath
10891089
decision = jsonRes.Response.Result[0].Decision[0];
10901090
});

docs/application-mashups.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,9 @@ Amend the coordinates setting as shown below and click accept.
426426

427427
![](https://fiware.github.io/tutorials.Application-Mashup/img/ngsi-to-poi-settings.png)
428428

429-
According to the Smart Data Models
430-
[Guidelines](https://smartdatamodels.org/) an attribute
431-
called `location` should be used for geographical coordinates. Coordinates should be encoded using GeoJSON. Since this
432-
convention has been used for the tutorial data, the widget knows how to extract a location from the `Store` entity.
429+
According to the Smart Data Models [Guidelines](https://smartdatamodels.org/) an attribute called `location` should be
430+
used for geographical coordinates. Coordinates should be encoded using GeoJSON. Since this convention has been used for
431+
the tutorial data, the widget knows how to extract a location from the `Store` entity.
433432

434433
### Open Layers Map Widget
435434

@@ -463,5 +462,5 @@ Clicking on the POIs retrieves additional data from each stores.
463462

464463
Currently the data is displayed as unformatted JSON. This is because the `Store` context data entities with the tutorial
465464
example are not using a standard FIWARE data model. If a standard data model such as
466-
[Building](https://github.com/smart-data-models/dataModel.Building) had been used the
467-
data would be formatted in an appropriate manner and a **Building** specific icon would be used.
465+
[Building](https://github.com/smart-data-models/dataModel.Building) had been used the data would be formatted in an
466+
appropriate manner and a **Building** specific icon would be used.

docs/crud-operations.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,12 +759,11 @@ Context data for a specified entity type can be retrieved by making a GET reques
759759
supplying the `type` parameter. Combine this with `options=count` and `attrs=__NONE` to return the `id` attributes of
760760
the given `type`.
761761

762-
> **Note:** The NGSIv2 specification specifies that `attrs=` has to be a "comma-separated list of attribute names
763-
> whose data are to be included in the response". `id` and `type` are not allowed to be used as attribute names. If you
762+
> **Note:** The NGSIv2 specification specifies that `attrs=` has to be a "comma-separated list of attribute names whose
763+
> data are to be included in the response". `id` and `type` are not allowed to be used as attribute names. If you
764764
> specify a name that does not exist in attributes, such as `__NONE` to the `attrs=` parameter, No attribute will match
765765
> and you will always retrieve only the `id` and `type` of the entity.
766766

767-
768767
## Update Operations
769768

770769
Overwrite operations are mapped to HTTP PUT. HTTP PATCH can be used to update several attributes at once.

docs/custom-iot-agent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ This means that attributes from the XML request can be accessed using the square
377377

378378
```javascript
379379
function checkMandatoryParams(queryPayload) {
380-
return function(req, res, next) {
380+
return function (req, res, next) {
381381
var notFoundParams = [],
382382
error;
383383

@@ -681,7 +681,7 @@ function createCommandPayload(device, command, attributes) {
681681
if (typeof attributes === "object") {
682682
let payload = "<" + command + ' device="' + device.id + '">';
683683

684-
Object.keys(attributes).forEach(function(key, value) {
684+
Object.keys(attributes).forEach(function (key, value) {
685685
payload = payload + "<" + key + ">" + value + "</" + key + ">";
686686
});
687687
payload = payload + "</" + command + ">";

docs/edge-computing.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[![FIWARE Context processing, analysis and visualisation](https://nexus.lab.fiware.org/static/badges/chapters/processing.svg)](https://github.com/FIWARE/catalogue/blob/master/processing/README.md)
22

3-
**Description:** This is an introductory tutorial for [FIWARE FogFlow](https://fogflow.readthedocs.io/en/latest/) that allows its users
4-
to dynamically orchestrate the processing flows on edges. It explains how to enable FogFlow on a distributed or a single
5-
node system, register user defined workload patterns and orchestrate them on the edges in the form of running tasks. For
6-
better understanding, examples have been included in the tutorial.
3+
**Description:** This is an introductory tutorial for [FIWARE FogFlow](https://fogflow.readthedocs.io/en/latest/) that
4+
allows its users to dynamically orchestrate the processing flows on edges. It explains how to enable FogFlow on a
5+
distributed or a single node system, register user defined workload patterns and orchestrate them on the edges in the
6+
form of running tasks. For better understanding, examples have been included in the tutorial.
77

88
<hr class="processing"/>
99

@@ -569,10 +569,9 @@ other FIWARE GEs.
569569
[tutorial](https://fogflow.readthedocs.io/en/latest/quantumleapIntegration.html).
570570

571571
- **Integrate FogFlow with WireCloud**: FogFlow has pitched in with different and versatile edge platform technology.
572-
WireCloud builds on cutting-edge end user development, RIA and semantic technologies to offer a next-generation
573-
end user centred web application mashup platform aimed at leveraging the long tail of the Internet of Services. For
574-
more on Fogflow and WireCloud, follow the
575-
[tutorial](https://fogflow.readthedocs.io/en/latest/wirecloudIntegration.html).
572+
WireCloud builds on cutting-edge end user development, RIA and semantic technologies to offer a next-generation end
573+
user centred web application mashup platform aimed at leveraging the long tail of the Internet of Services. For more
574+
on Fogflow and WireCloud, follow the [tutorial](https://fogflow.readthedocs.io/en/latest/wirecloudIntegration.html).
576575

577576
---
578577

docs/entity-relationships.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,8 @@ In databases, foreign keys are often used to designate a one-to-many relationshi
321321
a single store and a single store can hold many shelving units. In order to remember this information we need to add an
322322
association relationship similar to a foreign key. Batch processing can again be used to amend the existing the
323323
**Shelf** entities to add a `refStore` attribute holding the relationship to each store. According to the Smart Data
324-
Models Guidelines on
325-
[linked data](https://smartdatamodels.org/), when an
326-
entity attribute is used as a link to other entities it should be named with the prefix `ref` plus the name of the
327-
target (linked) entity type.
324+
Models Guidelines on [linked data](https://smartdatamodels.org/), when an entity attribute is used as a link to other
325+
entities it should be named with the prefix `ref` plus the name of the target (linked) entity type.
328326

329327
The value of the `refStore` attribute corresponds to a URN associated to a **Store** entity itself.
330328

docs/getting-started.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ curl -iX POST \
264264

265265
Although the each data entity within your context will vary according to your use case, the common structure within each
266266
data entity should be standardized order to promote reuse. The full FIWARE data model guidelines can be found
267-
[here](https://smartdatamodels.org/). This tutorial demonstrates the usage
268-
of the following recommendations:
267+
[here](https://smartdatamodels.org/). This tutorial demonstrates the usage of the following recommendations:
269268

270269
#### All terms are defined in American English
271270

docs/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ Scala code into a JAR file.
9191

9292
The following NGSI-v2 and NGSI-LD Data models are used within the tutorials:
9393

94-
- <img src="https://json-ld.org/favicon.ico" align="center" height="30" width="30" style="border-right-style:solid; border-right-width:10px; border-color:transparent; background: transparent"> [Tutorial-specific Data Models](https://fiware.github.io/tutorials.Step-by-Step/schema/)
95-
- <img src="https://json-ld.org/favicon.ico" align="center" height="30" width="30" style="border-right-style:solid; border-right-width:10px; border-color:transparent; background: transparent"> [Smart Data Models](https://smartdatamodels.org)
94+
- <img src="https://json-ld.org/favicon.ico" align="center" height="30" width="30" style="border-right-style:solid; border-right-width:10px; border-color:transparent; background: transparent">
95+
[Tutorial-specific Data Models](https://fiware.github.io/tutorials.Step-by-Step/schema/)
96+
- <img src="https://json-ld.org/favicon.ico" align="center" height="30" width="30" style="border-right-style:solid; border-right-width:10px; border-color:transparent; background: transparent">
97+
[Smart Data Models](https://smartdatamodels.org)
9698

9799
## List of Tutorials
98100

0 commit comments

Comments
 (0)