Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import AgriParcel Smart Model Data into a FIWARE context broker #272

Open
computate opened this issue Dec 16, 2022 · 0 comments
Open

import AgriParcel Smart Model Data into a FIWARE context broker #272

computate opened this issue Dec 16, 2022 · 0 comments
Labels
AgriParcel data to import AgriParcel Smart Model Data into a FIWARE context broker json-rest-apis-curl Suggested skills: JSON REST APIs, curl

Comments

@computate
Copy link
Member

computate commented Dec 16, 2022

Mission

import AgriParcel Smart Model Data into a FIWARE context broker

Your mission, should you choose to accept it, is to import AgriParcel Smart Model Data into a FIWARE context broker.

Walk through Youtube videos related to your task

These Youtube videos have been carefully prepared to help you with this data import task:

More details about your task

  • You can import live AgriParcel data if you can find it, or fake AgriParcel data that your team can come up with (see the Example payloads below).
  • You could also reach out to existing AgriParcel adopters, who are organizations who already work with these models. You may find some AgriParcel adopters listed below.
  • Work with your visualization specialist to decide what kind of data will produce useful visualizations in the project.
  • You can import as much or as little AgriParcel data as you wish, but enough to help your visualization specialist create nice visualizations of the data.
  • Work with your OpenShift deployment specialist to deploy the data to an Orion LD context broker, or [ follow the instructions to run FIWARE on your own OpenShift Local ] and deploy the AgriParcel data on your own laptop.
  • Work with your documentation specialist to document some useful example data used in your project.
  • If you are not sure where obtain AgriParcel data, you may want to use your imagination. Imagine if there was a AgriParcel sensor in your actual city, or a AgriParcel sensor in a small scale toy city that you could simulate. What kind of sensors could you use? How would you design such a simulation in an actual city or a toy city? How would you visualize AgriParcel data in an actual city or a toy city?
  • With a working Context Broker, you should be able to deploy AgriParcel Smart Model Data as defined in this GitHub issue in the Example payloads section. Save an example JSON payload to a file like ~/Downloads/AgriParcel1.json. Then POST the Smart Model Data to the Context Broker with the curl command: curl -iX POST 'http://orion-ld-fiware.apps-crc.testing/v2/entities?options=keyValues' -H 'Content-Type: application/json' -d @$HOME/Downloads/AgriParcel1.json if using a NGSI-v2 key-values Example.
  • Or curl -iX POST 'http://orion-ld-fiware.apps-crc.testing/v2/entities' -H 'Content-Type: application/json' -d @$HOME/Downloads/AgriParcel1.json if using a NGSI-v2 normalized Example.
  • If you need to update a payload that was already POSTed to the Context Broker, you can update the values. Update the example JSON payload by removing the id and type fields in ~/Downloads/AgriParcel1.json, but keep track of the value of the id field, because you will need it for the next part. Then PUT the Smart Model Data to the Context Broker with the curl command, but replace ENTITY_ID with the id of the entity URL encoded: curl -iX PUT 'http://orion-ld-fiware.apps-crc.testing/v2/entities/ENTITIY_ID/attrs?options=keyValues' -H 'Content-Type: application/json' -d @$HOME/Downloads/AgriParcel1.json if using a NGSI-v2 key-values Example.
  • Or curl -iX PUT 'http://orion-ld-fiware.apps-crc.testing/v2/entities/ENTITY_ID/attrs' -H 'Content-Type: application/json' -d @$HOME/Downloads/AgriParcel1.json if using a NGSI-v2 normalized Example.
  • See this documentation for more examples of FIWARE Context Broker API CRUD Operations.

The day of the operation is Thursday February 2nd, 2023

You will have 4 hours to complete your mission.

Work with Smart Data Models and the FIWARE Context broker in Europe

At the end of the day

Should you, or any of your force be taken or compromised that day, you must report back as many changes as you have made, and any knowledge of your actions, by pull request or comments on the issue on the board.

The details of your mission:

Smart Data Models

Entity: AgriParcel

Open License

document generated automatically

Global description: This entity contains a harmonised description of a generic parcel of land. This entity is primarily associated with the agricultural vertical and related IoT applications.

version: 0.0.4

