Skip to content

Commit 47adda4

Browse files
committed
Update Requests to use pick and format
1 parent a80a41a commit 47adda4

File tree

2 files changed

+78
-57
lines changed

2 files changed

+78
-57
lines changed

README.ja.md

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ NGSI-LD API は、複数の形式でコンテキスト・データを生成す
125125
がリクエストによって返されるわけではありません。たとえば、`unitCode``observedAt` などの第2レベルの属性は
126126
ペイロードに返されません。
127127

128-
#### `options=keyValues` を使用して簡略化されたNGSI-LD
128+
#### `format=simplified` を使用して簡略化されたNGSI-LD
129129

130130
```json
131131
{
@@ -168,7 +168,7 @@ API を使いやすくし、開発者の負担を軽減するために、NGSI-LD
168168
- すべての **LanguageProperty** は、`languageMap` key-value のペアによって定義されます
169169
- すべての **Relationship** は、`object` key-value のペアによって定義されます
170170

171-
#### Concise NGSI-LD using `options=concise`
171+
#### Concise NGSI-LD using `format=concise`
172172

173173
```json
174174
{
@@ -383,7 +383,8 @@ GET リクエストを行うことで、コンテキスト内で新しい **Temp
383383
完全に正規化された形式が返されます:
384384

385385
```console
386-
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
386+
curl -L -X GET \
387+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
387388
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
388389
```
389390

@@ -427,7 +428,8 @@ curl -iX POST 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Temperature
427428
GET リクエストを行うことで、コンテキスト内で新しい **TemperatureSensor** が見つかるかどうかを確認できます。
428429

429430
```console
430-
curl -L -X GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
431+
curl -L -X GET \
432+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
431433
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
432434
```
433435

@@ -583,7 +585,8 @@ curl -iX POST 'http://localhost:1026/ngsi-ld/v1/entityOperations/upsert' \
583585
#### 7️⃣ リクエスト:
584586

585587
```console
586-
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
588+
curl -G -iX GET \
589+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
587590
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
588591
-d 'options=concise,sysAttrs'
589592
```
@@ -643,9 +646,10 @@ TemperatureSensor `urn:ngsi-ld:TemperatureSensor:001` は _concise_ NGSI-LD と
643646
#### 8️⃣ リクエスト:
644647

645648
```console
646-
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
649+
curl -G -iX GET \
650+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
647651
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
648-
-d 'attrs=temperature'
652+
-d 'pick=id,type,temperature'
649653
```
650654

651655
#### レスポンス:
@@ -667,7 +671,7 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Temperatu
667671
}
668672
```
669673

670-
`options=concise` が使用されたため、これは `unitCode` などのメタデータを含むレスポンスですが `"type": "Property"`
674+
`format=concise` が使用されたため、これは `unitCode` などのメタデータを含むレスポンスですが `"type": "Property"`
671675
は含まれませんコンテキスト・データは、`/ngsi-ld/v1/entities/<entity-id>` に GET リクエストを行い、コンマ区切りの
672676
リストを使用して `attrs` を選択して取得できます。
673677

@@ -681,10 +685,11 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Temperatu
681685
#### 9️⃣ リクエスト:
682686

683687
```console
684-
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
688+
curl -G -iX GET \
689+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
685690
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
686691
-H 'Accept: application/json' \
687-
-d 'options=concise'
692+
-d 'format=concise'
688693
```
689694

690695
#### レスポンス:
@@ -714,7 +719,7 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Temperatu
714719
フィルタリングされていないリストが含まれています。`Accept: application/json` が設定されているため、ペイロード本体
715720
には `@context` 属性が含まれていません。
716721

717-
`options=concise` パラメータを `attrs` パラメータと組み合わせて、キーとバリューのペアの限定されたセットを取得します。
722+
`format=concise` パラメータを `attrs` パラメータと組み合わせて、キーとバリューのペアの限定されたセットを取得します。
718723

719724
<a name="read-multiple-attributes-values-from-a-data-entity"></a>
720725

@@ -726,11 +731,12 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Temperatu
726731
#### 1️⃣0️⃣ リクエスト:
727732

728733
```console
729-
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
734+
curl -G -iX GET \
735+
'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:TemperatureSensor:001' \
730736
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
731737
-H 'Accept: application/json' \
732-
-d 'options=concise' \
733-
-d 'attrs=category,temperature'
738+
-d 'format=concise' \
739+
-d 'pick=id,type,category,temperature'
734740
```
735741

736742
#### レスポンス:
@@ -749,7 +755,7 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Temperatu
749755
}
750756
```
751757

