Skip to content

Commit

Permalink
Update AgriFood datamodels to include verb-based relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
fdelavega committed Oct 3, 2019
1 parent 5404ff2 commit 9c31183
Show file tree
Hide file tree
Showing 24 changed files with 96 additions and 234 deletions.
23 changes: 7 additions & 16 deletions definitions/Agri-Crop.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ This entity contains a harmonised description of a generic crop. This entity is
| name | Property | The name of this crop. | Mandatory |
| alternateName | Property | An alternative name for this crop. | Optional |
| description | Property | A description of this crop. | Recommended |
| agriSoil | Relationship | Reference to the recommended types of soil suitable for growing this crop. | Optional |
| agriFertiliser | Relationship | Reference to the recommended types of fertiliser suitable for growing this crop. | Optional |
| agriPest | Relationship | Reference to the pests known to attack this crop. | Optional |
| hasAgriSoil | Relationship | Reference to the recommended types of soil suitable for growing this crop. | Optional |
| hasAgriFertiliser | Relationship | Reference to the recommended types of fertiliser suitable for growing this crop. | Optional |
| hasAgriPest | Relationship | Reference to the pests known to attack this crop. | Optional |
| plantingFrom | Property | A list of the recommended planting interval date(s) for this crop. Specified using ISO8601 repeating date intervals: <br/><br/>**interval, description**<br/><br/>Where **interval** is in the form of **start date/end date**<br/><br/>--MM-DD/--MM-DD<br/><br/>Meaning repeat each year from this start date to this end date. | Optional |
| harvestingInterval | Property | A list of the recommended harvesting interval date(s) for this crop. Specified using ISO8601 repeating date intervals: <br/><br/>**interval, description**<br/><br/>Where **interval** is in the form of **start date/end date**<br/><br/>--MM-DD/--MM-DD<br/><br/>Meaning repeat each year from this start date to this end date. | Optional |
| wateringFrequency | Property | A description of the recommended watering schedule. A choice from an enumerated list. One of: **daily, weekly, biweekly, monthly, onDemand, other** | Optional |
Expand All @@ -28,18 +28,9 @@ The following NGSI-LD context definition applies to the **Agri Crop** entity
```JavaScript
{
"@context": {
"source": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/source",
"dataProvider": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/dataprovider",
"entityVersion": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/entityversion",
"name": "https://schema.org/name",
"alternateName": "https://schema.org/alternateName",
"description": "https://schema.org/description",
"agriSoil": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/agrisoil",
"agriFertiliser": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/agrifertiliser",
"agriPest": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/agripest",
"plantingFrom": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/plantingfrom",
"harvestingInterval": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/harvestinginterval",
"wateringFrequency": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/wateringfrequency"
"description": "https://schema.org/description"
}
}
```
Expand Down Expand Up @@ -73,21 +64,21 @@ The following is an example instance of the **Agri Crop** entity
"type": "Property",
"value": "Spring wheat"
},
"agriSoil": {
"hasAgriSoil": {
"type": "Relationship",
"object": [
"urn:ngsi-ld:AgriSoil:00411b56-bd1b-4551-96e0-a6e7fde9c840",
"urn:ngsi-ld:AgriSoil:e8a8389a-edf5-4345-8d2c-b98ac1ce8e2a"
]
},
"agriFertiliser": {
"hasAgriFertiliser": {
"type": "Relationship",
"object": [
"urn:ngsi-ld:AgriFertiliser:1b0d6cf7-320c-4a2b-b2f1-4575ea850c73",
"urn:ngsi-ld:AgriFertiliser:380973c8-4d3b-4723-a899-0c0c5cc63e7e"
]
},
"agriPest": {
"hasAgriPest": {
"type": "Relationship",
"object": [
"urn:ngsi-ld:AgriPest:1b0d6cf7-320c-4a2b-b2f1-4575ea850c73",
Expand Down
36 changes: 11 additions & 25 deletions definitions/Agri-Greenhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ This entity contains a harmonised description of the conditions recorded within
| source | Property | Specifies the URL to the source of this data (either organisation or where relevant more specific source) | Recommended |
| dataProvider | Property | Specifies the URL to information about the provider of this information | Recommended |
| entityVersion | Property | The entity specification version as a number. A version number of 2.0 or later denotes the entity is represented using NGSI-LD | Recommended |
| agriParcelParent | Relationship | Reference to the AgriParcel entity to which this entity relates. | Mandatory |
| agriParcelChildren | Relationship | Related sub AgriParcel records to which this entity relates. | Optional |
| weatherObserved | Relationship | Reference to the weather observation record current for this entity. | Recommended |
| waterQualityObserved | Relationship | Reference to one or more water quality observation records current for this entity. | Recommended |
| hasAgriParcelParent | Relationship | Reference to the AgriParcel entity to which this entity relates. | Mandatory |
| hasAgriParcelChildren | Relationship | Related sub AgriParcel records to which this entity relates. | Optional |
| hasWeatherObserved | Relationship | Reference to the weather observation record current for this entity. | Recommended |
| hasWaterQualityObserved | Relationship | Reference to one or more water quality observation records current for this entity. | Recommended |
| relativeHumidity | Property | The inside relative humidity expressed as a number between 0 and 1 representing the range 0% to 100 (%).<br/><br/>0 ≤ relativeHumidity ≤ 1 | Recommended |
| leafTemperature | Property | The average greenhouse air temperature nominally in degrees centigrade. | Recommended |
| co2 | Property | The measured interior C02 concentration nominally in mg/L. | Optional |
| dailyLight | Property | Daily Accumulated light measured in kW per square metre | Optional |
| drainFlow | Property | The observed drain flow rate in litres per second | Optional |
| devices | Relationship | Reference to the IoT devices associated with this greenhouse i.e. sensors, controls. | Recommended |
| hasDevice | Relationship | Reference to the IoT devices associated with this greenhouse i.e. sensors, controls. | Recommended |

## NGSI-LD Context Definition
The following NGSI-LD context definition applies to the **Agri Greenhouse** entity
Expand All @@ -28,21 +28,7 @@ The following NGSI-LD context definition applies to the **Agri Greenhouse** enti

```JavaScript
{
"@context": {
"source": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/source",
"dataProvider": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/dataprovider",
"entityVersion": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/entityversion",
"agriParcelParent": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/agriparcelparent",
"agriParcelChildren": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/agriparcelchildren",
"weatherObserved": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/weatherobserved",
"waterQualityObserved": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/waterqualityobserved",
"relativeHumidity": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/relativehumidity",
"leafTemperature": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/leaftemperature",
"co2": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/co2",
"dailyLight": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/dailylight",
"drainFlow": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/drainflow",
"devices": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/devices"
}
"@context": {}
}
```
## Example of Agri Greenhouse Entity
Expand All @@ -63,22 +49,22 @@ The following is an example instance of the **Agri Greenhouse** entity
"source": "https://source.example.com",
"dataProvider": "https://provider.example.com",
"entityVersion": 2.0,
"agriParcelParent": {
"hasAgriParcelParent": {
"type": "Relationship",
"object": "urn:ngsi-ld:AgriParcel:c8b475e5-84a8-4346-ad79-cde1d2a4028b"
},
"agriParcelChildren": {
"hasAgriParcelChildren": {
"type": "Relationship",
"object": [
"urn:ngsi-ld:AgriParcel:8c3a525d-b42e-4048-bcdd-a119d8ddb0a5",
"urn:ngsi-ld:AgriParcel:178d74c1-e6fe-4042-b955-2c164fc90b83"
]
},
"weatherObserved": {
"hasWeatherObserved": {
"type": "Relationship",
"object": "urn:ngsi-ld:WeatherObserved:c720cec5-ac6f-40b7-8e89-becb75702d0d"
},
"waterQualityObserved": {
"hasWaterQualityObserved": {
"type": "Relationship",
"object": [
"urn:ngsi-ld:WaterQualityObserved:49f86e0b-bb90-4751-a1c3-d5a891920807",
Expand Down Expand Up @@ -120,7 +106,7 @@ The following is an example instance of the **Agri Greenhouse** entity
"unitCode": "G51",
"observedAt": "2016-08-22T19:20Z"
},
"devices": {
"hasDevice": {
"type": "Relationship",
"object": [
"urn:ngsi-ld:Device:4a40aeba-4474-11e8-86bf-03d82e958ce6",
Expand Down
25 changes: 7 additions & 18 deletions definitions/Agri-Parcel-Operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ This entity contains a harmonised description of a generic operations performed
| source | Property | Specifies the URL to the source of this data (either organisation or where relevant more specific source) | Recommended |
| dataProvider | Property | Specifies the URL to information about the provider of this information | Recommended |
| entityVersion | Property | The entity specification version as a number. A version number of 2.0 or later denotes the entity is represented using NGSI-LD | Recommended |
| agriParcel | Relationship | Reference to the AgriParcel to which this entity relates. | Mandatory |
| hasAgriParcel | Relationship | Reference to the AgriParcel to which this entity relates. | Mandatory |
| operationType | Property | A choice from an enumerated list describing the operation performed on the parcel. One of: **fertiliser, inspection, pesticide, water, other.** | Recommended |
| description | Property | A description of the operation. | Recommended |
| result | Property | A description of the results of the operation. One of: **ok, aborted, failed.** | Recommended |
| plannedStartAt | DateTime | The planned start date/timestamp for the operation. <br/><br/>Note that this is advisory and the actual time the operation starts may be before or after the planned start. | Mandatory |
| plannedEndAt | DateTime | The planned end date/timestamp for the operation. <br/><br/>Note that this is advisory and the actual time the operation finishes may be before or after the planned end. | Mandatory |
| status | Property | A choice from an enumerated list describing the status. One of: **planned, ongoing, finished, scheduled, cancelled.** | Recommended |
| operator | Relationship | Reference to the operator conducting the operation | Recommended |
| hasOperator | Relationship | Reference to the operator conducting the operation | Recommended |
| startedAt | DateTime | Timestamp when the operation actually started to be performed. | Recommended |
| endedAt | DateTime | Timestamp when the operation actually finished. | Recommended |
| reportedAt | DateTime | Timestamp when the event/ fault was reported. | Recommended |
| agriProduct | Relationship | Reference to the AgriProduct used/ applied. | Optional |
| hasAgriProductType | Relationship | Reference to the AgriProductType used/ applied. | Optional |
| quantity | Property | The total quantity of water or product used/ applied. It is recommended this is measured in litres for liquids or kilogrammes for solids. | Optional |
| waterSource | Property | If water was applied/ use this specifies the source. One of: **borehole, rainfall, river, rainwater capture, water dam, commercial supply.** | Recommended |
| <em>startDate</em> | <em>DateTime</em> | <em>The planned start date/timestamp for the operation. <br/><br/>Note that this is advisory and the actual time the operation starts may be before or after the planned start.<br/><br/>Note this field was defined for use with NGSIv2 and is now deprecated. For new entities and applications replace with **plannedStartAt**</em> | <em>Deprecated</em> |
Expand All @@ -37,13 +37,7 @@ The following NGSI-LD context definition applies to the **Agri Parcel Operation*
```JavaScript
{
"@context": {
"source": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/source",
"dataProvider": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/dataprovider",
"entityVersion": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/entityversion",
"agriParcel": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/agriparcel",
"operationType": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/operationtype",
"description": "https://schema.org/description",
"result": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/result",
"plannedStartAt": {
"@type": "DateTime",
"@id": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/plannedstartat"
Expand All @@ -52,8 +46,6 @@ The following NGSI-LD context definition applies to the **Agri Parcel Operation*
"@type": "DateTime",
"@id": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/plannedendat"
},
"status": "http://uri.etsi.org/ngsi-ld/status",
"operator": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/operator",
"startedAt": {
"@type": "DateTime",
"@id": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/startedat"
Expand All @@ -66,9 +58,6 @@ The following NGSI-LD context definition applies to the **Agri Parcel Operation*
"@type": "DateTime",
"@id": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/reportedat"
},
"agriProduct": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/agriproduct",
"quantity": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/quantity",
"waterSource": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/watersource",
"startDate": {
"@type": "DateTime",
"@id": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/startdate"
Expand Down Expand Up @@ -106,7 +95,7 @@ The following is an example instance of the **Agri Parcel Operation** entity
"source": "https://source.example.com",
"dataProvider": "https://provider.example.com",
"entityVersion": 2.0,
"agriParcel": {
"hasAgriParcel": {
"type": "Relationship",
"object": "urn:ngsi-ld:AgriParcel:318366a9-7643-4d8e-9a11-c76a8c29d8eb"
},
Expand Down Expand Up @@ -134,7 +123,7 @@ The following is an example instance of the **Agri Parcel Operation** entity
"type": "Property",
"value": "finished"
},
"operator": {
"hasOperator": {
"type": "Relationship",
"object": "urn:ngsi-ld:Person:fce9dcbc-4479-11e8-9de1-cb228de7a15c"
},
Expand All @@ -150,9 +139,9 @@ The following is an example instance of the **Agri Parcel Operation** entity
"type": "Property",
"value": "2016-08-28T10:18:16Z"
},
"agriProduct": {
"hasAgriProductType": {
"type": "Relationship",
"object": "urn:ngsi-ld:AgriProduct:a8f616b8-13fb-473a-8e61-b7a80c6c93ec"
"object": "urn:ngsi-ld:AgriProductType:a8f616b8-13fb-473a-8e61-b7a80c6c93ec"
},
"quantity": {
"type": "Property",
Expand Down
25 changes: 8 additions & 17 deletions definitions/Agri-Parcel-Record.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This entity contains a harmonised description of the conditions recorded on a ge
| source | Property | Specifies the URL to the source of this data (either organisation or where relevant more specific source) | Recommended |
| dataProvider | Property | Specifies the URL to information about the provider of this information | Recommended |
| entityVersion | Property | The entity specification version as a number. A version number of 2.0 or later denotes the entity is represented using NGSI-LD | Recommended |
| agriParcel | Relationship | Reference to the AgriParcel to which this entity relates. | Mandatory |
| hasAgriParcel | Relationship | Reference to the AgriParcel to which this entity relates. | Mandatory |
| location | GeoProperty | The geo:json encoded polygon / multi-polygon describing the parcel which this record relates to. | Mandatory |
| soilTemperature | Property | The observed soil temperature nominally in degrees centigrade. | Optional |
| soilMoistureVwc | Property | Measured as Volumetric Water Content, VWC as a percentage.<br/><br/>0 ≤soilMoistureVwc ≤ 1 | Optional |
Expand All @@ -20,7 +20,7 @@ This entity contains a harmonised description of the conditions recorded on a ge
| relativeHumidity | Property | Relative Humidity a number between 0 and 1 representing the range of 0% to 100%.<br/><br/>0 ≤ relativeHumidity ≤ 1 | Optional |
| atmosphericPressure | Property | Atmospheric Pressure nominally in units of hecto Pascals. | Recommended |
| description | Property | A description of this record | Recommended |
| devices | Relationship | Reference to the IoT devices associated with this greenhouse i.e. sensors, controls. | Recommended |
| hasDevice | Relationship | Reference to the IoT devices associated with this greenhouse i.e. sensors, controls. | Recommended |
| observedAt | DateTime | Indicates the date/time the record was observed/ last observed. | Recommended |

## NGSI-LD Context Definition
Expand All @@ -31,20 +31,11 @@ The following NGSI-LD context definition applies to the **Agri Parcel Record** e
```JavaScript
{
"@context": {
"source": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/source",
"dataProvider": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/dataprovider",
"entityVersion": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/entityversion",
"agriParcel": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/agriparcel",
"location": "http://uri.etsi.org/ngsi-ld/location",
"soilTemperature": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/soiltemperature",
"soilMoistureVwc": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/soilmoisturevwc",
"soilMoistureEc": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/soilmoistureec",
"airTemperature": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/airtemperature",
"solarRadiation": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/solarradiation",
"relativeHumidity": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/relativehumidity",
"atmosphericPressure": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/atmosphericpressure",
"description": "https://schema.org/description",
"devices": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/devices"
"observedAt": {
"@type": "DateTime",
"@id": "https://www.gsma.com/iot/iot-big-data/ngsi-ld/observedat"
}
}
}
```
Expand All @@ -66,7 +57,7 @@ The following is an example instance of the **Agri Parcel Record** entity
"source": "https://source.example.com",
"dataProvider": "https://provider.example.com",
"entityVersion": 2.0,
"agriParcel": {
"hasAgriParcel": {
"type": "Relationship",
"object": "urn:ngsi-ld:AgriParcel:d3676010-d815-468c-9e01-25739c5a25ed"
},
Expand Down Expand Up @@ -144,7 +135,7 @@ The following is an example instance of the **Agri Parcel Record** entity
"type": "Property",
"value": "Monthly fertiliser application"
},
"devices": {
"hasDevice": {
"type": "Relationship",
"object": [
"urn:ngsi-ld:Device:4a40aeba-4474-11e8-86bf-03d82e958ce6",
Expand Down
Loading

0 comments on commit 9c31183

Please sign in to comment.