List of properties

  • address: The mailing address
  • alternateName: An alternative name for this item
  • area: The area of the parcel nominally in square meters.
  • areaServed: The geographic area where a service or offered item is provided
  • belongsTo: Entity the item belongs to
  • category: The category of the parcel of land e.g.: arable, grassland, vineyard, orchard, mixed crop, lowland, upland, set-aside, forestry, wetland.
  • cropStatus: Enum:'seeded, justBorn, growing, maturing, readyForHarvesting'. A choice from an enumerated list describing the crop planting status
  • dataProvider: A sequence of characters identifying the provider of the harmonised data entity.
  • dateCreated: Entity creation timestamp. This will usually be allocated by the storage platform.
  • dateModified: Timestamp of the last modification of the entity. This will usually be allocated by the storage platform.
  • description: A description of this item
  • hasAgriCrop: Reference to the crop associated with this parcel
  • hasAgriParcelChildren: Related sub AgriParcel records to which this entity relates
  • hasAgriParcelParent: Reference to the parent AgriParcel
  • hasAgriSoil: Reference to the soil associated with this parcel of land
  • hasDevices: Reference to the IoT devices associated with this parcel i.e. sensors, controls.
  • id: Unique identifier of the entity
  • irrigationSystemType: Enum: 'Surface irrigation', 'Localized irrigation', 'Drip irrigation', 'Sprinkler irrigation', 'Center pivot irrigation', 'Lateral move irrigation', 'Sub-irrigation', 'Manual irrigation'. Based on common types of irrigation systems as defined by Centers for Disease Control and Prevention (CDC): https://www.cdc.gov/healthywater/other/agricultural/types.html
  • lastPlantedAt: Indicates the date when the crop was last planted
  • location: Geojson reference to the item. It can be Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon
  • name: The name of this item.
  • ownedBy: Owner (Person or Organization) of the item
  • owner: A List containing a JSON encoded sequence of characters referencing the unique Ids of the owner(s)
  • relatedSource: List of IDs the current entity may have in external applications
  • seeAlso: list of uri pointing to additional resources about the item
  • soilTextureType: Enum: 'Sands', 'Loamy sands', 'Sandy loams', 'Loam', 'Silt loam', 'Silt', 'Sandy clay loam', 'Clay loam', 'Silty clay loam', 'Sandy clay', 'Silty clay', 'Clay'. Based on the soil texture classification of the United States Department of Agriculture (USDA): https://www.nrcs.usda.gov/wps/portal/nrcs/detailfull/soils/ref/?cid=nrcs142p2_054262
  • source: A sequence of characters giving the original source of the entity data as a URL. Recommended to be the fully qualified domain name of the source provider, or the URL to the source object.
  • type: NGSI Entity Type. It has to be AgriParcel

Required properties

  • area
  • hasAgriCrop
  • id
  • location
  • type

This entity is primarily associated with the agricultural vertical and related IoT applications.

Data Model description of properties

Sorted alphabetically (click for details)

