Skip to content

Commit c87e8da

Browse files
author
Fernando López Aguilar
authored
Merge pull request #40 from stellio-hub/fix/601-intro-linked-data
fix: misc fixes and alignments in 601
2 parents b28fa68 + 872e939 commit c87e8da

10 files changed

Lines changed: 55 additions & 116 deletions

features/601.ngsild.Intro_Stellio.feature

Lines changed: 35 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Feature: test tutorial 601 Introduction to Linked Data (Stellio)
3131
And I set header Content-Type to application/ld+json
3232
And I set the body request as described in <file>
3333
And I perform the request
34-
Then I receive a HTTP response with the following Orion-LD data
34+
Then I receive a HTTP response with the following Stellio data
3535
| Status-Code | Location |
3636
| 201 | <location> |
3737

@@ -41,127 +41,66 @@ Feature: test tutorial 601 Introduction to Linked Data (Stellio)
4141
| request601-03.json | /ngsi-ld/v1/entities/urn:ngsi-ld:Building:store002 |
4242

4343

44-
#
45-
# Request 4
46-
# Note: the body response is quite different from what expected. In particular:
47-
# - the attribute "@context" is at the beginning of the entity and not at the end as expected
48-
# - the attribute "http://schema.org/address" is instead of "https://schema.org/address"
49-
# - the structured attribute
50-
# "https://uri.fiware.org/ns/dataModels#category": {
51-
# "type": "Property",
52-
# "value": ["commercial"]
53-
# }, is instead of
54-
# "https://smart-data-models.github.io/dataModels/terms.jsonld#/definitions/category": {
55-
# "type": "Property",
56-
# "value": "commercial"
57-
# } and is in a wrong position.
58-
#
5944
Scenario: [4] OBTAIN ENTITY DATA BY FQN TYPE
60-
When I send GET HTTP request to "http://localhost:1026/ngsi-ld/v1/entities?type=https://uri.fiware.org/ns/dataModels%23Building"
61-
Then I receive a HTTP "200" response code from Stellio with the body equal to "response601-04.json"
45+
When I prepare a GET HTTP request for "obtaining an entity data" to "http://localhost:1026/ngsi-ld/v1/entities"
46+
And I set header Accept to application/ld+json
47+
And the params equal to "type=https://smartdatamodels.org/dataModel.Building/Building"
48+
And I perform the request
49+
Then I receive a HTTP "200" response code from Stellio with the body equal to "response601-04-array.json"
6250

6351

64-
#
65-
# Request 5
66-
# Note: the body response is quite different from what expected. In particular:
67-
# - the attribute "@context" is at the beginning of the entity and not at the end as expected
68-
# - the attribute "http://schema.org/address" is instead of "https://schema.org/address"
69-
# - the structured attribute
70-
# "https://uri.fiware.org/ns/dataModels#category": {
71-
# "type": "Property",
72-
# "value": ["commercial"]
73-
# }, is instead of
74-
# "https://smart-data-models.github.io/dataModels/terms.jsonld#/definitions/category": {
75-
# "type": "Property",
76-
# "value": "commercial"
77-
# } and is in a wrong position.
78-
#
7952
Scenario: [5] OBTAIN ENTITY DATA BY ID
80-
When I send GET HTTP request to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:store001"
53+
When I prepare a GET HTTP request for "obtaining entity data by Id" to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:store001"
54+
And I set header Accept to application/ld+json
55+
And I perform the request
8156
Then I receive a HTTP "200" response code from Stellio with the body equal to "response601-05.json"
8257

8358

