Skip to content

Commit

Permalink
Switch to WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Jun 4, 2024
1 parent ef7412b commit 881703a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion NGSI-LD Entity Relationships.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"info": {
"_postman_id": "c1f2ca70-0f08-4466-bb27-117eadbb7efa",
"name": "NGSI-LD Entity Relationships",
"description": "This tutorial teaches **NGSI-LD** users about batch commands and entity relationships. The tutorial builds on the data\ncreated in the previous [Smart Farm example](https://github.com/FIWARE/tutorials.Getting-Started/tree/NGSI-LD) and\ncreates and associates a series of related data entities to create add sensors and farm workers to the farm.\n\nThe `docker-compose` file for this tutorial can be found on GitHub: \n\n![GitHub](https://fiware.github.io/tutorials.Entity-Relationships/icon/GitHub-Mark-32px.png) [FIWARE 102: Batch Commands and Entity Relationships](https://github.com/Fiware/tutorials.Entity-Relationships)\n\nThis tutorial teaches **NGSI-LD** users about batch commands and entity relationships. The tutorial builds on the data\ncreated in the previous [Smart Farm example](https://github.com/FIWARE/tutorials.Getting-Started/tree/NGSI-LD) and\ncreates and associates a series of related data entities to create add sensors and farm workers to the farm.\n\n# Understanding Entities and Relationships\n\nWithin the FIWARE platform, the context of an entity represents the state of a physical or conceptual object which\nexists in the real world.\n\n## Entities within a Farm Management Information System (FMIS)\n\nTo illustrate entity relationships within an FMIS system based on NGSI-LD, we will need to create a series of entities.\nFor this simplified FMIS, we will only need a small number entities. The relationship between our entities is defined as\nshown:\n\n![](https://fiware.github.io/tutorials.Entity-Relationships/img/ngsi-ld-entities.png)\n\n- A building, such as a barn, is a real world bricks and mortar construct. **Building** entities would have properties\n such as:\n - A name of the building e.g. \"The Big Red Barn\"\n - The category of the building (e.g. \"barn\")\n - An address \"Friedrichstraße 44, 10969 Kreuzberg, Berlin\"\n - A physical location e.g. _52.5075 N, 13.3903 E_\n - A filling level - the degree to which the building is full.\n - A temperature - e.g. _21 °C_\n - An association to the owner of the building (a real person)\n- Smart devices such as **TemperatureSensors** or **FillingLevelSensors** would extend a common **Device** data model.\n Each **Device** entity would have properties such as:\n - A description of the device\n - The category of device (e.g. _sensor_, _actuator_, _both_)\n - The name of the property they are measuring (e.g. _temperature_)\n - An association to the asset (e.g. building) they are measuring\n- A **person** is an entity representing a farmer or farm labourer. Each **Person** entity would have properties such\n as:\n - A name of the person e.g. \"Mr. Jones\"\n - A job title\n - An association to the farm buildings they own.\n- A task something we do down on the farm. It is a conceptual entity, used to associate workers, agricultural products\n and locations **Task** entities would have properties such as:\n - The name of the task (e.g. _Spray Herbicide XXX on field Y_)\n - The status of the task (e.g. _scheduled_, _in progress_, _completed_)\n - An association to the worker (i.e. a **Person** entity) who performs the task\n - An association to the product (e.g. **Herbicide** entity) to be used.\n - An association to the location (e.g. **PartField** entity) to be used.\n\nAs you can see, each of the entities defined above contain a mixture of static and dynamic data. Some properties are\nliable to change. A **Herbicide** could change its `formula`, hay could be sold and the `fillingLevel` of the barn could\nbe reduced and so on.\n\n> **Note** this tutorial uses the following typographic styling :\n>\n> - Entity types have been made **bold text**\n> - Data attributes are written in `monospace text`\n> - Items in the real world use plain text\n>\n> Therefore a person in the real world is represented in the context data by a **Person** entity, and a real world barn\n> owned by a person is represented in the context data by a **Building** entity which has a `owner` attribute.\n\n# Architecture\n\nThe demo FMIS application will send and receive NGSI-LD calls to a compliant context broker. Since the standardized\nNGSI-LD interface is available across multiple context brokers, so we only need to pick one - for example the\n[Orion Context Broker](https://fiware-orion.readthedocs.io/en/latest/). The application will therefore only make use of\none FIWARE component.\n\nCurrently, the Orion Context Broker relies on open source [MongoDB](https://www.mongodb.com/) technology to keep\npersistence of the context data it holds.\n\nTo promote interoperability of data exchange, NGSI-LD context brokers explicitly expose a\n[JSON-LD `@context` file](https://json-ld.org/spec/latest/json-ld/#the-context) to define the data held within the\ncontext entities. This defines a unique URI for every entity type and every attribute so that other services outside of\nthe NGSI domain are able to pick and choose the names of their data structures. Every `@context` file must be available\non the network. In our case the tutorial application will be used to host a series of static files.\n\nTherefore, the architecture will consist of three elements:\n\n- The [Orion Context Broker](https://fiware-orion.readthedocs.io/en/latest/) which will receive requests using\n [NGSI-LD](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/full_api.json)\n- The underlying [MongoDB](https://www.mongodb.com/) database :\n - Used by the Orion Context Broker to hold context data information such as data entities, subscriptions and\n registrations\n- The **Tutorial Application** does the following:\n - Offers static `@context` files defining the context entities within the system.\n\nSince all interactions between the two elements are initiated by HTTP requests, the entities can be containerized and\nrun from exposed ports.\n\n![](https://fiware.github.io/tutorials.Entity-Relationships/img/architecture-ld.png)\n\nThe necessary configuration information can be seen in the services section of the associated `docker-compose.yml` file.\nIt has been described in a [previous tutorial](https://github.com/FIWARE/tutorials.Getting-Started/tree/NGSI-LD)\n\n# Prerequisites\n\n## Docker and Docker Compose\n\nTo keep things simple both components will be run using [Docker](https://www.docker.com). **Docker** is a container\ntechnology which allows to different components isolated into their respective environments.\n\n- To install Docker on Windows follow the instructions [here](https://docs.docker.com/docker-for-windows/)\n- To install Docker on Mac follow the instructions [here](https://docs.docker.com/docker-for-mac/)\n- To install Docker on Linux follow the instructions [here](https://docs.docker.com/install/)\n\n**Docker Compose** is a tool for defining and running multi-container Docker applications. A\n[YAML file](https://raw.githubusercontent.com/Fiware/tutorials.Entity-Relationships/master/docker-compose.yml) is used\nconfigure the required services for the application. This means all container services can be brought up in a single\ncommand. Docker Compose is installed by default as part of Docker for Windows and Docker for Mac, however Linux users\nwill need to follow the instructions found [here](https://docs.docker.com/compose/install/)\n\nYou can check your current **Docker** and **Docker Compose** versions using the following commands:\n\n```console\ndocker-compose -v\ndocker version\n```\n\nPlease ensure that you are using Docker version 20.10 or higher and Docker Compose 1.29 or higher and upgrade if\nnecessary.\n\n## Cygwin for Windows\n\nWe will start up our services using a simple Bash script. Windows users should download [cygwin](http://www.cygwin.com/)\nto provide a command-line functionality similar to a Linux distribution on Windows.\n\n# Start Up\n\nAll services can be initialised from the command-line by running the\n[services](https://github.com/FIWARE/tutorials.Entity-Relationships/blob/NGSI-LD/services) Bash script provided within\nthe repository. Please clone the repository and create the necessary images by running the commands as shown:\n\n```console\ngit clone https://github.com/FIWARE/tutorials.Entity-Relationships.git\ncd tutorials.Entity-Relationships\ngit checkout NGSI-LD\n\n./services start\n```\n\nThis command will also import seed data (**Building**, **Person**, **TemperatureSensor**, **FillingLevelSensor**,\n**Herbicide** and **PartField**) on startup.",
"description": "This tutorial teaches **NGSI-LD** users about batch commands and entity relationships. The tutorial builds on the data\ncreated in the previous [Smart Farm example](https://github.com/FIWARE/tutorials.Getting-Started/tree/NGSI-LD) and\ncreates and associates a series of related data entities to create add sensors and farm workers to the farm.\n\nThe `docker-compose` file for this tutorial can be found on GitHub: \n\n![GitHub](https://fiware.github.io/tutorials.Entity-Relationships/icon/GitHub-Mark-32px.png) [FIWARE 102: Batch Commands and Entity Relationships](https://github.com/Fiware/tutorials.Entity-Relationships)\n\nThis tutorial teaches **NGSI-LD** users about batch commands and entity relationships. The tutorial builds on the data\ncreated in the previous [Smart Farm example](https://github.com/FIWARE/tutorials.Getting-Started/tree/NGSI-LD) and\ncreates and associates a series of related data entities to create add sensors and farm workers to the farm.\n\n# Understanding Entities and Relationships\n\nWithin the FIWARE platform, the context of an entity represents the state of a physical or conceptual object which\nexists in the real world.\n\n## Entities within a Farm Management Information System (FMIS)\n\nTo illustrate entity relationships within an FMIS system based on NGSI-LD, we will need to create a series of entities.\nFor this simplified FMIS, we will only need a small number entities. The relationship between our entities is defined as\nshown:\n\n![](https://fiware.github.io/tutorials.Entity-Relationships/img/ngsi-ld-entities.png)\n\n- A building, such as a barn, is a real world bricks and mortar construct. **Building** entities would have properties\n such as:\n - A name of the building e.g. \"The Big Red Barn\"\n - The category of the building (e.g. \"barn\")\n - An address \"Friedrichstraße 44, 10969 Kreuzberg, Berlin\"\n - A physical location e.g. _52.5075 N, 13.3903 E_\n - A filling level - the degree to which the building is full.\n - A temperature - e.g. _21 °C_\n - An association to the owner of the building (a real person)\n- Smart devices such as **TemperatureSensors** or **FillingLevelSensors** would extend a common **Device** data model.\n Each **Device** entity would have properties such as:\n - A description of the device\n - The category of device (e.g. _sensor_, _actuator_, _both_)\n - The name of the property they are measuring (e.g. _temperature_)\n - An association to the asset (e.g. building) they are measuring\n- A **person** is an entity representing a farmer or farm labourer. Each **Person** entity would have properties such\n as:\n - A name of the person e.g. \"Mr. Jones\"\n - A job title\n - An association to the farm buildings they own.\n- A task something we do down on the farm. It is a conceptual entity, used to associate workers, agricultural products\n and locations **Task** entities would have properties such as:\n - The name of the task (e.g. _Spray Herbicide XXX on field Y_)\n - The status of the task (e.g. _scheduled_, _in progress_, _completed_)\n - An association to the worker (i.e. a **Person** entity) who performs the task\n - An association to the product (e.g. **Herbicide** entity) to be used.\n - An association to the location (e.g. **PartField** entity) to be used.\n\nAs you can see, each of the entities defined above contain a mixture of static and dynamic data. Some properties are\nliable to change. A **Herbicide** could change its `formula`, hay could be sold and the `fillingLevel` of the barn could\nbe reduced and so on.\n\n> **Note** this tutorial uses the following typographic styling :\n>\n> - Entity types have been made **bold text**\n> - Data attributes are written in `monospace text`\n> - Items in the real world use plain text\n>\n> Therefore a person in the real world is represented in the context data by a **Person** entity, and a real world barn\n> owned by a person is represented in the context data by a **Building** entity which has a `owner` attribute.\n\n# Architecture\n\nThe demo FMIS application will send and receive NGSI-LD calls to a compliant context broker. Since the standardized\nNGSI-LD interface is available across multiple context brokers, so we only need to pick one - for example the\n[Orion Context Broker](https://fiware-orion.readthedocs.io/en/latest/). The application will therefore only make use of\none FIWARE component.\n\nCurrently, the Orion Context Broker relies on open source [MongoDB](https://www.mongodb.com/) technology to keep\npersistence of the context data it holds.\n\nTo promote interoperability of data exchange, NGSI-LD context brokers explicitly expose a\n[JSON-LD `@context` file](https://json-ld.org/spec/latest/json-ld/#the-context) to define the data held within the\ncontext entities. This defines a unique URI for every entity type and every attribute so that other services outside of\nthe NGSI domain are able to pick and choose the names of their data structures. Every `@context` file must be available\non the network. In our case the tutorial application will be used to host a series of static files.\n\nTherefore, the architecture will consist of three elements:\n\n- The [Orion Context Broker](https://fiware-orion.readthedocs.io/en/latest/) which will receive requests using\n [NGSI-LD](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/full_api.json)\n- The underlying [MongoDB](https://www.mongodb.com/) database :\n - Used by the Orion Context Broker to hold context data information such as data entities, subscriptions and\n registrations\n- The **Tutorial Application** does the following:\n - Offers static `@context` files defining the context entities within the system.\n\nSince all interactions between the two elements are initiated by HTTP requests, the entities can be containerized and\nrun from exposed ports.\n\n![](https://fiware.github.io/tutorials.Entity-Relationships/img/architecture-ld.png)\n\nThe necessary configuration information can be seen in the services section of the associated `docker-compose.yml` file.\nIt has been described in a [previous tutorial](https://github.com/FIWARE/tutorials.Getting-Started/tree/NGSI-LD)\n\n# Prerequisites\n\n## Docker and Docker Compose\n\nTo keep things simple both components will be run using [Docker](https://www.docker.com). **Docker** is a container\ntechnology which allows to different components isolated into their respective environments.\n\n- To install Docker on Windows follow the instructions [here](https://docs.docker.com/docker-for-windows/)\n- To install Docker on Mac follow the instructions [here](https://docs.docker.com/docker-for-mac/)\n- To install Docker on Linux follow the instructions [here](https://docs.docker.com/install/)\n\n**Docker Compose** is a tool for defining and running multi-container Docker applications. A\n[YAML file](https://raw.githubusercontent.com/Fiware/tutorials.Entity-Relationships/master/docker-compose.yml) is used\nconfigure the required services for the application. This means all container services can be brought up in a single\ncommand. Docker Compose is installed by default as part of Docker for Windows and Docker for Mac, however Linux users\nwill need to follow the instructions found [here](https://docs.docker.com/compose/install/)\n\nYou can check your current **Docker** and **Docker Compose** versions using the following commands:\n\n```console\ndocker-compose -v\ndocker version\n```\n\nPlease ensure that you are using Docker version 20.10 or higher and Docker Compose 1.29 or higher and upgrade if\nnecessary.\n\n## WSL\n\nWe will start up our services using a simple Bash script. Windows users should download the [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install)\nto provide a command-line functionality similar to a Linux distribution on Windows.\n\n# Start Up\n\nAll services can be initialised from the command-line by running the\n[services](https://github.com/FIWARE/tutorials.Entity-Relationships/blob/NGSI-LD/services) Bash script provided within\nthe repository. Please clone the repository and create the necessary images by running the commands as shown:\n\n```console\ngit clone https://github.com/FIWARE/tutorials.Entity-Relationships.git\ncd tutorials.Entity-Relationships\ngit checkout NGSI-LD\n\n./services start\n```\n\nThis command will also import seed data (**Building**, **Person**, **TemperatureSensor**, **FillingLevelSensor**,\n**Herbicide** and **PartField**) on startup.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
Expand Down
8 changes: 3 additions & 5 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- [アーキテクチャ](#architecture)
- [前提条件](#prerequisites)
- [Docker と Docker Compose](#docker-and-docker-compose)
- [Cygwin for Windows](#cygwin-for-windows)
- [WSL](#wsl)
- [起動](#start-up)
- [データ・エンティティの作成と関連付け](#creating-and-associating-data-entities)
- [一度に複数のエンティティを作成](#creating-several-entities-at-once)
Expand Down Expand Up @@ -169,12 +169,10 @@ docker version
Docker version 20.10 以降および Docker Compose 1.29 以降を使用していることを確認し、
必要に応じてアップグレードしてください。

<a name="cygwin-for-windows"/>

## Cygwin for Windows
## WSL

簡単な bash スクリプトを使ってサービスを開始します。Windows ユーザは、Windows 上の Linux ディストリビューションに
似たコマンドライン機能を提供するために [cygwin](http://www.cygwin.com/) をダウンロードするべきです。
似たコマンドライン機能を提供するために [を使用して Windows に Linux をインストールする方法](https://learn.microsoft.com/ja-jp/windows/wsl/install) をダウンロードするべきです。

<a name="start-up"/>

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The tutorial uses [cUrl](https://ec.haxx.se/) commands throughout, but is also a
- [Architecture](#architecture)
- [Prerequisites](#prerequisites)
- [Docker and Docker Compose](#docker-and-docker-compose)
- [Cygwin for Windows](#cygwin-for-windows)
- [WSL](#wsl)
- [Start Up](#start-up)
- [Creating and Associating Data Entities](#creating-and-associating-data-entities)
- [Creating Several Entities at Once](#creating-several-entities-at-once)
Expand Down Expand Up @@ -173,10 +173,11 @@ docker version
Please ensure that you are using Docker version 20.10 or higher and Docker Compose 1.29 or higher and upgrade if
necessary.

## Cygwin for Windows
## WSL

We will start up our services using a simple Bash script. Windows users should download [cygwin](http://www.cygwin.com/)
to provide a command-line functionality similar to a Linux distribution on Windows.
We will start up our services using a simple Bash script. Windows users should download the
[Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install) to provide a command-line
functionality similar to a Linux distribution on Windows.

# Start Up

Expand Down

0 comments on commit 881703a

Please sign in to comment.