full yaml details
AgriParcel:    
  description: 'This entity contains a harmonised description of a generic parcel of land. This entity is primarily associated with the agricultural vertical and related IoT applications.'    
  properties:    
    address:    
      description: 'The mailing address'    
      properties:    
        addressCountry:    
          description: 'Property. The country. For example, Spain. Model:''https://schema.org/addressCountry'''    
          type: string    
        addressLocality:    
          description: 'Property. The locality in which the street address is, and which is in the region. Model:''https://schema.org/addressLocality'''    
          type: string    
        addressRegion:    
          description: 'Property. The region in which the locality is, and which is in the country. Model:''https://schema.org/addressRegion'''    
          type: string    
        postOfficeBoxNumber:    
          description: 'Property. The post office box number for PO box addresses. For example, 03578. Model:''https://schema.org/postOfficeBoxNumber'''    
          type: string    
        postalCode:    
          description: 'Property. The postal code. For example, 24004. Model:''https://schema.org/https://schema.org/postalCode'''    
          type: string    
        streetAddress:    
          description: 'Property. The street address. Model:''https://schema.org/streetAddress'''    
          type: string    
      type: object    
      x-ngsi:    
        model: https://schema.org/address    
        type: Property    
    alternateName:    
      description: 'An alternative name for this item'    
      type: string    
      x-ngsi:    
        type: Property    
    area:    
      description: 'The area of the parcel nominally in square meters.'    
      minimum: 0    
      type: number    
      x-ngsi:    
        model: http://schema.org/Number    
        type: Property    
        units: m2    
    areaServed:    
      description: 'The geographic area where a service or offered item is provided'    
      type: string    
      x-ngsi:    
        model: https://schema.org/Text    
        type: Property    
    belongsTo:    
      anyOf:    
        - description: 'Property. Identifier format of any NGSI entity'    
          maxLength: 256    
          minLength: 1    
          pattern: ^[\w\-\.\{\}\$\+\*\[\]`|~^@!,:\\]+$    
          type: string    
        - description: 'Property. Identifier format of any NGSI entity'    
          format: uri    
          type: string    
      description: 'Entity the item belongs to'    
      x-ngsi:    
        type: Relationship    
    category:    
      description: 'The category of the parcel of land e.g.: **arable, grassland, vineyard, orchard, mixed crop, lowland, upland, set-aside, forestry, wetland.**'    
      type: string    
      x-ngsi:    
        model: http://schema.org/Text    
        type: Property    
    cropStatus:    
      description: 'Enum:''seeded, justBorn, growing, maturing, readyForHarvesting''. A choice from an enumerated list describing the crop planting status'    
      enum:    
        - seeded    
        - justBorn    
        - growing    
        - maturing    
        - readyForHarvesting    
      type: string    
      x-ngsi:    
        type: Property    
    dataProvider:    
      description: 'A sequence of characters identifying the provider of the harmonised data entity.'    
      type: string    
      x-ngsi:    
        type: Property    
    dateCreated:    
      description: 'Entity creation timestamp. This will usually be allocated by the storage platform.'    
      format: date-time    
      type: string    
      x-ngsi:    
        type: Property    
    dateModified:    
      description: 'Timestamp of the last modification of the entity. This will usually be allocated by the storage platform.'    
      format: date-time    
      type: string    
      x-ngsi:    
        type: Property    
    description:    
      description: 'A description of this item'    
      type: string    
      x-ngsi:    
        type: Property    
    hasAgriCrop:    
      anyOf:    
        - description: 'Property. Identifier format of any NGSI entity'    
          maxLength: 256    
          minLength: 1    
          pattern: ^[\w\-\.\{\}\$\+\*\[\]`|~^@!,:\\]+$    
          type: string    
        - description: 'Property. Identifier format of any NGSI entity'    
          format: uri    
          type: string    
      description: 'Reference to the crop associated with this parcel'    
      x-ngsi:    
        type: Relationship    
    hasAgriParcelChildren:    
      description: 'Related sub AgriParcel records to which this entity relates'    
      items:    
        anyOf: &agriparcel_-_properties_-_hasdevices_-_items_-_anyof    
          - description: 'Property. Identifier format of any NGSI entity'    
            maxLength: 256    
            minLength: 1    
            pattern: ^[\w\-\.\{\}\$\+\*\[\]`|~^@!,:\\]+$    
            type: string    
          - description: 'Property. Identifier format of any NGSI entity'    
            format: uri    
            type: string    
        description: 'Property. Unique identifier of the entity'    
      type: array    
      x-ngsi:    
        type: Relationship    
    hasAgriParcelParent:    
      anyOf:    
        - description: 'Property. Identifier format of any NGSI entity'    
          maxLength: 256    
          minLength: 1    
          pattern: ^[\w\-\.\{\}\$\+\*\[\]`|~^@!,:\\]+$    
          type: string    
        - description: 'Property. Identifier format of any NGSI entity'    
          format: uri    
          type: string    
      description: 'Reference to the parent AgriParcel'    
      x-ngsi:    
        type: Relationship    
    hasAgriSoil:    
      anyOf:    
        - description: 'Property. Identifier format of any NGSI entity'    
          maxLength: 256    
          minLength: 1    
          pattern: ^[\w\-\.\{\}\$\+\*\[\]`|~^@!,:\\]+$    
          type: string    
        - description: 'Property. Identifier format of any NGSI entity'    
          format: uri    
          type: string    
      description: 'Reference to the soil associated with this parcel of land'    
      x-ngsi:    
        type: Relationship    
    hasDevices:    
      description: 'Reference to the IoT devices associated with this parcel i.e. sensors, controls.'    
      items:    
        anyOf: *agriparcel_-_properties_-_hasdevices_-_items_-_anyof    
        description: 'Property. Unique identifier of the entity'    
      type: array    
      x-ngsi:    
        type: Property    
    id:    
      anyOf: *agriparcel_-_properties_-_hasdevices_-_items_-_anyof    
      description: 'Unique identifier of the entity'    
      x-ngsi:    
        type: Property    
    irrigationSystemType:    
      description: 'Enum: ''Surface irrigation'', ''Localized irrigation'', ''Drip irrigation'', ''Sprinkler irrigation'', ''Center pivot irrigation'', ''Lateral move irrigation'', ''Sub-irrigation'', ''Manual irrigation''. Based on common types of irrigation systems as defined by Centers for Disease Control and Prevention (CDC): https://www.cdc.gov/healthywater/other/agricultural/types.html'    
      enum:    
        - 'Surface irrigation'    
        - 'Localized irrigation'    
        - 'Drip irrigation'    
        - 'Sprinkler irrigation'    
        - 'Center pivot irrigation'    
        - 'Lateral move irrigation'    
        - Sub-irrigation    
        - 'Manual irrigation'    
      type: string    
      x-ngsi:    
        type: Property    
    lastPlantedAt:    
      description: 'Indicates the date when the crop was last planted'    
      format: date-time    
      type: string    
      x-ngsi:    
        type: Property    
    location:    
      description: 'Geojson reference to the item. It can be Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon'    
      oneOf:    
        - description: 'Geoproperty. Geojson reference to the item. Point'    
          properties:    
            bbox:    
              items:    
                type: number    
              minItems: 4    
              type: array    
            coordinates:    
              items:    
                type: number    
              minItems: 2    
              type: array    
            type:    
              enum:    
                - Point    
              type: string    
          required:    
            - type    
            - coordinates    
          title: 'GeoJSON Point'    
          type: object    
        - description: 'Geoproperty. Geojson reference to the item. LineString'    
          properties:    
            bbox:    
              items:    
                type: number    
              minItems: 4    
              type: array    
            coordinates:    
              items:    
                items:    
                  type: number    
                minItems: 2    
                type: array    
              minItems: 2    
              type: array    
            type:    
              enum:    
                - LineString    
              type: string    
          required:    
            - type    
            - coordinates    
          title: 'GeoJSON LineString'    
          type: object    
        - description: 'Geoproperty. Geojson reference to the item. Polygon'    
          properties:    
            bbox:    
              items:    
                type: number    
              minItems: 4    
              type: array    
            coordinates:    
              items:    
                items:    
                  items:    
                    type: number    
                  minItems: 2    
                  type: array    
                minItems: 4    
                type: array    
              type: array    
            type:    
              enum:    
                - Polygon    
              type: string    
          required:    
            - type    
            - coordinates    
          title: 'GeoJSON Polygon'    
          type: object    
        - description: 'Geoproperty. Geojson reference to the item. MultiPoint'    
          properties:    
            bbox:    
              items:    
                type: number    
              minItems: 4    
              type: array    
            coordinates:    
              items:    
                items:    
                  type: number    
                minItems: 2    
                type: array    
              type: array    
            type:    
              enum:    
                - MultiPoint    
              type: string    
          required:    
            - type    
            - coordinates    
          title: 'GeoJSON MultiPoint'    
          type: object    
        - description: 'Geoproperty. Geojson reference to the item. MultiLineString'    
          properties:    
            bbox:    
              items:    
                type: number    
              minItems: 4    
              type: array    
            coordinates:    
              items:    
                items:    
                  items:    
                    type: number    
                  minItems: 2    
                  type: array    
                minItems: 2    
                type: array    
              type: array    
            type:    
              enum:    
                - MultiLineString    
              type: string    
          required:    
            - type    
            - coordinates    
          title: 'GeoJSON MultiLineString'    
          type: object    
        - description: 'Geoproperty. Geojson reference to the item. MultiLineString'    
          properties:    
            bbox:    
              items:    
                type: number    
              minItems: 4    
              type: array    
            coordinates:    
              items:    
                items:    
                  items:    
                    items:    
                      type: number    
                    minItems: 2    
                    type: array    
                  minItems: 4    
                  type: array    
                type: array    
              type: array    
            type:    
              enum:    
                - MultiPolygon    
              type: string    
          required:    
            - type    
            - coordinates    
          title: 'GeoJSON MultiPolygon'    
          type: object    
      x-ngsi:    
        type: Geoproperty    
    name:    
      description: 'The name of this item.'    
      type: string    
      x-ngsi:    
        type: Property    
    ownedBy:    
      anyOf:    
        - description: 'Property. Identifier format of any NGSI entity'    
          maxLength: 256    
          minLength: 1    
          pattern: ^[\w\-\.\{\}\$\+\*\[\]`|~^@!,:\\]+$    
          type: string    
        - description: 'Property. Identifier format of any NGSI entity'    
          format: uri    
          type: string    
      description: 'Owner (Person or Organization) of the item'    
      x-ngsi:    
        type: Relationship    
    owner:    
      description: 'A List containing a JSON encoded sequence of characters referencing the unique Ids of the owner(s)'    
      items:    
        anyOf: *agriparcel_-_properties_-_hasdevices_-_items_-_anyof    
        description: 'Property. Unique identifier of the entity'    
      type: array    
      x-ngsi:    
        type: Property    
    relatedSource:    
      description: 'List of IDs the current entity may have in external applications'    
      items:    
        properties:    
          application:    
            anyOf: *agriparcel_-_properties_-_hasdevices_-_items_-_anyof    
            description: 'Property. Unique identifier of the entity'    
          applicationEntityId:    
            type: string    
        type: object    
      type: array    
      x-ngsi:    
        type: Property    
    seeAlso:    
      description: 'list of uri pointing to additional resources about the item'    
      oneOf:    
        - items:    
            format: uri    
            type: string    
          minItems: 1    
          type: array    
        - format: uri    
          type: string    
      x-ngsi:    
        type: Property    
    soilTextureType:    
      description: 'Enum: ''Sands'', ''Loamy sands'', ''Sandy loams'', ''Loam'', ''Silt loam'', ''Silt'', ''Sandy clay loam'', ''Clay loam'', ''Silty clay loam'', ''Sandy clay'', ''Silty clay'', ''Clay''. Based on the soil texture classification of the United States Department of Agriculture (USDA): https://www.nrcs.usda.gov/wps/portal/nrcs/detailfull/soils/ref/?cid=nrcs142p2_054262'    
      enum:    
        - Sands    
        - 'Loamy sands'    
        - 'Sandy loams'    
        - Loam    
        - 'Silt loam'    
        - Silt    
        - 'Sandy clay loam'    
        - 'Clay loam'    
        - 'Silty clay loam'    
        - 'Sandy clay'    
        - 'Silty clay'    
        - Clay    
      type: string    
      x-ngsi:    
        type: Property    
    source:    
      description: 'A sequence of characters giving the original source of the entity data as a URL. Recommended to be the fully qualified domain name of the source provider, or the URL to the source object.'    
      type: string    
      x-ngsi:    
        type: Property    
    type:    
      description: 'NGSI Entity Type. It has to be AgriParcel'    
      enum:    
        - AgriParcel    
      type: string    
      x-ngsi:    
        type: Property    
  required:    
    - id    
    - type    
    - location    
    - area    
    - hasAgriCrop    
  type: object    
  x-derived-from: ""    
  x-disclaimer: 'Redistribution and use in source and binary forms, with or without modification, are permitted  provided that the license conditions are met. Copyleft (c) 2022 Contributors to Smart Data Models Program'    
  x-license-url: https://github.com/smart-data-models/dataModel.Agrifood/blob/master/AgriParcel/LICENSE.md    
  x-model-schema: https://smart-data-models.github.io/dataModel.Agrifood/AgriParcel/schema.json    
  x-model-tags: ""    
  x-version: 0.0.4    

