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 FishPopulation Smart Model Data into a FIWARE context broker #276

Open
computate opened this issue Dec 16, 2022 · 0 comments
Open
Labels
FishPopulation data to import FishPopulation 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 FishPopulation Smart Model Data into a FIWARE context broker

Your mission, should you choose to accept it, is to import FishPopulation 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 FishPopulation data if you can find it, or fake FishPopulation data that your team can come up with (see the Example payloads below).
  • You could also reach out to existing FishPopulation adopters, who are organizations who already work with these models. You may find some FishPopulation 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 FishPopulation 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 FishPopulation 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 FishPopulation data, you may want to use your imagination. Imagine if there was a FishPopulation sensor in your actual city, or a FishPopulation 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 FishPopulation data in an actual city or a toy city?
  • With a working Context Broker, you should be able to deploy FishPopulation Smart Model Data as defined in this GitHub issue in the Example payloads section. Save an example JSON payload to a file like ~/Downloads/FishPopulation1.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/FishPopulation1.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/FishPopulation1.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/FishPopulation1.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/FishPopulation1.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/FishPopulation1.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: FishPopulation

Open License

document generated automatically

version: 0.0.1

List of properties

  • address: The mailing address
  • alternateName: An alternative name for this item
  • areaServed: The geographic area where a service or offered item is provided
  • 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
  • id: Unique identifier of the entity
  • location: Geojson reference to the item. It can be Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon
  • name: The name of this 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
  • 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:

Required properties

  • culturedIn
  • id
  • refSpecie
  • type

Data Model description of properties

Sorted alphabetically (click for details)

full yaml details
FishPopulation:    
  description: ""    
  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    
    areaServed:    
      description: 'The geographic area where a service or offered item is provided'    
      type: string    
      x-ngsi:    
        model: https://schema.org/Text    
        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    
    id:    
      anyOf: &fishpopulation_-_properties_-_owner_-_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: 'Unique identifier of the entity'    
      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    
    owner:    
      description: 'A List containing a JSON encoded sequence of characters referencing the unique Ids of the owner(s)'    
      items:    
        anyOf: *fishpopulation_-_properties_-_owner_-_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: *fishpopulation_-_properties_-_owner_-_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    
    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:    
      enum:    
        - FishPopulation    
      type: string    
  required:    
    - id    
    - type    
    - culturedIn    
    - refSpecie    
  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) 2021 Contributors to Smart Data Models Program'    
  x-license-url: https://github.com/smart-data-models/dataModel.Aquaculture/blob/master/FishPopulation/LICENSE.md    
  x-model-schema: https://smart-data-models.github.io/dataModel.Aquaculture/FishContaiment/schema.json    
  x-model-tags: ""    
  x-version: 0.0.1    

Example payloads

Not available the example of a FishPopulation 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.

Not available the example of a FishPopulation 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.

FishPopulation NGSI-LD key-values Example

Here is an example of a FishPopulation 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:FishPopulation:1",  
  "type": "FishPopulation",  
  "description":{  
    "type": "Property",  
    "value": "this entity defines a FishPopulation"  
  },  
  "fishRemoved": {  
    "type": "Property",  
    "value": 0,  
    "observedAt": "2022-02-21T23:55:00Z"  
  },  
  "initialNumber": {  
    "type": "Property",  
    "value": 50,  
    "observedAt": "2022-01-01T23:55:00Z"  
  },  
  "bodyMasse": {  
    "type": "Property",  
    "value": 0,  
    "observedAt": "2022-02-21T23:55:00Z"  
  },  
  "culturedIn": {  
    "type": "Relationship",  
    "object": "urn:ngsi-ld:FishContainment:01",  
    "observedAt": "2022-02-21T23:55:00Z"  
  },  
  "refSpecie": {  
    "type": "Relationship",  
    "object": "urn:ngsi-ld:Specie:01"  
  },  
  "@context": [  
    "https://raw.githubusercontent.com/smart-data-models/data-models/master/context.jsonld"  
  ]  
}  

Not available the example of a FishPopulation 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.

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

FishPopulation adopters

description: This is a compilation list of the current adopters of the data model FishPopulation of the Subject dataModel.Aquaculture.
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 FishPopulation data to import FishPopulation Smart Model Data into a FIWARE context broker labels Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FishPopulation data to import FishPopulation Smart Model Data into a FIWARE context broker json-rest-apis-curl Suggested skills: JSON REST APIs, curl
Projects
Status: FishPopulation - Aquaculture - Smart Agrifood
Development

No branches or pull requests

1 participant