Skip to content

Commit 47957ed

Browse files
committed
Fixing Vocab Property expansion.
1 parent bc38655 commit 47957ed

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

FIWARE Working with @context.postman_collection.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
],
111111
"body": {
112112
"mode": "raw",
113-
"raw": "{\n \"id\": \"urn:ngsi-ld:Building:farm001\",\n \"type\": \"Building\",\n \"category\": {\n \t\"type\": \"Property\",\n \"value\": [\"farm\"]\n },\n \"address\": {\n \"type\": \"Property\",\n \"value\": {\n \"streetAddress\": \"Großer Stern 1\",\n \"addressRegion\": \"Berlin\",\n \"addressLocality\": \"Tiergarten\",\n \"postalCode\": \"10557\"\n },\n \"verified\": {\n\t\t\t\"type\": \"Property\",\n\t\t\t\"value\": true\n\t\t}\n },\n \"location\": {\n \"type\": \"GeoProperty\",\n \"value\": {\n \"type\": \"Point\",\n \"coordinates\": [13.3505, 52.5144]\n }\n },\n \"name\": {\n \"type\": \"Property\",\n \"value\": \"Victory Farm\"\n },\n \"@context\": \"http://context/ngsi-context.jsonld\"\n}"
113+
"raw": "{\n \"id\": \"urn:ngsi-ld:Building:farm001\",\n \"type\": \"Building\",\n \"category\": {\n \t\"type\": \"VocabProperty\",\n \"vocab\": [\"farm\"]\n },\n \"address\": {\n \"type\": \"Property\",\n \"value\": {\n \"streetAddress\": \"Großer Stern 1\",\n \"addressRegion\": \"Berlin\",\n \"addressLocality\": \"Tiergarten\",\n \"postalCode\": \"10557\"\n },\n \"verified\": {\n\t\t\t\"type\": \"Property\",\n\t\t\t\"value\": true\n\t\t}\n },\n \"location\": {\n \"type\": \"GeoProperty\",\n \"value\": {\n \"type\": \"Point\",\n \"coordinates\": [13.3505, 52.5144]\n }\n },\n \"name\": {\n \"type\": \"Property\",\n \"value\": \"Victory Farm\"\n },\n \"@context\": \"http://context/ngsi-context.jsonld\"\n}"
114114
},
115115
"url": {
116116
"raw": "http://{{context-broker}}/ngsi-ld/v1/entities/",
@@ -189,7 +189,7 @@
189189
],
190190
"body": {
191191
"mode": "raw",
192-
"raw": "{\n \"id\": \"urn:ngsi-ld:Building:barn002\",\n \"type\": \"Building\",\n \"category\": {\n \t\"type\": \"Property\",\n \"value\": [\"barn\"]\n },\n \"address\": {\n \"type\": \"Property\",\n \"value\": {\n \"streetAddress\": \"Straße des 17. Juni\",\n \"addressRegion\": \"Berlin\",\n \"addressLocality\": \"Tiergarten\",\n \"postalCode\": \"10557\"\n },\n \"verified\": {\n\t\t\t\"type\": \"Property\",\n\t\t\t\"value\": true\n\t\t}\n },\n \"location\": {\n \"type\": \"GeoProperty\",\n \"value\": {\n \"type\": \"Point\",\n \"coordinates\": [13.3698, 52.5163]\n }\n },\n \"name\": {\n \"type\": \"Property\",\n \"value\": \"Big Red Barn\"\n }\n}"
192+
"raw": "{\n \"id\": \"urn:ngsi-ld:Building:barn002\",\n \"type\": \"Building\",\n \"category\": {\n \t\"type\": \"VocabProperty\",\n \"vocab\": [\"barn\"]\n },\n \"address\": {\n \"type\": \"Property\",\n \"value\": {\n \"streetAddress\": \"Straße des 17. Juni\",\n \"addressRegion\": \"Berlin\",\n \"addressLocality\": \"Tiergarten\",\n \"postalCode\": \"10557\"\n },\n \"verified\": {\n\t\t\t\"type\": \"Property\",\n\t\t\t\"value\": true\n\t\t}\n },\n \"location\": {\n \"type\": \"GeoProperty\",\n \"value\": {\n \"type\": \"Point\",\n \"coordinates\": [13.3698, 52.5163]\n }\n },\n \"name\": {\n \"type\": \"Property\",\n \"value\": \"Big Red Barn\"\n }\n}"
193193
},
194194
"url": {
195195
"raw": "http://{{context-broker}}/ngsi-ld/v1/entities/",
@@ -407,7 +407,7 @@
407407
}
408408
],
409409
"url": {
410-
"raw": "http://{{context-broker}}/ngsi-ld/v1/entities/?type=Building&q=category==\"barn\",\"farm_auxiliary\"&options=keyValues",
410+
"raw": "http://{{context-broker}}/ngsi-ld/v1/entities/?type=Building&q=category==\"barn\",\"farm_auxiliary\"&options=keyValues&expandValues=category",
411411
"protocol": "http",
412412
"host": [
413413
"{{context-broker}}"
@@ -431,6 +431,10 @@
431431
"key": "options",
432432
"value": "keyValues",
433433
"description": "* `keyValues` option in order to get a more compact and brief representation, including just attribute values\n* `values` option combined with a list of attribute values `attrs` for an ordered list of attributes only"
434+
},
435+
{
436+
"key": "expandValues",
437+
"value": "category"
434438
}
435439
]
436440
},

