{
    "POST to": "v1.1/$batch",
    "Headers": "Content-Type: application/json",
    "requests": [
        {
            "id": "roleObsCreater",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Roles",
            "body": {
                "rolename": "obscreate",
                "description": "Can create Observations (but not other EntityTypes) for the Projects the user is in."
            }
        },
        {
            "id": "project1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Projects",
            "body": {
                "name": "Project 1",
                "description": "The first, public, test project",
                "public": true
            }
        },
        {
            "id": "project2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Projects",
            "body": {
                "name": "Project 2",
                "description": "The second, private, test project"
            }
        },
        {
            "id": "AdminProject1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Users",
            "body": {
                "username": "AdminProject1",
                "userpass": "AdminProject1"
            }
        },
        {
            "id": "upr1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "UserProjectRoles",
            "body": {
                "User":{"username": "$AdminProject1"}, 
                "Project":{"@iot.id": "$project1"}, 
                "Role":{"rolename": "admin"}
            }
        },
        {
            "id": "ObsCreaterProject1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Users",
            "body": {
                "username": "ObsCreaterProject1",
                "userpass": "ObsCreaterProject1"
            }
        },
        {
            "id": "upr2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "UserProjectRoles",
            "body": {
                "User":{"username": "$ObsCreaterProject1"}, 
                "Project":{"@iot.id": "$project1"}, 
                "Role":{"rolename": "obscreate"}
            }
        },
        {
            "id": "AdminProject2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Users",
            "body": {
                "username": "AdminProject2",
                "userpass": "AdminProject2"
            }
        },
        {
            "id": "upr3",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "UserProjectRoles",
            "body": {
                "User":{"username": "$AdminProject2"}, 
                "Project":{"@iot.id": "$project2"}, 
                "Role":{"rolename": "admin"}
            }
        },
        {
            "id": "ObsCreaterProject2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Users",
            "body": {
                "username": "ObsCreaterProject2",
                "userpass": "ObsCreaterProject2"
            }
        },
        {
            "id": "upr4",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "UserProjectRoles",
            "body": {
                "User":{"username": "$ObsCreaterProject2"}, 
                "Project":{"@iot.id": "$project2"}, 
                "Role":{"rolename": "obscreate"}
            }
        },
        {
            "id": "userNoProject",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Users",
            "body": {
                "username": "noProject",
                "userpass": "noProject"
            }
        },


        {
            "id": "location1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Locations",
            "body": {
                "name": "Location 1",
                "restricted": false,
                "description": "The location of the first test thing",
                "encodingType": "application/geo+json",
                "location": {"type": "Point", "coordinates": [ 8, 49 ]},
                "GeneratedFeature": {
                    "name": "Feature 1",
                    "description": "The location of the first test thing",
                    "encodingType": "application/geo+json",
                    "feature": {"type": "Point", "coordinates": [ 8, 49 ]},
                    "Projects": [{"@iot.id": "$project1"}]
                },
                "Projects": [{"@iot.id": "$project1"}]
            }
        },
        {
            "id": "location2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Locations",
            "body": {
                "name": "Location 2",
                "restricted": false,
                "description": "The location of the second test thing",
                "encodingType": "application/geo+json",
                "location": {"type": "Point", "coordinates": [ 9, 50 ]},
                "GeneratedFeature": {
                    "name": "Feature 2",
                    "description": "The location of the second test thing",
                    "encodingType": "application/geo+json",
                    "feature": {"type": "Point", "coordinates": [ 9, 50 ]},
                    "Projects": [{"@iot.id": "$project2"}]
                },
                "Projects": [{"@iot.id": "$project2"}]
            }
        },
        {
            "id": "location3",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Locations",
            "body": {
                "name": "Location 3",
                "restricted": false,
                "description": "The location of the third test thing",
                "encodingType": "application/geo+json",
                "location": {"type": "Point", "coordinates": [ 8, 50 ]},
                "Projects": [{"@iot.id": "$project1"},{"@iot.id": "$project2"}]
            }
        },
        {
            "id": "location4",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Locations",
            "body": {
                "name": "Location 4",
                "restricted": true,
                "description": "The location of the fourth test thing",
                "encodingType": "application/geo+json",
                "location": {"type": "Point", "coordinates": [ 9, 49 ]}
            }
        },
        {
            "id": "location5",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Locations",
            "body": {
                "name": "Location 5",
                "restricted": false,
                "description": "The (restricted) location of the fifth test thing",
                "encodingType": "application/geo+json",
                "location": {"type": "Point", "coordinates": [ 9, 51 ]},
                "Projects": [{"@iot.id": "$project1"},{"@iot.id": "$project2"}]
            }
        },


        {
            "id": "thing1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Things",
            "body": {
                "name": "Thing 1",
                "description": "The first test thing",
                "Locations": [{"@iot.id": "$location1"}],
                "Projects": [{"@iot.id": "$project1"}]
            }
        },
        {
            "id": "thing2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Things",
            "body": {
                "name": "Thing 2",
                "description": "The second test thing",
                "Locations": [{"@iot.id": "$location2"}],
                "Projects": [{"@iot.id": "$project2"}]
            }
        },
        {
            "id": "thing3",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Things",
            "body": {
                "name": "Thing 3",
                "restricted": false,
                "description": "The third test thing",
                "Locations": [{"@iot.id": "$location3"}],
                "Projects": [{"@iot.id": "$project1"},{"@iot.id": "$project2"}]
            }
        },
        {
            "id": "thing4",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Things",
            "body": {
                "name": "Thing 4",
                "restricted": false,
                "description": "The fourth test thing",
                "Locations": [{"@iot.id": "$location4"}]
            }
        },
        {
            "id": "thing5",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Things",
            "body": {
                "name": "Thing 5",
                "description": "The fifth (restricted) test thing",
                "restricted": true,
                "Locations": [{"@iot.id": "$location5"}],
                "Projects": [{"@iot.id": "$project1"},{"@iot.id": "$project2"}]
            }
        },


        {
            "id": "sensor1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Sensors",
            "body": {
                "name": "DHT 22",
                "description": "A cheap temperature/humidity sensor",
                "encodingType": "PDF",
                "metadata": "https://cdn.shopify.com/s/files/1/1509/1638/files/DHT_22_-_AM2302_Temperatur_und_Luftfeuchtigkeitssensor_Datenblatt.pdf",
                "Projects": [{"@iot.id": "$project1"},{"@iot.id": "$project2"}]
            }
        },


        {
            "id": "op1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "ObservedProperties",
            "body": {
                "name": "Temperature",
                "description": "How hot it is",
                "definition": "http://www.qudt.org/qudt/owl/1.0.0/quantity/Instances.html/Tempreture"
            }
        },
        {
            "id": "op2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "ObservedProperties",
            "body": {
                "name": "Humidity",
                "description": "How wet it is",
                "definition": "http://ucom.org/humidity"
            }
        },


        {
            "id": "ds-1.1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Datastreams",
            "body": {
                "name": "Temperature of Thing 1",
                "restricted": false,
                "description": "How hot it is",
                "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
                "unitOfMeasurement": {
                    "name": "Centigrade",
                    "symbol": "°C",
                    "definition": "ucum:T"
                },
                "Thing": {"@iot.id": "$thing1"},
                "Sensor": {"@iot.id": "$sensor1"},
                "ObservedProperty": {"@iot.id": "$op1"},
                "Observations": [
                    {"result": 1, "phenomenonTime": "2023-01-01T12:00:00Z"},
                    {"result": 2, "phenomenonTime": "2023-01-01T12:01:00Z"},
                    {"result": 3, "phenomenonTime": "2023-01-01T12:03:00Z"},
                    {"result": 4, "phenomenonTime": "2023-01-01T12:04:00Z"}
                ]
            }
        },
        {
            "id": "ds-1.2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Datastreams",
            "body": {
                "name": "Humidity of Thing 1 (restricted)",
                "restricted": true,
                "description": "How wet it is",
                "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
                "unitOfMeasurement": {
                    "name": "Centigrade",
                    "symbol": "°C",
                    "definition": "ucum:T"
                },
                "Thing": {"@iot.id": "$thing1"},
                "Sensor": {"@iot.id": "$sensor1"},
                "ObservedProperty": {"@iot.id": "$op2"},
                "Observations": [
                    {"result": 1, "phenomenonTime": "2023-01-01T12:00:00Z"},
                    {"result": 2, "phenomenonTime": "2023-01-01T12:01:00Z"},
                    {"result": 3, "phenomenonTime": "2023-01-01T12:03:00Z"},
                    {"result": 4, "phenomenonTime": "2023-01-01T12:04:00Z"}
                ]
            }
        },
        {
            "id": "ds-2.1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Datastreams",
            "body": {
                "name": "Temperature of Thing 2",
                "restricted": false,
                "description": "How hot it is",
                "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
                "unitOfMeasurement": {
                    "name": "Centigrade",
                    "symbol": "°C",
                    "definition": "ucum:T"
                },
                "Thing": {"@iot.id": "$thing2"},
                "Sensor": {"@iot.id": "$sensor1"},
                "ObservedProperty": {"@iot.id": "$op1"},
                "Observations": [
                    {"result": 1, "phenomenonTime": "2023-01-01T12:00:00Z"},
                    {"result": 2, "phenomenonTime": "2023-01-01T12:01:00Z"},
                    {"result": 3, "phenomenonTime": "2023-01-01T12:03:00Z"},
                    {"result": 4, "phenomenonTime": "2023-01-01T12:04:00Z"}
                ]
            }
        },
        {
            "id": "ds-2.2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Datastreams",
            "body": {
                "name": "Humidity of Thing 2",
                "restricted": false,
                "description": "How wet it is",
                "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
                "unitOfMeasurement": {
                    "name": "Centigrade",
                    "symbol": "°C",
                    "definition": "ucum:T"
                },
                "Thing": {"@iot.id": "$thing2"},
                "Sensor": {"@iot.id": "$sensor1"},
                "ObservedProperty": {"@iot.id": "$op2"},
                "Observations": [
                    {"result": 1, "phenomenonTime": "2023-01-01T12:00:00Z"},
                    {"result": 2, "phenomenonTime": "2023-01-01T12:01:00Z"},
                    {"result": 3, "phenomenonTime": "2023-01-01T12:03:00Z"},
                    {"result": 4, "phenomenonTime": "2023-01-01T12:04:00Z"}
                ]
            }
        },
        {
            "id": "ds-3.1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Datastreams",
            "body": {
                "name": "Temperature of Thing 3",
                "restricted": false,
                "description": "How hot it is",
                "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
                "unitOfMeasurement": {
                    "name": "Centigrade",
                    "symbol": "°C",
                    "definition": "ucum:T"
                },
                "Thing": {"@iot.id": "$thing3"},
                "Sensor": {"@iot.id": "$sensor1"},
                "ObservedProperty": {"@iot.id": "$op1"},
                "Observations": [
                    {"result": 1, "phenomenonTime": "2023-01-01T12:00:00Z"},
                    {"result": 2, "phenomenonTime": "2023-01-01T12:01:00Z"},
                    {"result": 3, "phenomenonTime": "2023-01-01T12:03:00Z"},
                    {"result": 4, "phenomenonTime": "2023-01-01T12:04:00Z"}
                ]
            }
        },
        {
            "id": "ds-3.2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Datastreams",
            "body": {
                "name": "Humidity of Thing 3",
                "restricted": false,
                "description": "How wet it is",
                "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
                "unitOfMeasurement": {
                    "name": "Centigrade",
                    "symbol": "°C",
                    "definition": "ucum:T"
                },
                "Thing": {"@iot.id": "$thing3"},
                "Sensor": {"@iot.id": "$sensor1"},
                "ObservedProperty": {"@iot.id": "$op2"},
                "Observations": [
                    {"result": 1, "phenomenonTime": "2023-01-01T12:00:00Z"},
                    {"result": 2, "phenomenonTime": "2023-01-01T12:01:00Z"},
                    {"result": 3, "phenomenonTime": "2023-01-01T12:03:00Z"},
                    {"result": 4, "phenomenonTime": "2023-01-01T12:04:00Z"}
                ]
            }
        },
        {
            "id": "ds-4.1",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Datastreams",
            "body": {
                "name": "Temperature of Thing 4",
                "restricted": false,
                "description": "How hot it is",
                "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
                "unitOfMeasurement": {
                    "name": "Centigrade",
                    "symbol": "°C",
                    "definition": "ucum:T"
                },
                "Thing": {"@iot.id": "$thing4"},
                "Sensor": {"@iot.id": "$sensor1"},
                "ObservedProperty": {"@iot.id": "$op1"},
                "Observations": [
                    {"result": 1, "phenomenonTime": "2023-01-01T12:00:00Z"},
                    {"result": 2, "phenomenonTime": "2023-01-01T12:01:00Z"},
                    {"result": 3, "phenomenonTime": "2023-01-01T12:03:00Z"},
                    {"result": 4, "phenomenonTime": "2023-01-01T12:04:00Z"}
                ]
            }
        },
        {
            "id": "ds-4.2",
            "atomicityGroup": "group1",
            "method": "post",
            "url": "Datastreams",
            "body": {
                "name": "Humidity of Thing 4",
                "restricted": false,
                "description": "How wet it is",
                "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
                "unitOfMeasurement": {
                    "name": "Centigrade",
                    "symbol": "°C",
                    "definition": "ucum:T"
                },
                "Thing": {"@iot.id": "$thing4"},
                "Sensor": {"@iot.id": "$sensor1"},
                "ObservedProperty": {"@iot.id": "$op2"},
                "Observations": [
                    {"result": 1, "phenomenonTime": "2023-01-01T12:00:00Z"},
                    {"result": 2, "phenomenonTime": "2023-01-01T12:01:00Z"},
                    {"result": 3, "phenomenonTime": "2023-01-01T12:03:00Z"},
                    {"result": 4, "phenomenonTime": "2023-01-01T12:04:00Z"}
                ]
            }
        }
    ]
}