84-
#
85-
# Request 6
86-
# Note: the body response is quite different from what expected. In particular:
87-
# - the attribute "@context" is at the beginning of the entity and not at the end as expected
88-
# - the attribute "category" is of a wrong type and misplaced.
89-
# - in the file "response601_06" the first entity is as provided by Stellio while the second entity
90-
# is left as expected in the tutorial to let understand the differences to make easier the correct the tutorial.
91-
# Note: the request itself in the tutorial is wrong as the url appears twice.
92-
#
9359
Scenario: [6] OBTAIN ENTITY DATA BY TYPE
94-
When I send GET HTTP request to Stellio at "http://localhost:1026/ngsi-ld/v1/entities"
95-
And With header 'Link$<https://smartdatamodels.org/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/json"'
96-
And With parameters "type$Building$options$keyValues"
60+
When I set the "Accept" header with the value "application/ld+json"
61+
And I set the "Link" header with the value "<https://smart-data-models.github.io/dataModel.Building/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
62+
And the params equal to "type=Building"
63+
And the params equal to "options=keyValues"
64+
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities"
65+
And I send a GET HTTP request to that url
9766
Then I receive from Stellio "200" response code with the body equal to "response601-06.json"
9867

9968

100-
#
101-
# Request 7
102-
# Note: the body response is quite different from what expected. In particular:
103-
# - the attribute "@context" is at the beginning of the entity and not at the end as expected
104-
# - the attribute "category" is of a wrong type and misplaced.
105-
# The file "response601_07" is updated as provided by Stellio to let understand how to correct the tutorial.
106-
#
10769
Scenario: [7] FILTER CONTEXT DATA BY COMPARING THE VALUES OF AN ATTRIBUTE
108-
When I send GET HTTP request to Stellio at "http://localhost:1026/ngsi-ld/v1/entities"
109-
And With header 'Link$<https://smartdatamodels.org/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/json"'
110-
And With parameters "type$Building$q$name=="Checkpoint Markt"$options$keyValues"
70+
When I set the "Accept" header with the value "application/ld+json"
71+
And I set the "Link" header with the value "<https://smart-data-models.github.io/dataModel.Building/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
72+
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities?type=Building&q=name==%22Checkpoint%20Markt%22&options=keyValues"
73+
And I send a GET HTTP request to that url
11174
Then I receive from Stellio "200" response code with the body equal to "response601-07.json"
11275

11376

114-
#
115-
# Request 8
116-
# Note: the body response is quite different from what expected. In particular:
117-
# - the attribute "@context" is at the beginning of the entity and not at the end as expected
118-
# - the attribute "category" is of a wrong type and misplaced.
119-
# The file "response601_08" is left unchanged.
120-
#
12177
Scenario: [8] FILTER CONTEXT DATA BY COMPARING THE VALUES OF AN ATTRIBUTE IN AN ARRAY
122-
When I send GET HTTP request to Stellio at "http://localhost:1026/ngsi-ld/v1/entities"
123-
And With header 'Link$<https://smartdatamodels.org/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/json"'
124-
And With parameters "type$Building$q$category=="commercial","office"$options$keyValues"
78+
When I set the "Accept" header with the value "application/ld+json"
79+
And I set the "Link" header with the value "<https://smart-data-models.github.io/dataModel.Building/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
80+
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities?type=Building&q=category==%22commercial%22,%22office%22&options=keyValues"
81+
And I send a GET HTTP request to that url
12582
Then I receive from Stellio "200" response code with the body equal to "response601-08.json"
12683

12784

128-
#
129-
# Request 9
130-
# Note: the body response is quite different from what expected. In particular:
131-
# - the attribute "@context" is at the beginning of the entity and not at the end as expected
132-
# - the attribute "category" is of a wrong type and misplaced.
133-
# The file "response601_09" is left unchanged.
134-
#
13585
Scenario: [9] FILTER CONTEXT DATA BY COMPARING THE VALUES OF A SUB-ATTRIBUTE
136-
When I send GET HTTP request to Stellio at "http://localhost:1026/ngsi-ld/v1/entities"
137-
And With header 'Link$<https://smartdatamodels.org/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/json"'
138-
And With parameters "type$Building$q$address[addressLocality]=="Kreuzberg"$options$keyValues"
86+
When I set the "Accept" header with the value "application/ld+json"
87+
And I set the "Link" header with the value "<https://smart-data-models.github.io/dataModel.Building/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
88+
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities?type=Building&q=address%5BaddressLocality%5D==%22Kreuzberg%22&options=keyValues"
89+
And I send a GET HTTP request to that url
13990
Then I receive from Stellio "200" response code with the body equal to "response601-09.json"
14091