752-
`options=concise` パラメータと `attrs` パラメータを組み合わせて、値のリストを返します。
758+
`format=concise` パラメータと `attrs` パラメータを組み合わせて、値のリストを返します。
753759

754760
<a name="list-all-data-entities-concise"></a>
755761

@@ -760,10 +766,11 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Temperatu
760766
#### 1️⃣1️⃣ リクエスト:
761767

762768
```console
763-
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/' \
769+
curl -G -iX GET \
770+
'http://localhost:1026/ngsi-ld/v1/entities/' \
764771
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
765772
-d 'type=TemperatureSensor' \
766-
-d 'options=concise'
773+
-d 'format=concise'
767774
```
768775

769776
#### レスポンス:
@@ -845,12 +852,13 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/' \
845852
#### 1️⃣2️⃣ リクエスト:
846853

847854
```console
848-
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/' \
855+
curl -G -iX GET \
856+
'http://localhost:1026/ngsi-ld/v1/entities/' \
849857
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
850858
-H 'Accept: application/json' \
851859
-d 'type=TemperatureSensor' \
852-
-d 'options=concise' \
853-
-d 'attrs=temperature'
860+
-d 'format=concise' \
861+
-d 'pick=id,type,temperature'
854862
```
855863

856864
#### レスポンス:
@@ -895,7 +903,7 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/' \
895903
```
896904

897905
指定されたエンティティ・タイプのコンテキスト・データは、`/ngsi-ld/v1/entity/` エンドポイントに GET リクエストを行い、
898-
`type` パラメータを指定して、これを `options=keyValues` パラメータおよび キー値を取得するための `attrs` パラメータ
906+
`type` パラメータを指定して、これを `format=simplified` パラメータおよび キー値を取得するための `attrs` パラメータ
899907
と組み合わせることで取得できます。
900908

901909
<a name="filter-data-entities-by-id"></a>
@@ -909,12 +917,13 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/' \
909917
#### 1️⃣3️⃣ リクエスト:
910918

911919
```console
912-
curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/' \
920+
curl -G -iX GET \
921+
'http://localhost:1026/ngsi-ld/v1/entities/' \
913922
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
914923
-H 'Accept: application/json' \
915924
-d 'id=urn:ngsi-ld:TemperatureSensor:001,urn:ngsi-ld:TemperatureSensor:002' \
916-
-d 'attrs=temperature' \
917-
-d 'options=concise'
925+
-d 'pick=id,type,temperature' \
926+
-d 'format=concise'
918927
```
919928

920929
#### レスポンス:
@@ -946,18 +955,19 @@ curl -G -iX GET 'http://localhost:1026/ngsi-ld/v1/entities/' \
946955

947956
### GeoJSON としてデータを返す
948957

949-
簡潔な形式は、`Accept` ヘッダを `application/geo+json` に設定し、`options=concise` パラメータを設定することで
958+
簡潔な形式は、`Accept` ヘッダを `application/geo+json` に設定し、`format=concise` パラメータを設定することで
950959
リクエストできる GeoJSON 形式でも使用できます。
951960

952961
#### 1️⃣4️⃣ リクエスト:
953962

954963
```console
955-
curl -G -iX GET 'http://localhost:1026//ngsi-ld/v1/entities/' \
964+
curl -G -iX GET \
965+
'http://localhost:1026//ngsi-ld/v1/entities/' \
956966
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
957967
-H 'Accept: application/geo+json' \
958968
-H 'NGSILD-Tenant: openiot' \
959969
-d 'id=urn:ngsi-ld:Animal:pig010,urn:ngsi-ld:Animal:pig006' \
960-
-d 'options=concise'
970+
-d 'format=concise'
961971
```
962972

963973
#### レスポンス:

0 commit comments

Comments
 (0)