Skip to content

Commit d51c0f4

Browse files
author
Fernando López
committed
Added tutorial 601 NGSI-LD Federative Data Spaces
1 parent f218624 commit d51c0f4

13 files changed

Lines changed: 568 additions & 0 deletions
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Feature: Test tutorial 601.Federative_Data_Spaces (Orion-LD)
2+
This is feature file of the FIWARE step by step tutorial for Federative Data Spaces (Orion-LD)
3+
url: https://ngsi-ld-tutorials.readthedocs.io/en/latest/linked-data.html
4+
git-clone: https://github.com/FIWARE/tutorials.Linked-Data.git
5+
git-directory: /tmp/tutorials.Linked-Data
6+
shell-commands: git checkout NGSI-LD; ./services create; ./services orion
7+
clean-shell-commands: ./services stop
8+
9+
Background:
10+
Given I set the tutorial 601_FDS
11+
12+
Scenario: 01 - Reading NGSI-v2 Data Directly
13+
When I set the url to "http://localhost:1027/v2/entities/urn:ngsi-ld:Store:001"
14+
And I send a GET HTTP request to that url
15+
Then I receive a HTTP "200" response code from Orion with the body equal to "response601FDS_01.json"
16+
17+
Scenario: 02 - Reading NGSI-v2 Data in NGSI-LD Format
18+
When I set the url to "http://localhost:3005/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001"
19+
And I set the "Accept" header with the value "application/ld+json"
20+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
21+
And I send a GET HTTP request to that url
22+
Then I receive a HTTP "200" response code from Lepus with the body equal to "response601FDS_02.json"
23+
24+
Scenario: 03 - Retrieving Fixed Context
25+
When I set the url to "http://localhost:3004/fixed-context.jsonld"
26+
And I send a GET HTTP request to that url
27+
Then I receive a HTTP "200" response code from Lepus with the body equal to "response601FDS_03.json"
28+
29+
Scenario: 04 - Get information from Lepus
30+
When I set the url to "http://localhost:3005/ngsi-ld/v1/info/sourceIdentity"
31+
And I set the "Accept" header with the value "application/ld+json"
32+
And I send a GET HTTP request to that url
33+
Then I receive a HTTP "200" status code from Lepus with the body "response601FDS_04.json" and exclusions "response601FDS_04.excludes"
34+
35+
Scenario: 05 - Creating a federation registration
36+
When I set the url to "http://localhost:1026/ngsi-ld/v1/csourceRegistrations"
37+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
38+
And I set the "Content-Type" header with the value "application/json"
39+
And the body request described in file "request601FDS_05.json"
40+
And I send a POST HTTP request to that url
41+
Then I receive a HTTP "201" status code response
42+
43+
Scenario: 06 - Retrieve one entity data
44+
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001"
45+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
46+
And I send a GET HTTP request to that url
47+
Then I receive a HTTP "200" response code from Orion-LD with the body equal to "response601FDS_06.json"
48+
49+
Scenario: 07 - Retrieve Entities
50+
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities"
51+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
52+
And I set the "Accept" header with the value "application/ld+json"
53+
And the params equal to "type=Building"
54+
And the params equal to "q=category==%22supermarket%22"
55+
And the params equal to "attrs=name"
56+
And the params equal to "options=keyValues"
57+
And I send a GET HTTP request to that url
58+
Then I receive a HTTP "200" response code from Orion-LD with the body equal to "response601FDS_07.json"
59+
60+
Scenario: 08 - Using an Alternate @context
61+
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001"
62+
And I set the "Link" header with the value "<http://context/alternate-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
63+
And I send a GET HTTP request to that url
64+
Then I receive a HTTP "200" response code from Orion-LD with the body equal to "response601FDS_08.json"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Feature: Test tutorial 601.Federative_Data_Spaces (Orion-LD)
2+
This is feature file of the FIWARE step by step tutorial for Federative Data Spaces (Orion-LD)
3+
url: https://ngsi-ld-tutorials.readthedocs.io/en/latest/linked-data.html
4+
git-clone: https://github.com/FIWARE/tutorials.Linked-Data.git
5+
git-directory: /tmp/tutorials.Linked-Data
6+
shell-commands: git checkout NGSI-LD; ./services create; ./services scorpio
7+
clean-shell-commands: ./services stop
8+
9+
Background:
10+
Given I set the tutorial 601_FDS
11+
12+
Scenario: 01 - Reading NGSI-v2 Data Directly
13+
When I set the url to "http://localhost:1027/v2/entities/urn:ngsi-ld:Store:001"
14+
And I send a GET HTTP request to that url
15+
Then I receive a HTTP "200" response code from Orion with the body equal to "response601FDS_01.json"
16+
17+
Scenario: 02 - Reading NGSI-v2 Data in NGSI-LD Format
18+
When I set the url to "http://localhost:3005/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001"
19+
And I set the "Accept" header with the value "application/ld+json"
20+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
21+
And I send a GET HTTP request to that url
22+
Then I receive a HTTP "200" response code from Lepus with the body equal to "response601FDS_02.json"
23+
24+
Scenario: 03 - Retrieving Fixed Context
25+
When I set the url to "http://localhost:3004/fixed-context.jsonld"
26+
And I send a GET HTTP request to that url
27+
Then I receive a HTTP "200" response code from Lepus with the body equal to "response601FDS_03.json"
28+
29+
Scenario: 04 - Get information from Lepus
30+
When I set the url to "http://localhost:3005/ngsi-ld/v1/info/sourceIdentity"
31+
And I set the "Accept" header with the value "application/ld+json"
32+
And I send a GET HTTP request to that url
33+
Then I receive a HTTP "200" status code from Lepus with the body "response601FDS_04.json" and exclusions "response601FDS_04.excludes"
34+
35+
Scenario: 05 - Creating a federation registration
36+
When I set the url to "http://localhost:1026/ngsi-ld/v1/csourceRegistrations"
37+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
38+
And I set the "Content-Type" header with the value "application/json"
39+
And the body request described in file "request601FDS_05.json"
40+
And I send a POST HTTP request to that url
41+
Then I receive a HTTP "201" status code response
42+
43+
Scenario: 06 - Retrieve one entity data
44+
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001"
45+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
46+
And I send a GET HTTP request to that url
47+
Then I receive a HTTP "200" response code from Scorpio with the body equal to "response601FDS_06.json"
48+
49+
Scenario: 07 - Retrieve Entities
50+
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities"
51+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
52+
And I set the "Accept" header with the value "application/ld+json"
53+
And the params equal to "type=Building"
54+
And the params equal to "q=category==%22supermarket%22"
55+
And the params equal to "attrs=name"
56+
And the params equal to "options=keyValues"
57+
And I send a GET HTTP request to that url
58+
Then I receive a HTTP "200" response code from Scorpio with the body equal to "response601FDS_07.json"
59+
60+
Scenario: 08 - Using an Alternate @context
61+
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001"
62+
And I set the "Link" header with the value "<http://context/alternate-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
63+
And I send a GET HTTP request to that url
64+
Then I receive a HTTP "200" response code from Scorpio with the body equal to "response601FDS_08.json"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Feature: Test tutorial 601.Federative_Data_Spaces (Orion-LD)
2+
This is feature file of the FIWARE step by step tutorial for Federative Data Spaces (Orion-LD)
3+
url: https://ngsi-ld-tutorials.readthedocs.io/en/latest/linked-data.html
4+
git-clone: https://github.com/FIWARE/tutorials.Linked-Data.git
5+
git-directory: /tmp/tutorials.Linked-Data
6+
shell-commands: git checkout NGSI-LD; ./services create; ./services stellio
7+
clean-shell-commands: ./services stop
8+
9+
Background:
10+
Given I set the tutorial 601_FDS
11+
12+
Scenario: 01 - Reading NGSI-v2 Data Directly
13+
When I set the url to "http://localhost:1027/v2/entities/urn:ngsi-ld:Store:001"
14+
And I send a GET HTTP request to that url
15+
Then I receive a HTTP "200" response code from Orion with the body equal to "response601FDS_01.json"
16+
17+
Scenario: 02 - Reading NGSI-v2 Data in NGSI-LD Format
18+
When I set the url to "http://localhost:3005/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001"
19+
And I set the "Accept" header with the value "application/ld+json"
20+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
21+
And I send a GET HTTP request to that url
22+
Then I receive a HTTP "200" response code from Lepus with the body equal to "response601FDS_02.json"
23+
24+
Scenario: 03 - Retrieving Fixed Context
25+
When I set the url to "http://localhost:3004/fixed-context.jsonld"
26+
And I send a GET HTTP request to that url
27+
Then I receive a HTTP "200" response code from Lepus with the body equal to "response601FDS_03.json"
28+
29+
Scenario: 04 - Get information from Lepus
30+
When I set the url to "http://localhost:3005/ngsi-ld/v1/info/sourceIdentity"
31+
And I set the "Accept" header with the value "application/ld+json"
32+
And I send a GET HTTP request to that url
33+
Then I receive a HTTP "200" status code from Lepus with the body "response601FDS_04.json" and exclusions "response601FDS_04.excludes"
34+
35+
Scenario: 05 - Creating a federation registration
36+
When I set the url to "http://localhost:1026/ngsi-ld/v1/csourceRegistrations"
37+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
38+
And I set the "Content-Type" header with the value "application/json"
39+
And the body request described in file "request601FDS_05.json"
40+
And I send a POST HTTP request to that url
41+
Then I receive a HTTP "201" status code response
42+
43+
Scenario: 06 - Retrieve one entity data
44+
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001"
45+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
46+
And I send a GET HTTP request to that url
47+
Then I receive a HTTP "200" response code from Stellio with the body equal to "response601FDS_06.json"
48+
49+
Scenario: 07 - Retrieve Entities
50+
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities"
51+
And I set the "Link" header with the value "<http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
52+
And I set the "Accept" header with the value "application/ld+json"
53+
And the params equal to "type=Building"
54+
And the params equal to "q=category==%22supermarket%22"
55+
And the params equal to "attrs=name"
56+
And the params equal to "options=keyValues"
57+
And I send a GET HTTP request to that url
58+
Then I receive a HTTP "200" response code from Stellio with the body equal to "response601FDS_07.json"
59+
60+
Scenario: 08 - Using an Alternate @context
61+
When I set the url to "http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001"
62+
And I set the "Link" header with the value "<http://context/alternate-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json""
63+
And I send a GET HTTP request to that url
64+
Then I receive a HTTP "200" response code from Stellio with the body equal to "response601FDS_08.json"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"type": "ContextSourceRegistration",
3+
"information": [
4+
{
5+
"entities": [
6+
{
7+
"type": "Building"
8+
}
9+
]
10+
}
11+
],
12+
"contextSourceInfo": [
13+
{
14+
"key": "jsonldContext",
15+
"value": "http://context/fixed-context.jsonld"
16+
},
17+
{
18+
"key": "Prefer",
19+
"value": "ngsi-ld=1.6"
20+
}
21+
],
22+
"mode": "inclusive",
23+
"operations": [
24+
"federationOps"
25+
],
26+
"endpoint": "http://adapter:3000"
27+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
root['id']
2+
root['contextSourceExtras']['uptime']
3+
root['contextSourceUptime']
4+
root['contextSourceTimeAt']
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"id": "urn:ngsi-ld:Store:001",
3+
"type": "Store",
4+
"address": {
5+
"type": "PostalAddress",
6+
"value": {
7+
"streetAddress": "Bornholmer Straße 65",
8+
"addressRegion": "Berlin",
9+
"addressLocality": "Prenzlauer Berg",
10+
"postalCode": "10439"
11+
},
12+
"metadata": {}
13+
},
14+
"category": {
15+
"type": "VocabProperty",
16+
"value": "supermarket",
17+
"metadata": {}
18+
},
19+
"location": {
20+
"type": "geo:json",
21+
"value": {
22+
"type": "Point",
23+
"coordinates": [
24+
13.3986,
25+
52.5547
26+
]
27+
},
28+
"metadata": {}
29+
},
30+
"name": {
31+
"type": "Text",
32+
"value": "Bösebrücke Einkauf",
33+
"metadata": {}
34+
},
35+
"owner": {
36+
"type": "Relationship",
37+
"value": "urn:ngsi-ld:Person:001",
38+
"metadata": {
39+
"objectType": {
40+
"type": "VocabProperty",
41+
"value": "Person"
42+
}
43+
}
44+
}
45+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"@context": [
3+
"http://context/fixed-context.jsonld",
4+
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld"
5+
],
6+
"id": "urn:ngsi-ld:Store:001",
7+
"type": "Store",
8+
"address": {
9+
"type": "Property",
10+
"value": {
11+
"streetAddress": "Bornholmer Straße 65",
12+
"addressRegion": "Berlin",
13+
"addressLocality": "Prenzlauer Berg",
14+
"postalCode": "10439"
15+
}
16+
},
17+
"category": {
18+
"type": "VocabProperty",
19+
"vocab": "supermarket"
20+
},
21+
"location": {
22+
"type": "GeoProperty",
23+
"value": {
24+
"type": "Point",
25+
"coordinates": [
26+
13.3986,
27+
52.5547
28+
]
29+
}
30+
},
31+
"name": {
32+
"type": "Property",
33+
"value": "Bösebrücke Einkauf"
34+
},
35+
"owner": {
36+
"type": "Relationship",
37+
"object": "urn:ngsi-ld:Person:001",
38+
"objectType": "Person"
39+
}
40+
}

0 commit comments

Comments
 (0)