Example payloads

AgriParcel NGSI-v2 key-values Example

Here is an example of a AgriParcel in JSON-LD format as key-values. This is compatible with NGSI-v2 when using options=keyValues and returns the context data of an individual entity.

{  
  "id": "urn:ngsi-ld:AgriParcel:72d9fb43-53f8-4ec8-a33c-fa931360259a",  
  "type": "AgriParcel",  
  "dateCreated": "2017-01-01T01:20:00Z",  
  "dateModified": "2017-05-04T12:30:00Z",  
  "location": {  
    "type": "Polygon",  
    "coordinates": [[[100, 0], [101, 0], [101, 1], [100, 1], [100, 0]]]  
  },  
  "area": 200,  
  "description": "Spring wheat",  
  "category": "arable",  
  "relatedSource": [  
    {  
      "application": "urn:ngsi-ld:AgriApp:72d9fb43-53f8-4ec8-a33c-fa931360259a",  
      "applicationEntityId": "app:parcel1"  
    }  
  ],  
  "seeAlso": [  
    "https://example.org/concept/agriparcel",  
    "https://datamodel.org/example/agriparcel"  
  ],  
  "belongsTo": "urn:ngsi-ld:AgriFarm:f67adcbc-4479-22bc-9de1-cb228de7a765",  
  "ownedBy": "urn:ngsi-ld:Person:fce9dcbc-4479-11e8-9de1-cb228de7a15c",  
  "hasAgriParcelParent": "urn:ngsi-ld:AgriParcel:1ea0f120-4474-11e8-9919-672036642081",  
  "hasAgriParcelChildren": [  
    "urn:ngsi-ld:AgriParcel:26ba4be0-4474-11e8-8ec1-ab9e0ea93835",  
    "urn:ngsi-ld:AgriParcel:2d5b8874-4474-11e8-8d6b-dbe14425b5e4"  
  ],  
  "hasAgriCrop": "urn:ngsi-ld:AgriCrop:36021150-4474-11e8-a721-af07c5fae7c8",  
  "cropStatus": "seeded",  
  "lastPlantedAt": "2016-08-23T10:18:16Z",  
  "hasAgriSoil": "urn:ngsi-ld:AgriSoil:429d1338-4474-11e8-b90a-d3e34ceb73df",  
  "hasDevice": [  
    "urn:ngsi-ld:Device:4a40aeba-4474-11e8-86bf-03d82e958ce6",  
    "urn:ngsi-ld:Device:63217d24-4474-11e8-9da2-c3dd3c36891b",  
    "urn:ngsi-ld:Device:68e091dc-4474-11e8-a398-df010c53b416",  
    "urn:ngsi-ld:6f44b54e-4474-11e8-8577-d7ff6a8ef551"  
  ],  
  "soilTextureType": "Clay",  
  "irrigationSystemType": "Drip irrigation"  
}  

