Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Aug 2, 2023
1 parent 077bade commit 2722d89
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 18 deletions.
37 changes: 27 additions & 10 deletions docs/entity-relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,40 +288,57 @@ The following request associates six devices to `urn:ngsi-ld:Building:farm001`,
`urn:ngsi-ld:Building:farm002`

```bash
curl -G -iX POST 'http://localhost:1026/ngsi-ld/v1/entityOperations/upsert' \
-d 'options=update' \
curl -L 'http://localhost:1026/ngsi-ld/v1/entityOperations/update?options=update' \
-H 'Content-Type: application/json' \
-H 'Link: <http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
--data-raw '[
-d '[
{
"id": "urn:ngsi-ld:TemperatureSensor:001",
"type": "TemperatureSensor",
"controlledAsset": {"type": "Relationship", "object": "urn:ngsi-ld:Building:farm001"}
"controllingAsset": {
"type": "Relationship",
"object": "urn:ngsi-ld:Building:farm001"
}
},
{
"id": "urn:ngsi-ld:TemperatureSensor:002",
"type": "TemperatureSensor",
"controlledAsset": {"type": "Relationship", "object": "urn:ngsi-ld:Building:barn002"}
"controllingAsset": {
"type": "Relationship",
"object": "urn:ngsi-ld:Building:barn002"
}
},
{
"id": "urn:ngsi-ld:FillingLevelSensor:003",
"type": "FillingLevelSensor",
"controlledAsset": {"type": "Relationship", "object": "urn:ngsi-ld:Building:farm002"}
"controllingAsset": {
"type": "Relationship",
"object": "urn:ngsi-ld:Building:farm002"
}
},
{
"id": "urn:ngsi-ld:FillingLevelSensor:001",
"type": "FillingLevelSensor",
"controlledAsset": {"type": "Relationship", "object": "urn:ngsi-ld:Building:farm001"}
"controllingAsset": {
"type": "Relationship",
"object": "urn:ngsi-ld:Building:farm001"
}
},
{
"id": "urn:ngsi-ld:FillingLevelSensor:002",
"type": "FillingLevelSensor",
"controlledAsset": {"type": "Relationship", "object": "urn:ngsi-ld:Building:barn002"}
"controllingAsset": {
"type": "Relationship",
"object": "urn:ngsi-ld:Building:barn002"
}
},
{
"id": "urn:ngsi-ld:TemperatureSensor:003",
"type": "TemperatureSensor",
"controlledAsset": {"type": "Relationship", "object": "urn:ngsi-ld:Building:farm002"}
"controllingAsset": {
"type": "Relationship",
"object": "urn:ngsi-ld:Building:farm002"
}
}
]'
```
Expand Down Expand Up @@ -544,7 +561,7 @@ this data into another entity. For example, the temperature reading of a sensor
reading of the barn itself. A dummy reading has already been added into the `urn:ngsi-ld:Building:farm001` Entity and
can be retrieved with a GET request:

#### 1:two: Request:
#### 12 Request:

```bash
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:farm001' \
Expand Down
14 changes: 7 additions & 7 deletions docs/iot-sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ not supply any measurements from the real world.
This example shows how a real IoT Agent would send commands to an actuator. The **Irrigation System** has supplied an
endpoint `/iot/water001` where it is listening for commands.

#### :one: Request:
#### 1 Request:

```bash
curl -iX POST 'localhost:3001/iot/water001' \
Expand Down Expand Up @@ -324,7 +324,7 @@ If you are viewing the device monitor page, you can see the state of the water s
This example shows how to turn off the irrigation system. In this case, the device is also listening for multiple
commands off a single endpoint and interpreting the payload body.
#### :two: Request:
#### 2 Request:
```bash
curl -L -X POST 'localhost:3001/iot/water001' \
Expand Down Expand Up @@ -355,7 +355,7 @@ This example shows how a real IoT Agent would send an Ultralight command to a **
to an active state. The unit with the **Tractor** itself has already supplied an endpoint `/iot/tractor001` where it is
listening for commands.

#### :three: Request:
#### 3 Request:

```bash
curl -iX POST \
Expand Down Expand Up @@ -383,7 +383,7 @@ monitor page.
This example shows how a real IoT Agent would send an Ultralight command to a **Tractor** FMIS to return the vehicle to
an idle state. The **Tractor** has already supplied an endpoint `/iot/tractor001` where it is listening for commands.

#### :four: Request:
#### 4 Request:

```bash
curl -iX POST \
Expand All @@ -407,7 +407,7 @@ Once the lamp is switched off the gps location does not alter. The latest Ultral

To turn the **Tractor** back on again repeat the following command:

#### :five: Request:
#### 5 Request:

```bash
curl -iX POST \
Expand Down Expand Up @@ -435,7 +435,7 @@ Measurements will be sent to the IoT Agent as the state changes.
This example shows how a real IoT Agent would send an Ultralight command to a **Filling Station** to unload the barn.
The **Filling Station** has already supplied an endpoint `/iot/filling001` where it is listening for commands.

#### :five: Request:
#### 6 Request:

```bash
curl -iX POST \
Expand Down Expand Up @@ -473,7 +473,7 @@ This example simulates a request coming from the device `humidity001`.
The request to the previously provisioned resource `iot/d` is in UltraLight 2.0 format and identifies the device
`humidity` and passes a known API key.

#### :six: Request:
#### 7 Request:

```bash
curl -L -X POST 'http://localhost:7896/iot/d?k=4jggokgpepnvsb2uv4s40d59ov&i=humidity001' \
Expand Down
6 changes: 5 additions & 1 deletion docs/short-term-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ This example shows the last 3 changes from the entity `urn:ngsi-ld:Animal:cow002
entity attribute, send a GET request to `../temporal/entities/<entity-id>`, the `lastN` parameter restricts the result
to N values.

#### :one: Request:
#### 1 Request:

```bash
curl -G -X GET 'http://localhost:8080/temporal/entities/urn:ngsi-ld:Animal:cow002' \
Expand All @@ -304,6 +304,10 @@ request is returning full normalized JSON-LD for every value, which includes _pr
which Devices have the provided various readings and which units are being used. Every value has an associated
`instanceId` which can be used for further manipulation of the individual entries where supported.

> **TIP:** if the response is empty, you probably haven't started generating
> any context data yet. Remember to start up the tractor first as described
> [here](#generating-context-data)

In the example below, `heartRate` and `location` have been provided by a single Device.

```json
Expand Down

0 comments on commit 2722d89

Please sign in to comment.