14192

142-
#
143-
# Request 10
144-
# Note: the body response is quite different from what expected. In particular:
145-
# - the attribute "@context" is at the beginning of the entity and not at the end as expected
146-
# - the attribute "category" is of a wrong type and misplaced.
147-
# The file "response601_10" is left unchanged.
148-
#
14993
Scenario: [10] FILTER CONTEXT DATA BY QUERYING METADATA
150-
When I send GET HTTP request to Stellio at "http://localhost:1026/ngsi-ld/v1/entities"
151-
And With header 'Link$<https://smartdatamodels.org/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/json"'
152-
And With parameters "type$Building$q$address.verified==true$options$keyValues"
94+
When I set the "Accept" header with the value "application/json"
95+
And I set the "Link" header with the value "<https://smart-data-models.github.io/dataModel.Building/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
96+
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities?type=Building&q=address.verified==true&options=keyValues"
97+
And I send a GET HTTP request to that url
15398
Then I receive from Stellio "200" response code with the body equal to "response601-10.json"
15499

155100

156-
#
157-
# Request 11
158-
# Note: the body response is quite different from what expected. In particular:
159-
# - the attribute "@context" is at the beginning of the entity and not at the end as expected
160-
# - the attribute "category" is of a wrong type and misplaced.
161-
# The file "response601_11" is left unchanged.
162-
#
163101
Scenario: [11] FILTER CONTEXT DATA BY COMPARING THE VALUES OF A GEO:JSON ATTRIBUTE
164-
When I send GET HTTP request to Stellio at "http://localhost:1026/ngsi-ld/v1/entities"
165-
And With header 'Link$<https://smartdatamodels.org/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/json"'
166-
And With parameters "type$Building$geometry$Point$coordinates$[13.3777,52.5162]$georel$near;maxDistance==2000$options$keyValues"
102+
When I set the "Accept" header with the value "application/json"
103+
And I set the "Link" header with the value "<https://smart-data-models.github.io/dataModel.Building/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
104+
And I set the url to "http://localhost:1026/ngsi-ld/v1/entities?type=Building&geometry=Point&coordinates=%5B13.3777,52.5162%5D&georel=near%3BmaxDistance==2000&options=keyValues"
105+
And I send a GET HTTP request to that url
167106
Then I receive from Stellio "200" response code with the body equal to "response601-11.json"

features/data/601.LD-Intro/request601-02.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "urn:ngsi-ld:Building:store001",
33
"type": "Building",
44
"category": {
5-
"type": "VocabularyProperty",
5+
"type": "VocabProperty",
66
"vocab": "commercial"
77
},
88
"address": {
@@ -31,6 +31,6 @@
3131
},
3232
"@context": [
3333
"https://smart-data-models.github.io/dataModel.Building/context.jsonld",
34-
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
34+
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld"
3535
]
3636
}

features/data/601.LD-Intro/request601-03.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "urn:ngsi-ld:Building:store002",
33
"type": "Building",
44
"category": {
5-
"type": "VocabularyProperty",
5+
"type": "VocabProperty",
66
"vocab": "commercial"
77
},
88
"address": {
@@ -31,6 +31,6 @@
3131
},
3232
"@context": [
3333
"https://smart-data-models.github.io/dataModel.Building/context.jsonld",
34-
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
34+
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld"
3535
]
3636
}