AgriParcel NGSI-v2 normalized Example

Here is an example of a AgriParcel in JSON-LD format as normalized. This is compatible with NGSI-v2 when not using options and returns the context data of an individual entity.

{  
  "id": "urn:ngsi-ld:AgriParcel:72d9fb43-53f8-4ec8-a33c-fa931360259a",  
  "type": "AgriParcel",  
  "dateCreated": {  
    "type": "DateTime",  
    "value": "2017-01-01T01:20:00Z"  
  },  
  "dateModified": {  
    "type": "DateTime",  
    "value": "2017-05-04T12:30:00Z"  
  },  
  "location": {  
    "type": "geo:json",  
    "value": {  
      "type": "Polygon",  
      "coordinates": [[[100, 0], [101, 0], [101, 1], [100, 1], [100, 0]]]  
    }  
  },  
  "area": {  
    "value": 200  
  },  
  "description": {  
    "value": "Spring wheat"  
  },  
  "category": {  
    "value": "arable"  
  },  
  "relatedSource": {  
    "value": [  
      {  
        "application": "urn:ngsi-ld:AgriApp:72d9fb43-53f8-4ec8-a33c-fa931360259a",  
        "applicationEntityId": "app:parcel1"  
      }  
    ]  
  },  
  "seeAlso": {  
    "value": [  
      "https://example.org/concept/agriparcel",  
      "https://datamodel.org/example/agriparcel"  
    ]  
  },  
  "belongsTo": {  
    "type": "Relationship",  
    "value": "urn:ngsi-ld:AgriFarm:f67adcbc-4479-22bc-9de1-cb228de7a765"  
  },  
  "ownedBy": {  
    "type": "Relationship",  
    "value": "urn:ngsi-ld:Person:fce9dcbc-4479-11e8-9de1-cb228de7a15c"  
  },  
  "hasAgriParcelParent": {  
    "type": "Relationship",  
    "value": "urn:ngsi-ld:AgriParcel:1ea0f120-4474-11e8-9919-672036642081"  
  },  
  "hasAgriParcelChildren": {  
    "type": "Relationship",  
    "value": [  
      "urn:ngsi-ld:AgriParcel:26ba4be0-4474-11e8-8ec1-ab9e0ea93835",  
      "urn:ngsi-ld:AgriParcel:2d5b8874-4474-11e8-8d6b-dbe14425b5e4"  
    ]  
  },  
  "hasAgriCrop": {  
    "type": "Relationship",  
    "value": "urn:ngsi-ld:AgriCrop:36021150-4474-11e8-a721-af07c5fae7c8"  
  },  
  "cropStatus": {  
    "value": "seeded"  
  },  
  "lastPlantedAt": {  
    "type": "DateTime",  
    "value": "2016-08-23T10:18:16Z"  
  },  
  "hasAgriSoil": {  
    "type": "Relationship",  
    "value": "urn:ngsi-ld:AgriSoil:429d1338-4474-11e8-b90a-d3e34ceb73df"  
  },  
  "hasDevice": {  
    "type": "Relationship",  
    "value": [  
      "urn:ngsi-ld:Device:4a40aeba-4474-11e8-86bf-03d82e958ce6",  
      "urn:ngsi-ld:Device:63217d24-4474-11e8-9da2-c3dd3c36891b",  
      "urn:ngsi-ld:Device:68e091dc-4474-11e8-a398-df010c53b416",  
      "urn:ngsi-ld:Device:6f44b54e-4474-11e8-8577-d7ff6a8ef551"  
    ]  
  },  
  "soilTextureType": {  
      "type": "string",  
      "value": "Clay"  
  },  
  "irrigationSystemType": {  
      "type": "string",  
      "value": "Drip irrigation"  
  }  
}  

