Skip to content

Commit

Permalink
Update responses
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Nov 28, 2024
1 parent a61063d commit 9ad321e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
4 changes: 4 additions & 0 deletions docs/ld-subscriptions-registrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ git checkout NGSI-v2
## Using Subscriptions with NGSI-LD
> [!NOTE]
>
> A full tutorial on NGSI-LD subscriptions can be found within the [NGSI-LD tutorial](https://ngsi-ld-tutorials.readthedocs.io/) documentation.
Goto `http://localhost:3000/app/store/urn:ngsi-ld:Building:store001` to display and interact with the Supermarket data.
### Create a Subscription (Store 1) - Low Stock
Expand Down
30 changes: 15 additions & 15 deletions docs/relationships-linked-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ passed in the previous request.
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld",
"id": "urn:ngsi-ld:Shelf:unit001",
"type": "https://fiware.github.io/tutorials.Step-by-Step/schema/Shelf",
"http://schema.org/name": {
"https://schema.org/name": {
"type": "Property",
"value": "Corner Unit"
},
Expand Down Expand Up @@ -827,14 +827,18 @@ curl -G -X GET \
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:unit001/' \
-d 'attrs=locatedIn' \
-d 'options=keyValues' \
-H 'Accept: application/ld+json' \
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
```

#### Response:

```json
{
"@context": "http://context/user-context.jsonld",
"@context": [
"http://context/user-context.jsonld",
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld",
],
"id": "urn:ngsi-ld:Shelf:unit001",
"type": "Shelf",
"locatedIn": "urn:ngsi-ld:Building:store001"
Expand Down Expand Up @@ -885,18 +889,13 @@ This is the reciprocal relationship to the `locatedIn` attribute on **Shelf**:
curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:store001/attrs' \
-H 'Content-Type: application/ld+json' \
--data-raw '{
"furniture": [
{
"type": "Relationship",
"datasetId": "urn:ngsi-ld:Relationship:1",
"object": "urn:ngsi-ld:Shelf:001"
},
{
"type": "Relationship",
"datasetId": "urn:ngsi-ld:Relationship:2",
"object": "urn:ngsi-ld:Shelf:002"
}
],
"furniture": {
"type": "Relationship",
"object": [
"urn:ngsi-ld:Shelf:001",
"urn:ngsi-ld:Shelf:002"
]
},
"@context": "http://context/user-context.jsonld"
}'
```
Expand Down Expand Up @@ -943,7 +942,7 @@ The **StockOrder** is created as a standard NGSI-LD data entity.

```bash
curl -X POST \
http://localhost:1026/ngsi-ld/v1/entities/ \
'http://localhost:1026/ngsi-ld/v1/entities/' \
-H 'Content-Type: application/ld+json' \
-d '{
"id": "urn:ngsi-ld:StockOrder:001",
Expand Down Expand Up @@ -1056,6 +1055,7 @@ adding the appropriate URN.
```bash
curl -G -X GET \
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:StockOrder:001' \
-H 'Accept: application/ld+json' \
-d 'options=keyValues'
```

Expand Down

0 comments on commit 9ad321e

Please sign in to comment.