features/data/601.LD-Intro/response601-04-array.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[
22
{
3-
"@context": ["https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.7.jsonld"],
3+
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld",
44
"id": "urn:ngsi-ld:Building:store001",
55
"type": "https://smartdatamodels.org/dataModel.Building/Building",
66
"https://smartdatamodels.org/dataModel.Building/category": {
7-
"type": "VocabularyProperty",
7+
"type": "VocabProperty",
88
"vocab": "commercial"
99
},
1010
"https://smartdatamodels.org/address": {
@@ -33,11 +33,11 @@
3333
}
3434
},
3535
{
36-
"@context": ["https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.7.jsonld"],
36+
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld",
3737
"id": "urn:ngsi-ld:Building:store002",
3838
"type": "https://smartdatamodels.org/dataModel.Building/Building",
3939
"https://smartdatamodels.org/dataModel.Building/category": {
40-
"type": "VocabularyProperty",
40+
"type": "VocabProperty",
4141
"vocab": "commercial"
4242
},
4343
"https://smartdatamodels.org/address": {

features/data/601.LD-Intro/response601-04.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[
22
{
3-
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld",
3+
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld",
44
"id": "urn:ngsi-ld:Building:store001",
55
"type": "https://smartdatamodels.org/dataModel.Building/Building",
66
"https://smartdatamodels.org/dataModel.Building/category": {
7-
"type": "VocabularyProperty",
7+
"type": "VocabProperty",
88
"vocab": "commercial"
99
},
1010
"https://smartdatamodels.org/address": {
@@ -33,11 +33,11 @@
3333
}
3434
},
3535
{
36-
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld",
36+
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld",
3737
"id": "urn:ngsi-ld:Building:store002",
3838
"type": "https://smartdatamodels.org/dataModel.Building/Building",
3939
"https://smartdatamodels.org/dataModel.Building/category": {
40-
"type": "VocabularyProperty",
40+
"type": "VocabProperty",
4141
"vocab": "commercial"
4242
},
4343
"https://smartdatamodels.org/address": {

features/data/601.LD-Intro/response601-05.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld",
2+
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld",
33
"id": "urn:ngsi-ld:Building:store001",
44
"type": "https://smartdatamodels.org/dataModel.Building/Building",
55
"https://smartdatamodels.org/address": {
@@ -16,7 +16,7 @@
1616
}
1717
},
1818
"https://smartdatamodels.org/dataModel.Building/category": {
19-
"type": "VocabularyProperty",
19+
"type": "VocabProperty",
2020
"vocab": "commercial"
2121
},
2222
"https://smartdatamodels.org/name": {

features/data/601.LD-Intro/response601-06.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"@context": [
44
"https://smart-data-models.github.io/dataModel.Building/context.jsonld",
5-
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
5+
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld"
66
],
77
"id": "urn:ngsi-ld:Building:store001",
88
"type": "Building",
@@ -24,7 +24,7 @@
2424
{
2525
"@context": [
2626
"https://smart-data-models.github.io/dataModel.Building/context.jsonld",
27-
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
27+
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld"
2828
],
2929
"id": "urn:ngsi-ld:Building:store002",
3030
"type": "Building",

features/data/601.LD-Intro/response601-07.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"@context": [
44
"https://smart-data-models.github.io/dataModel.Building/context.jsonld",
5-
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
5+
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld"
66
],
77
"id": "urn:ngsi-ld:Building:store002",
88
"type": "Building",

features/data/601.LD-Intro/response601-08.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"@context": [
44
"https://smart-data-models.github.io/dataModel.Building/context.jsonld",
5-
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
5+
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld"
66
],
77
"id": "urn:ngsi-ld:Building:store001",
88
"type": "Building",
@@ -24,7 +24,7 @@
2424
{
2525
"@context": [
2626
"https://smart-data-models.github.io/dataModel.Building/context.jsonld",
27-
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
27+
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld"
2828
],
2929
"id": "urn:ngsi-ld:Building:store002",
3030
"type": "Building",

features/data/601.LD-Intro/response601-09.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"@context": [
44
"https://smart-data-models.github.io/dataModel.Building/context.jsonld",
5-
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
5+
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld"
66
],
77
"id": "urn:ngsi-ld:Building:store002",
88
"type": "Building",

0 commit comments

Comments
 (0)