AgriParcel NGSI-LD key-values Example

Here is an example of a AgriParcel in JSON-LD format as key-values. This is compatible with NGSI-LD when using options=keyValues and returns the context data of an individual entity.

{  
    "id": "urn:ngsi-ld:AgriParcel:72d9fb43-53f8-4ec8-a33c-fa931360259a",  
    "type": "AgriParcel",  
    "area": 200,  
    "belongsTo": "urn:ngsi-ld:AgriFarm:f67adcbc-4479-22bc-9de1-cb228de7a765",  
    "category": "arable",  
    "createdAt": "2017-01-01T01:20:00Z",  
    "cropStatus": "seeded",  
    "description": "Spring wheat",  
    "hasAgriCrop": "urn:ngsi-ld:AgriCrop:36021150-4474-11e8-a721-af07c5fae7c8",  
    "hasAgriParcelChildren": [  
        "urn:ngsi-ld:AgriParcel:26ba4be0-4474-11e8-8ec1-ab9e0ea93835",  
        "urn:ngsi-ld:AgriParcel:2d5b8874-4474-11e8-8d6b-dbe14425b5e4"  
    ],  
    "hasAgriParcelParent": "urn:ngsi-ld:AgriParcel:1ea0f120-4474-11e8-9919-672036642081",  
    "hasAgriSoil": "urn:ngsi-ld:AgriSoil:429d1338-4474-11e8-b90a-d3e34ceb73df",  
    "hasDevice": [  
        "urn:ngsi-ld:Device:4a40aeba-4474-11e8-86bf-03d82e958ce6",  
        "urn:ngsi-ld:Device:63217d24-4474-11e8-9da2-c3dd3c36891b",  
        "urn:ngsi-ld:Device:68e091dc-4474-11e8-a398-df010c53b416",  
        "urn:ngsi-ld:6f44b54e-4474-11e8-8577-d7ff6a8ef551"  
    ],  
    "lastPlantedAt": {  
        "@type": "DateTime",  
        "@value": "2016-08-22T10:18:16Z"  
    },  
    "location": {  
        "coordinates": [  
            [  
                100,  
                0  
            ],  
            [  
                101,  
                0  
            ],  
            [  
                101,  
                1  
            ],  
            [  
                100,  
                1  
            ],  
            [  
                100,  
                0  
            ]  
        ],  
        "type": "Polygon"  
    },  
    "modifiedAt": "2017-05-04T12:30:00Z",  
    "ownedBy": "urn:ngsi-ld:Person:fce9dcbc-4479-11e8-9de1-cb228de7a15c",  
    "relatedSource": [  
        {  
            "application": "urn:ngsi-ld:AgriApp:72d9fb43-53f8-4ec8-a33c-fa931360259a",  
            "applicationEntityId": "app:parcel1"  
        }  
    ],  
    "seeAlso": [  
        "https://example.org/concept/agriparcel",  
        "https://datamodel.org/example/agriparcel"  
    ],  
    "@context": [  
        "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld",  
        "https://raw.githubusercontent.com/smart-data-models/dataModel.Agrifood/master/context.jsonld"  
    ]  
}  

