Skip to content

Commit

Permalink
Amend responses.
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Jul 25, 2024
1 parent 0aa0899 commit 3345637
Showing 1 changed file with 67 additions and 53 deletions.
120 changes: 67 additions & 53 deletions docs/working-with-linked-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,13 @@ And the response from the broker is:

```json
{
"@context": "https://context/ngsi-context.jsonld",
"id": "urn:ngsi-ld:Building:store001",
"type": "Building",
"furniture": ["urn:ngsi-ld:Shelf:unit001", "urn:ngsi-ld:Shelf:unit002", "urn:ngsi-ld:Shelf:unit003"]
"furniture": [
"urn:ngsi-ld:Shelf:unit001",
"urn:ngsi-ld:Shelf:unit002",
"urn:ngsi-ld:Shelf:unit003"
]
}
```

Expand Down Expand Up @@ -419,21 +422,18 @@ further.
```json
[
{
"@context": "http://context/ngsi-context.jsonld",
"id": "urn:ngsi-ld:Shelf:unit001",
"type": "Shelf",
"numberOfItems": 15,
"stocks": "urn:ngsi-ld:Product:001"
},
{
"@context": "http://context/ngsi-context.jsonld",
"id": "urn:ngsi-ld:Shelf:unit002",
"type": "Shelf",
"numberOfItems": 15,
"stocks": "urn:ngsi-ld:Product:003"
},
{
"@context": "http://context/ngsi-context.jsonld",
"id": "urn:ngsi-ld:Shelf:unit003",
"type": "Shelf",
"numberOfItems": 15,
Expand Down Expand Up @@ -548,41 +548,24 @@ And the response from the broker is the following with nine shelves:

```json
[
{
"id": "urn:ngsi-ld:Shelf:unit001",
"type": "Shelf",
"locatedIn": "urn:ngsi-ld:Building:store001",
"maxCapacity": 50,
"numberOfItems": 15,
"stocks": "urn:ngsi-ld:Product:001",
"name": "Corner Unit",
"location": {
"type": "Point",
"coordinates": [
13.398611,
52.554699
]
}
},
{
"id": "urn:ngsi-ld:Shelf:unit002",
"type": "Shelf",
"locatedIn": "urn:ngsi-ld:Building:store001",
"maxCapacity": 100,
"numberOfItems": 15,
"stocks": "urn:ngsi-ld:Product:003",
"name": "Wall Unit 1",
"location": {
"type": "Point",
"coordinates": [
13.398722,
52.554664
]
{
"id": "urn:ngsi-ld:Shelf:unit001",
"type": "Shelf",
"location": {
"type": "Point",
"coordinates": [
13.398611,
52.554699
]
},
"maxCapacity": 50,
"numberOfItems": 15,
"name": "Corner Unit",
"stocks": "urn:ngsi-ld:Product:001",
"locatedIn": "urn:ngsi-ld:Building:store001"
}
},
... etc.
...etc
]
```

Expand Down Expand Up @@ -737,9 +720,12 @@ also returns the standard enumeration for **Building** `category`.

```json
{
"@context": "http://context/ngsi-context.jsonld",
"id": "urn:ngsi-ld:Building:store005",
"type": "Building",
"category": {
"type": "VocabularyProperty",
"vocab": "commercial"
},
"address": {
"type": "Property",
"value": {
Expand All @@ -751,10 +737,18 @@ also returns the standard enumeration for **Building** `category`.
},
"location": {
"type": "GeoProperty",
"value": { "type": "Point", "coordinates": [13.5646, 52.5435] }
"value": {
"type": "Point",
"coordinates": [
13.5646,
52.5435
]
}
},
"name": { "type": "Property", "value": "Yuusui-en" },
"category": { "type": "VocabularyProperty", "vocab": "commercial" }
"name": {
"type": "Property",
"value": "Yuusui-en"
}
}
```

Expand All @@ -776,7 +770,7 @@ supplied in the `Link` header.
```console
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:store003' \
-H 'Content-Type: application/json' \
-H 'Link: <http://context/japanese-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
-H 'Link: <http://context/japanese-user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
```

#### Response:
Expand All @@ -791,7 +785,7 @@ exceptions. NGSI-LD **is not** JSON-LD, in that the core context is always appli
"type": "ビル",
"カテゴリー": {
"type": "VocabularyProperty",
"vocab": ["コマーシャル"]
"vocab": "コマーシャル"
},
"住所": {
"type": "Property",
Expand All @@ -810,7 +804,10 @@ exceptions. NGSI-LD **is not** JSON-LD, in that the core context is always appli
"type": "GeoProperty",
"value": {
"type": "Point",
"coordinates": [13.4447, 52.5031]
"coordinates": [
13.4447,
52.5031
]
}
},
"名前": {
Expand All @@ -819,7 +816,11 @@ exceptions. NGSI-LD **is not** JSON-LD, in that the core context is always appli
},
"家具": {
"type": "Relationship",
"object": ["urn:ngsi-ld:Shelf:unit006", "urn:ngsi-ld:Shelf:unit007", "urn:ngsi-ld:Shelf:unit008"]
"object": [
"urn:ngsi-ld:Shelf:unit006",
"urn:ngsi-ld:Shelf:unit007",
"urn:ngsi-ld:Shelf:unit008"
]
}
}
```
Expand Down Expand Up @@ -883,17 +884,30 @@ payload before sending data to the context broker.
"識別子": "urn:ngsi-ld:Building:store005",
"タイプ": "ビル",
"住所": {
"addressLocality": "Marzahn",
"addressRegion": "Berlin",
"postalCode": "12685",
"streetAddress": "Eisenacher Straße 98"
"タイプ": "プロパティ",
"値": {
"addressLocality": "Marzahn",
"addressRegion": "Berlin",
"postalCode": "12685",
"streetAddress": "Eisenacher Straße 98"
}
},
"名前": {
"タイプ": "プロパティ",
"値": "Yuusui-en"
},
"名前": "Yuusui-en",
"場所": {
"タイプ": "場",
"座標": [13.5646, 52.5435]
"タイプ": "ジオプロパティ",
"値": {
"タイプ": "場",
"座標": [
13.5646,
52.5435
]
}
},
"カテゴリー": {
"タイプ": "グロッサリープロパティ",
"語彙": "コマーシャル"
}
}
Expand Down

0 comments on commit 3345637

Please sign in to comment.