README.ja.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,9 @@ curl -G -X GET \
897897
"postalCode": "10557"
898898
},
899899
"name": "Big Red Barn",
900-
"kategorie": "barn",
900+
"kategorie": {
901+
"vocab": "scheune"
902+
},
901903
"location": {
902904
"type": "Point",
903905
"coordinates": [
@@ -916,7 +918,7 @@ curl -G -X GET \
916918

917919
### 配列内の属性の値を比較してコンテキスト・データをフィルタリング
918920

919-
標準の `Building` モデル内で、`category` 属性は文字列の配列を参照します。この例では、`commercial` または `office`
921+
標準の `Building` モデル内で、`category` 属性は文字列の配列を参照します。この例では、`barn` または `farm_auxiliary`
920922
文字列を含む `category` 属性を持つすべての `Building` エンティティを返します。フィルタリングは、`q`
921923
パラメータを使用して、許容値をカンマで区切って行うことができます。
922924

@@ -929,7 +931,8 @@ curl -G -X GET \
929931
-H 'Accept: application/ld+json' \
930932
-d 'type=Building' \
931933
-d 'q=category==%22barn%22,%22farm_auxiliary%22' \
932-
-d 'options=keyValues'
934+
-d 'options=keyValues'\
935+
-d 'expandValues=category'
933936
```
934937

935938
#### レスポンス:

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ be displayed.
558558
"id": "urn:ngsi-ld:Building:farm001",
559559
"type": "https://smartdatamodels.org/dataModel.Building/Building",
560560
"https://smartdatamodels.org/dataModel.Building/category": {
561-
"type": "Property",
562-
"value": "farm"
561+
"type": "VocabProperty",
562+
"vocab": "https://wiki.openstreetmap.org/wiki/Tag:building%3Dfarm"
563563
},
564564
"https://schema.org/address": {
565565
"type": "Property",
@@ -594,8 +594,8 @@ be displayed.
594594
"id": "urn:ngsi-ld:Building:barn002",
595595
"type": "https://smartdatamodels.org/dataModel.Building/Building",
596596
"https://smartdatamodels.org/dataModel.Building/category": {
597-
"type": "Property",
598-
"value": "barn"
597+
"type": "VocabProperty",
598+
"vocab": "https://wiki.openstreetmap.org/wiki/Tag:building%3Dbarn"
599599
},
600600
"https://schema.org/address": {
601601
"type": "Property",
@@ -887,7 +887,9 @@ directly but would require an additional **JSON-LD** expansion/compaction operat
887887
"postalCode": "10557"
888888
},
889889
"name": "Big Red Barn",
890-
"kategorie": "barn",
890+
"kategorie": {
891+
"vocab": "scheune"
892+
},
891893
"location": {
892894
"type": "Point",
893895
"coordinates": [13.3698, 52.5163]
@@ -902,7 +904,7 @@ It should also be noted that the sub-attributes of the `addresse` have also not
902904
### Filter context data by comparing the values of an attribute in an Array
903905

904906
Within the standard `Building` model, the `category` attribute refers to an array of strings. This example returns all
905-
`Building` entities with a `category` attribute which contains either `commercial` or `office` strings. Filtering can be
907+
`Building` entities with a `category` attribute which contains either `barn` or `22farm_auxiliary` strings. Filtering can be
906908
done using the `q` parameter, comma separating the acceptable values.
907909

908910
#### 9️⃣ Request:
@@ -914,7 +916,8 @@ curl -G -X GET \
914916
-H 'Accept: application/ld+json' \
915917
-d 'type=Building' \
916918
-d 'q=category==%22barn%22,%22farm_auxiliary%22' \
917-
-d 'options=keyValues'
919+
-d 'options=keyValues' \
920+
-d 'expandValues=category'
918921
```
919922

920923
#### Response:

0 commit comments

Comments
 (0)