AgriParcel NGSI-LD normalized Example

Here is an example of a AgriParcel in JSON-LD format as normalized. This is compatible with NGSI-LD when not using options and returns the context data of an individual entity.

{  
    "id": "urn:ngsi-ld:AgriParcel:72d9fb43-53f8-4ec8-a33c-fa931360259a",  
    "type": "AgriParcel",  
    "area": {  
        "type": "Property",  
        "value": 200  
    },  
    "belongsTo": {  
        "type": "Relationship",  
        "object": "urn:ngsi-ld:AgriFarm:f67adcbc-4479-22bc-9de1-cb228de7a765"  
    },  
    "category": {  
        "type": "Property",  
        "value": "arable"  
    },  
    "createdAt": "2017-01-01T01:20:00Z",  
    "cropStatus": {  
        "type": "Property",  
        "value": "seeded"  
    },  
    "description": {  
        "type": "Property",  
        "value": "Spring wheat"  
    },  
    "hasAgriCrop": {  
        "type": "Relationship",  
        "object": "urn:ngsi-ld:AgriCrop:36021150-4474-11e8-a721-af07c5fae7c8"  
    },  
    "hasAgriParcelChildren": {  
        "type": "Relationship",  
        "object": [  
            "urn:ngsi-ld:AgriParcel:26ba4be0-4474-11e8-8ec1-ab9e0ea93835",  
            "urn:ngsi-ld:AgriParcel:2d5b8874-4474-11e8-8d6b-dbe14425b5e4"  
        ]  
    },  
    "hasAgriParcelParent": {  
        "type": "Relationship",  
        "object": "urn:ngsi-ld:AgriParcel:1ea0f120-4474-11e8-9919-672036642081"  
    },  
    "hasAgriSoil": {  
        "type": "Relationship",  
        "object": "urn:ngsi-ld:AgriSoil:429d1338-4474-11e8-b90a-d3e34ceb73df"  
    },  
    "hasDevice": {  
        "type": "Relationship",  
        "object": [  
            "urn:ngsi-ld:Device:4a40aeba-4474-11e8-86bf-03d82e958ce6",  
            "urn:ngsi-ld:Device:63217d24-4474-11e8-9da2-c3dd3c36891b",  
            "urn:ngsi-ld:Device:68e091dc-4474-11e8-a398-df010c53b416",  
            "urn:ngsi-ld:6f44b54e-4474-11e8-8577-d7ff6a8ef551"  
        ]  
    },  
    "lastPlantedAt": {  
        "type": "Property",  
        "value": {  
            "@type": "DateTime",  
            "@value": "2016-08-22T10:18:16Z"  
        }  
    },  
    "location": {  
        "type": "GeoProperty",  
        "value": {  
            "type": "Polygon",  
            "coordinates": [  
                [  
                    100,  
                    0  
                ],  
                [  
                    101,  
                    0  
                ],  
                [  
                    101,  
                    1  
                ],  
                [  
                    100,  
                    1  
                ],  
                [  
                    100,  
                    0  
                ]  
            ]  
        }  
    },  
    "modifiedAt": "2017-05-04T12:30:00Z",  
    "ownedBy": {  
        "type": "Relationship",  
        "object": "urn:ngsi-ld:Person:fce9dcbc-4479-11e8-9de1-cb228de7a15c"  
    },  
    "relatedSource": {  
        "type": "Property",  
        "value": [  
            {  
                "application": "urn:ngsi-ld:AgriApp:72d9fb43-53f8-4ec8-a33c-fa931360259a",  
                "applicationEntityId": "app:parcel1"  
            }  
        ]  
    },  
    "seeAlso": {  
        "type": "Property",  
        "value": [  
            "https://example.org/concept/agriparcel",  
            "https://datamodel.org/example/agriparcel"  
        ]  
    },  
    "@context": [  
        "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"  
    ]  
}  

See FAQ 10 to get an answer on how to deal with magnitude units

AgriParcel adopters

description: This is a compilation list of the current adopters of the data model AgriParcel of the Subject dataModel.Agrifood.  All fields are non mandatory. More info at https://smart-data-models.github.io/data-models/templates/dataModel/CURRENT_ADOPTERS.yaml
currentAdopters:
-
 adopter: 
 description: 
 mail: 
 organization: 
 project: 
 comments: 
 startDate:

This message will not self-destruct.

This message will not self destruct, because this project is open source.

@computate computate added json-rest-apis-curl Suggested skills: JSON REST APIs, curl AgriParcel data to import AgriParcel Smart Model Data into a FIWARE context broker labels Dec 16, 2022
@computate computate moved this to AgriParcel - Agrifood - Smart Agrifood in FIWARE EMEA 2023 Hackathon Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AgriParcel data to import AgriParcel Smart Model Data into a FIWARE context broker json-rest-apis-curl Suggested skills: JSON REST APIs, curl
Projects
Status: AgriParcel - Agrifood - Smart Agrifood
Development

No branches or pull requests

1 participant