{"info":{"_postman_id":"8f9fb52f-f756-439f-984c-b9d273376f4b","name":"NGSI-LD Linked Data","description":"<html><head></head><body><p>This tutorial introduces linked data concepts to the FIWARE Platform. The supermarket chain’s store finder application\nis recreated using <strong>NGSI-LD</strong> the differences between the <strong>NSGI v2</strong> and <strong>NGSI-LD</strong> interfaces are highlighted and\ndiscussed. The tutorial is a direct analogue of the original getting started tutorial but uses API calls from the\n<strong>NGSI-LD</strong> interface.</p>\n<p>The <code>docker-compose</code> files for this tutorial can be found on GitHub: </p>\n<p><img src=\"https://fiware.github.io/tutorials.Linked-Data/icon/GitHub-Mark-32px.png\" alt=\"GitHub\"> <a href=\"https://github.com/Fiware/tutorials.Linked-Data\">FIWARE 601: Linked Data</a></p>\n<h1 id=\"adding-linked-data-concepts-to-fiware-data-entities\">Adding Linked Data concepts to FIWARE Data Entities.</h1>\n<blockquote>\n<p>“Six degrees of separation doesn't mean that everyone is linked to everyone else in just six steps. It means that a\nvery small number of people are linked to everyone else in a few steps, and the rest of us are linked to the world\nthrough those special few.”</p>\n<p>― Malcolm Gladwell, The Tipping Point</p>\n</blockquote>\n<p>The introduction to FIWARE <a href=\"https://github.com/FIWARE/tutorials.Getting-Started\">Getting Started tutorial</a> introduced\nthe <a href=\"https://fiware.github.io/specifications/OpenAPI/ngsiv2\">NSGI v2</a> interface that is commonly used to create and\nmanipulate context data entities. An evolution of that interface has created a supplementary specification called\n<a href=\"https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/full_api.json\">NGSI-LD</a>\nas a mechanism to enhance context data entities though adding the concept of <strong>linked data</strong>. This tutorial will\nintroduce the background of the ideas behind the new interface and compare and contrast how to create and manipulate\ndata entites as linked data.</p>\n<p>Addtional tutorials in the series will further discuss data relationships an how to create context data entities using\nlinked data enabling the full knowledge graph to be traversed.</p>\n<h2 id=\"what-is-linked-data\">What is Linked Data?</h2>\n<p>All users of the Internet will be familiar with the concept of hypertext links, the way that a link on one web page is\nable to guide the browser to loading another page from a known location.</p>\n<p>Whilst humans are able to understand relationship discoverability and how links work, computers find this much more\ndifficult, and require a well-defined protocol to be able to traverse from one data element to another held in a\nseparate location.</p>\n<p>Creating a system of readable links for computers requires the use of a well defined data format\n(<a href=\"http://json-ld.org/\">JSON-LD</a>) and assignation of unique IDs\n(<a href=\"https://stackoverflow.com/questions/4913343/what-is-the-difference-between-uri-url-and-urn\">URLs or URNs</a>) for both\ndata entities and the relationships between entities so that semantic meaning can be programmatically retrieved from the\ndata itself.</p>\n<p>Properly defined linked data can be used to help answer big data questions, and the data relationships can be traversed\nto answer questions like <em>\"Which products are currently avaiable on the shelves of Store X and what prices are they sold\nat?\"</em></p>\n<h3 id=\"video-what-is-linked-data\">Video: What is Linked Data?</h3>\n<p><a href=\"https://www.youtube.com/watch?v=4x_xzT5eF5Q\"><img src=\"http://img.youtube.com/vi/4x_xzT5eF5Q/0.jpg\" alt=\"\"></a></p>\n<p>Click on the image above to watch an introductory video on linked data concepts</p>\n<p>JSON-LD is an extension of JSON , it is a standard way of avoiding ambiguity when expressing linked data in JSON so that\nthe data is structured in a format which is parsable by machines. It is a method of ensuring that all data attributes\ncan be easily compared when coming from a multitude of separate data sources, which could have a different idea as to\nwhat each attribute means. For example, when two data entities have a <code>name</code> attribute how can the computer be certain\nthat is refers to a <em>\"Name of a thing\"</em> in the same sense (rather than a <strong>Username</strong> or a <strong>Surname</strong> or something).\nURLs and datamodels are used to remove ambiguity by allowing attributes to have a both short form (such as <code>name</code>) and a\nfully specified long form (such <code>http://schema.org/name</code>) which means it is easy to discover which attribute have a\ncommon meaning within a data structure.</p>\n<p>JSON-LD introduces the concept of the <code>@context</code> element which provides additional information allowing the computer to\ninterpret the rest of the data with more clarity and depth.</p>\n<p>Furthermore the JSON-LD specification enables you to define a unique <code>@type</code> associating a well-defined\n<a href=\"https://fiware-datamodels.readthedocs.io/en/latest/guidelines/index.html\">data model</a> to the data itself.</p>\n<h3 id=\"video-what-is-json-ld\">Video: What is JSON-LD?</h3>\n<p><a href=\"https://www.youtube.com/watch?v=vioCbTo3C-4\"><img src=\"http://img.youtube.com/vi/vioCbTo3C-4/0.jpg\" alt=\"\"></a></p>\n<p>Click on the image above to watch a video describing the basic concepts behind JSON-LD.</p>\n<h2 id=\"what-is-ngsi-ld\">What is NGSI-LD?</h2>\n<p><strong>NGSI-LD</strong> is an evolution of the <strong>NGSI v2</strong> information model, which has been modified to improve support for linked\ndata (entity relationships), property graphs and semantics (exploiting the capabilities offered by JSON-LD). This work\nhas been conducted under the ETSI ISG CIM initiative and the updated specification hhas been branded as\n<a href=\"https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.01.01_60/gs_CIM009v010101p.pdf\">NGSI-LD</a>. The main constructs\nof NGSI-LD are: <em>Entity</em>, <em>Property</em> and <em>Relationship</em>. NGSI-LD Entities (instances) can be the subject of Properties\nor Relationships. In terms of the traditional NGSI v2 data model, Properties can be seen as the combination of an\nattribute and its value. Relationships allow to establish associations between instances using linked data.</p>\n<h3 id=\"ngsi-v2-data-model\">NGSI v2 Data Model</h3>\n<p>As a reminder, the NGSI v2 data model is quite simple. It can be summarized as shown below:</p>\n<p><img src=\"https://fiware.github.io/tutorials.Linked-Data/img/ngsi-v2.png\" alt=\"\"></p>\n<p>The core element of NGSI v2 is the data <em>entity</em>, typically a real object with a changing state (such as a <strong>Store</strong>, a\n<strong>Shelf</strong> and so on). Entities have <em>attributes</em> (such as <code>name</code> and <code>location</code>) and these in turn hold <em>metadata</em> such\nas <code>accuracy</code> - i.e. the accuracy of a <code>location</code> reading.</p>\n<p>Every <em>entity</em> must have a <code>type</code> which defines the sort of thing the entity describes, but giving an NGSI v2 entity the\n<code>type=Store</code> is relatively meaningless as no-one is obliged to shape their own <strong>Store</strong> entities in the same fashion.\nSimilarly adding an attribute called <code>name</code> doesn't suddenly make it hold the same data as someone else's <code>name</code>\nattribute.</p>\n<p>Relationships can be defined using NGSI v2, but only so far as giving the attribute an appropriate attribute name\ndefined by convention ( e.g. starting with <code>ref</code>, such as <code>refManagedBy</code>) and assigning the attribute\n<code>type=Relationship</code> which again is purely a naming convention with no real semantic weight.</p>\n<h3 id=\"ngsi-ld-data-model\">NGSI LD Data Model</h3>\n<p>The NGSI LD data model is more complex, with more rigid definitions of use which lead to a navigable knowledge graph.</p>\n<p><img src=\"https://fiware.github.io/tutorials.Linked-Data/img/ngsi-ld.png\" alt=\"\"></p>\n<p>Once again, <em>entity</em> can be considered to be the core element. Every entity must use a unique <code>id</code>\n<a href=\"https://en.wikipedia.org/wiki/Uniform_resource_name\">URN</a>, there is also a <code>type</code>, used to define the structure of the\ndata held, which is also a URN. This URN should correspond to a well-defined data model which can be found on the web.\nFor example the URN <code>https://uri.fiware.org/ns/datamodels/Building</code> is used to define common data model for a\n<a href=\"https://fiware-datamodels.readthedocs.io/en/latest/Building/Building/doc/spec/index.html\">Building</a>.</p>\n<p><em>Entities</em> can have <em>properties</em> and <em>relationships</em>. Ideally the name of each <em>property</em> should also be a well defined\nURN which corresponds to a common concept found across the web (e.g. <code>http://schema.org/address</code> is a common URN for the\nphysical address of an item). The <em>property</em> will also have a value which will reflect the state of that property (e.g\n<code>name=\"Checkpoint Markt\"</code>). Finally a property may itself have further properties (a.k.a. <em>properties-of-properties</em>)\nwhich reflect further information about the property itself. Properties and relationships may in turn have a linked\nembedded structure (of <em>properties-of-properties</em> or <em>properties-of-relationships or relationships-of-properties</em> or\n<em>relationships-of-relationships</em> etc.) which lead to the following:</p>\n<p>An NGSI LD Data Entity (e.g. a supermarket):</p>\n<ul>\n<li>Has an <code>id</code> which must be unique. For example <code>urn:ngsi-ld:Building:store001</code>,</li>\n<li>Has <code>type</code> which should be a fully qualified URN of a well defined data model. For example\n<code>https://uri.fiware.org/ns/datamodels#Building</code></li>\n<li>Has <em>property</em> of the entity, for example, an <code>address</code> attribute which holds the adress of the store. This can be\nexpanded into <code>http://schema.org/address</code>, which is known as a fully qualified name\n(<a href=\"https://en.wikipedia.org/wiki/Fully_qualified_name\">FQN</a>).</li>\n<li>The <code>address</code>, like any <em>property</em> will have a <em>value</em> corresponding to the <em>property</em> <code>address</code> (e.g. <em>Bornholmer\nStraße 65, 10439 Prenzlauer Berg, Berlin</em></li>\n<li>Has a <em>property-of-a-property</em> of the entity, for example a <code>verified</code> field for the <code>address</code>.</li>\n<li>Has a <em>relationship</em> of the entity, for example, a <code>managedBy</code> field where the relationship <code>managedBy</code> corresponds\nto another data entity : <code>urn:ngsi-ld:Person:bob-the-manager</code></li>\n<li>The relationship <code>managedBy</code>, may itself have a <em>property-of-a-relationship</em> (e.g. <code>since</code>), this holds the date Bob\nstarted working the store</li>\n<li>The relationship <code>managedBy</code>, may itself have a <em>relationship-of-a-relationship</em> (e.g. <code>subordinateTo</code>), this holds\nthe URN of the area manager above Bob in the hierarchy.</li>\n</ul>\n<p>As you can see the knowledge graph is well defined and can be expanded indefinitely.</p>\n<p>Relationships will be dealt with in more detail in a subsequent tutorial.</p>\n<h1 id=\"prerequisites\">Prerequisites</h1>\n<h2 id=\"docker\">Docker</h2>\n<p>To keep things simple all components will be run using <a href=\"https://www.docker.com\">Docker</a>. <strong>Docker</strong> is a container\ntechnology which allows to different components isolated into their respective environments.</p>\n<ul>\n<li>To install Docker on Windows follow the instructions <a href=\"https://docs.docker.com/docker-for-windows/\">here</a></li>\n<li>To install Docker on Mac follow the instructions <a href=\"https://docs.docker.com/docker-for-mac/\">here</a></li>\n<li>To install Docker on Linux follow the instructions <a href=\"https://docs.docker.com/install/\">here</a></li>\n</ul>\n<p><strong>Docker Compose</strong> is a tool for defining and running multi-container Docker applications. A\n<a href=\"https://raw.githubusercontent.com/Fiware/tutorials.Identity-Management/master/docker-compose.yml\">YAML file</a> 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 <a href=\"https://docs.docker.com/compose/install/\">here</a></p>\n<h2 id=\"cygwin\">Cygwin</h2>\n<p>We will start up our services using a simple bash script. Windows users should download <a href=\"http://www.cygwin.com/\">cygwin</a>\nto provide a command-line functionality similar to a Linux distribution on Windows.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Adding Linked Data concepts to FIWARE Data Entities.","slug":"adding-linked-data-concepts-to-fiware-data-entities"},{"content":"Prerequisites","slug":"prerequisites"}],"owner":"513743","collectionId":"8f9fb52f-f756-439f-984c-b9d273376f4b","publishedId":"SVYjSMgh","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"4C4C4C","highlight":"233C68"},"publishDate":"2020-01-02T11:02:01.000Z"},"item":[{"name":"Linked Data using Orion-LD","item":[{"name":"Obtaining Version Information","id":"fe6c3057-27ca-446f-bd10-f459b1bc4dac","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:1026/version/","description":"<p>This tutorial recreates the same data entities as the intial <em>\"Powered by FIWARE\"</em> supermarket finder app, but using\nNGSI-LD linked data entities rather than NGSI v2.</p>\n<h2 id=\"checking-the-service-health\">Checking the service health</h2>\n<p>As usual, you can check if the Orion Context Broker is running by making an HTTP request to the exposed port.</p>\n<p>The format of the response has not changed. The <code>release_date</code> must be 16th July 2019 or later to be able to\nwork with the requests defined below.</p>\n","urlObject":{"protocol":"http","path":["version",""],"host":["localhost:1026"],"query":[],"variable":[]}},"response":[],"_postman_id":"fe6c3057-27ca-446f-bd10-f459b1bc4dac"},{"name":"Obtain full Linked Data model context","id":"f5a8a2a4-3d63-4b41-8eb6-22bff74658bd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://fiware.github.io/data-models/context.jsonld","description":"<p>Information about the data models and relationships used within this tutorial\ncan be obtained by requesting the full <code>@context</code> and <code>@graph</code>.</p>\n","urlObject":{"host":["https://fiware.github.io/data-models/context.jsonld"],"query":[],"variable":[]}},"response":[],"_postman_id":"f5a8a2a4-3d63-4b41-8eb6-22bff74658bd"},{"name":"Creating your first Data Entity","id":"3f85285d-31d9-4c32-82eb-dbbf1469d3c8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/ld+json"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"urn:ngsi-ld:Building:store001\",\n    \"type\": \"Building\",\n    \"category\": {\n    \t\"type\": \"Property\",\n        \"value\": [\"commercial\"]\n    },\n    \"address\": {\n        \"type\": \"Property\",\n        \"value\": {\n            \"streetAddress\": \"Bornholmer Straße 65\",\n            \"addressRegion\": \"Berlin\",\n            \"addressLocality\": \"Prenzlauer Berg\",\n            \"postalCode\": \"10439\"\n        },\n        \"verified\": {\n\t\t\t\"type\": \"Property\",\n\t\t\t\"value\": true\n\t\t}\n    },\n    \"location\": {\n        \"type\": \"GeoProperty\",\n        \"value\": {\n             \"type\": \"Point\",\n             \"coordinates\": [13.3986, 52.5547]\n        }\n    },\n    \"name\": {\n        \"type\": \"Property\",\n        \"value\": \"Bösebrücke Einkauf\"\n    },\n    \"@context\": [\n        \"https://fiware.github.io/data-models/context.jsonld\",\n        \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\"\n    ]\n}"},"url":"http://localhost:1026/ngsi-ld/v1/entities/","description":"<h2 id=\"creating-context-data\">Creating Context Data</h2>\n<p>When creating linked data entities, it is important to use common data models. This will allow us to easily combine data\nfrom multiple sources and remove ambiguity when comparing data coming from different sources.</p>\n<p>Creating linked data using full qualified names throughout would be painful, as each attribute would need to be a URN,\nso JSON-LD introduces the idea of an <code>@context</code> attribute which can hold pointers to context definitions. To add a\nFIWARE <a href=\"https://fiware-datamodels.readthedocs.io/en/latest/Building/Building/doc/spec/index.html\">Building</a> data entity,\nthe following <code>@context</code> would be required</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"id\": \"urn:ngsi-ld:Building:store001\",\n    \"type\": \"Building\",\n    ...  other data attributes\n    \"@context\": [\n        \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\",\n        \"https://schema.lab.fiware.org/ld/fiware-datamodels-context.jsonld\"\n    ]\n}\n</code></pre>\n<h3 id=\"core-context\">Core Context</h3>\n<p><a href=\"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\">https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld</a>\nrefers to the Core <code>@context</code> of NSGI-LD, this defines element such as <code>id</code> and <code>type</code> which are common to all NGSI\nentities, as well as defining terms such as <code>Property</code> and <code>Relationship</code>. The core context is so fundamental to\nNGSI-LD, that it is added by default to any <code>@context</code> sent to a request.</p>\n<h3 id=\"fiware-data-models\">FIWARE Data Models</h3>\n<p><a href=\"https://schema.lab.fiware.org/ld/fiware-datamodels-context.jsonld\">https://schema.lab.fiware.org/ld/fiware-datamodels-context.jsonld</a>\nrefers to the definition of standard data models supplied by FIWARE. Adding this to the <code>@context</code> will load the\ndefinitions of all the <a href=\"https://fiware-datamodels.readthedocs.io\">data models</a> defined by the FIWARE Foundation, a\nsummary of the FQNs related to <strong>Building</strong> can be seen below:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"@context\": {\n        \"Building\": \"https://uri.fiware.org/ns/datamodels/Building\",\n        ... etc\n        \"address\": \"http://schema.org/address\",\n        \"category\": \"https://uri.fiware.org/ns/datamodels/category\",\n        \"location\": \"http://uri.etsi.org/ngsi-ld/location\",\n        \"name\": \"http://schema.org/name\",\n        ...etc\n    }\n}\n</code></pre>\n<p>If we include this context definition, it means that we will be able to use short names for <code>Building</code>, <code>address</code>,\n<code>location</code> for our entities, but computers will also be able to read the FNQs when comparing with other sources.</p>\n<p>To create a valid <strong>Building</strong> data entity in the context broker, make a POST request to the\n<code>http://localhost:1026/ngsi-ld/v1/entities</code> endpoint as shown below. It is essential that the appropriate\n<code>Content-Type: application/ld+json</code> is also used, so that the data entity is recognized as Linked data.</p>\n<p>The first request will take some time, as the context broker must navigate and load all of the files mentioned in the\n<code>@context</code>.</p>\n<blockquote>\n<p><strong>Note</strong>: if <code>https://fiware.github.io/data-models/context.jsonld</code> is unavailable for some reason the request will fail</p>\n<p>For a working production system it is essential that the <code>@context</code> files are always available to ensure third parties can\nread the context. High availability infrastructure has not been considered for this tutorial to keep the architecture simple.</p>\n</blockquote>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:1026"],"query":[],"variable":[]}},"response":[],"_postman_id":"3f85285d-31d9-4c32-82eb-dbbf1469d3c8"},{"name":"Creating your Second Data Entity","id":"85c473a7-b4cd-4a14-b3ce-f7b0e0ce31bb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/ld+json"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"urn:ngsi-ld:Building:store002\",\n    \"type\": \"Building\",\n    \"category\": {\n    \t\"type\": \"Property\",\n        \"value\": [\"commercial\"]\n    },\n    \"address\": {\n        \"type\": \"Property\",\n        \"value\": {\n            \"streetAddress\": \"Friedrichstraße 44\",\n            \"addressRegion\": \"Berlin\",\n            \"addressLocality\": \"Kreuzberg\",\n            \"postalCode\": \"10969\"\n        },\n        \"verified\": {\n\t\t\t\"type\": \"Property\",\n\t\t\t\"value\": true\n\t\t}\n    },\n     \"location\": {\n        \"type\": \"GeoProperty\",\n        \"value\": {\n             \"type\": \"Point\",\n              \"coordinates\": [13.3903, 52.5075]\n        }\n    },\n    \"name\": {\n        \"type\": \"Property\",\n        \"value\": \"Checkpoint Markt\"\n    },\n    \"@context\": [\n        \"https://fiware.github.io/data-models/context.jsonld\",\n        \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\"\n    ]\n}"},"url":"http://localhost:1026/ngsi-ld/v1/entities/","description":"<p>Each subsequent entity must have a unique <code>id</code> for the given <code>type</code>.</p>\n<h3 id=\"defining-properties-within-the-ngsi-ld-entity-definition\">Defining Properties within the NGSI-LD entity definition</h3>\n<p>The attributes <code>id</code> and <code>type</code> should be familiar to anyone who has used NSGI v2, and these have not changed. As\nmentioned above, the type should refer to an included data model, in this case <code>Building</code> is being used as a short name\nfor the inclued URN <code>https://uri.fiware.org/ns/datamodels/Building</code>. Thereafter each <em>property</em> is defined as a JSON\nelement containing two attributes, a <code>type</code> and a <code>value</code>.</p>\n<p>The <code>type</code> of a <em>property</em> attribute must be one of the following:</p>\n<ul>\n<li><code>\"GeoProperty\"</code>: <code>\"http://uri.etsi.org/ngsi-ld/GeoProperty\"</code> for locations. Locations should be specified as\nLongitude-Latitude pairs in <a href=\"https://tools.ietf.org/html/rfc7946\">GeoJSON format</a>. The preferred name for the\nprimary location attribute is <code>location</code></li>\n<li><code>\"TemporalProperty\"</code>: <code>\"http://uri.etsi.org/ngsi-ld/TemporalProperty\"</code> for time-based values. Temporal properties\nshould be Date, Time or DateTime strings encoded be <a href=\"https://en.wikipedia.org/wiki/ISO_8601\">ISO 8601 format</a> - e.g.\n<code>YYYY-MM-DDThh:mm:ssZ</code></li>\n<li><code>\"Property\"</code>: <code>\"http://uri.etsi.org/ngsi-ld/Property\"</code> - for everything else</li>\n</ul>\n<blockquote>\n<p><strong>Note:</strong> that for simplicity, this data entity has no relationships defined. Relationships must be given the\n<code>type=\"Relationship</code>. Relationships will be discusssed in a subsequent tutorial.</p>\n</blockquote>\n<h3 id=\"defining-properties-of-properties-within-the-ngsi-ld-entity-definition\">Defining Properties-of-Properties within the NGSI-LD entity definition</h3>\n<p><em>Properties-of-Properties</em> is the NGSI-LD equivalent of metadata (i.e. <em>\"data about data\"</em>), it is use to describe\nproperties of the attribute value itself like accuracy, provider, or the units to be used. Some built-in metadata\nattributes already exist and these names are reserved:</p>\n<ul>\n<li><code>createdAt</code> (type: DateTime): attribute creation date as an ISO 8601 string.</li>\n<li><code>modifiedAt</code> (type: DateTime): attribute modification date as an ISO 8601 string.</li>\n</ul>\n<p>Additionally <code>observedAt</code>, <code>datasetId</code> and <code>instanceId</code> may optionally be added in some cases, and <code>location</code>,\n<code>observationSpace</code> and <code>operationSpace</code> have special meaning for Geoproperties.</p>\n<p>In the examples given above, one element of metadata (i.e. a <em>property-of-a-property</em>) can be found within the <code>address</code>\nattribute. a <code>verified</code> flag indicates whether the address has been confirmed. The commonest <em>property-of-a-property</em> is\n<code>unitCode</code> which should be used to hold the UN/CEFACT\n<a href=\"http://wiki.goodrelations-vocabulary.org/Documentation/UN/CEFACT_Common_Codes\">Common Codes</a> for Units of Measurement.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:1026"],"query":[],"variable":[]}},"response":[],"_postman_id":"85c473a7-b4cd-4a14-b3ce-f7b0e0ce31bb"},{"name":"Obtain Entity Data by FNQ type","id":"f2dbfcd7-2144-47b2-89d3-00cce8bce30c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Accept","value":"application/ld+json","type":"text"}],"url":"http://localhost:1026/ngsi-ld/v1/entities?type=https://uri.fiware.org/ns/data-models%23Building","description":"<p>This example returns the data of all <code>Building</code> entities within the context data The <code>type</code> parameter is mandatory for\nNGSI-LD and is used to filter the response.</p>\n<p>The response returns the Core <code>@context</code> by default\n(<code>https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/defaultContext/defaultContext.jsonld</code>) and all attributes are\nexpanded whenever possible.</p>\n<ul>\n<li><code>id</code>, <code>type</code> and <code>location</code> are defined in the core context and are not expanded.</li>\n<li><code>address</code> has been mapped to <code>http://schema.org/address</code></li>\n<li><code>name</code> has been mapped to <code>http://schema.org/name</code></li>\n<li><code>category</code> has been mapped to <code>https://uri.fiware.org/ns/datamodels#category</code></li>\n</ul>\n<p>Note that if an attribute has not been not associated to an FNQ when the entity was created, the short name will\n<strong>always</strong> be displayed.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities"],"host":["localhost:1026"],"query":[{"key":"type","value":"https://uri.fiware.org/ns/data-models%23Building"}],"variable":[]}},"response":[],"_postman_id":"f2dbfcd7-2144-47b2-89d3-00cce8bce30c"},{"name":"Obtain Entity Data by id","id":"9105db02-fb83-4e36-90ef-54196c719334","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Accept","value":"application/ld+json","type":"text"}],"url":"http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:store001","description":"<p>This example returns the data of <code>urn:ngsi-ld:Building:store001</code>.</p>\n<p>The response returns the Core <code>@context</code> by default\n(<code>https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/defaultContext/defaultContext.jsonld</code>) and all attributes are\nexpanded whenever possible.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities","urn:ngsi-ld:Building:store001"],"host":["localhost:1026"],"query":[{"disabled":true,"description":{"content":"<p>Entity type, to avoid ambiguity in case there are several entities with the same entity id</p>\n","type":"text/plain"},"key":"type","value":"Store"},{"disabled":true,"description":{"content":"<p>Ordered list of attribute names to display</p>\n","type":"text/plain"},"key":"attrs","value":"name"}],"variable":[]}},"response":[],"_postman_id":"9105db02-fb83-4e36-90ef-54196c719334"},{"name":"Obtain Entity Data by type and linked context","id":"09634a0a-7ee2-460e-9870-d2437818f615","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text","name":"Accept"}],"url":"http://localhost:1026/ngsi-ld/v1/entities?type=Building&options=keyValues","description":"<p>If a reference to the supplied data is supplied, it is possible to return short name data and limit responses to a\nspecific <code>type</code> of data. For example, the request below returns the data of all <code>Building</code> entities within the context\ndata. Use of the <code>type</code> parameter limits the response to <code>Building</code> entities only, use of the <code>options=keyValues</code> query\nparameter reduces the response down to standard JSON-LD.</p>\n<p>A <a href=\"https://www.w3.org/wiki/LinkHeader\"><code>Link</code> header</a> must be supplied to associate the short form <code>type=\"Building\"</code>\nwith the FNQ <code>https://uri.fiware.org/ns/datamodels/Building</code>. The full link header syntax can be seen below:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-text\">Link: &lt;https://schema.lab.fiware.org/ld/fiware-datamodels-context.jsonld&gt;; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\n</code></pre>\n<p>The standard HTTP <code>Link</code> header allows metadata (in this case the <code>@context</code>) to be passed in without actually touching\nthe resource in question. In the case of NGSI-LD, the metadata is a file of in <code>application/ld+json</code> format.</p>\n<p>Because of the use of the <code>options=keyValues</code>, the response consists of JSON only without the attribute defintions\n<code>type=\"Property\"</code> or any <em>properties-of-properties</em> elements. You can see that <code>Link</code> header from the request has been\nused as the <code>@context</code> returned in the response.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities"],"host":["localhost:1026"],"query":[{"key":"type","value":"Building"},{"description":{"content":"<ul>\n<li><code>keyValues</code> option in order to get a more compact and brief representation, including just attribute values</li>\n<li><code>values</code> option combined with a list of attribute values  <code>attrs</code>  for an ordered list of attributes only</li>\n</ul>\n","type":"text/plain"},"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"09634a0a-7ee2-460e-9870-d2437818f615"},{"name":"Filter context data by attribute value","id":"45c9a656-aa60-4e7e-a194-5660c3e81a67","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text","name":"Accept"}],"url":"http://localhost:1026/ngsi-ld/v1/entities/?type=Building&q=name==\"Checkpoint Markt\"&options=keyValues","description":"<p>This example returns all <code>Building</code> entiies with the <code>name</code> attribute <em>Checkpoint Markt</em>. Filtering can be done using\nthe <code>q</code> parameter - if a string has spaces in it, it can be URL encoded and held within single quote characters <code>'</code> =\n<code>%27</code>.</p>\n<p>The <code>Link</code> header <code>https://schema.lab.fiware.org/ld/context</code> holds an array of <code>@context</code> as shown:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"@context\": [\n        \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\",\n        \"https://schema.lab.fiware.org/ld/fiware-datamodels-context.jsonld\"\n    ]\n}\n</code></pre>\n<p>and therefore includes the FIWARE Building model.</p>\n<p>This means that use of the <code>Link</code> header and the <code>options=keyValues</code> parameter reduces the response to short form\nJSON-LD as shown:</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:1026"],"query":[{"key":"type","value":"Building"},{"key":"q","value":"name==\"Checkpoint Markt\""},{"description":{"content":"<ul>\n<li><code>keyValues</code> option in order to get a more compact and brief representation, including just attribute values</li>\n<li><code>values</code> option combined with a list of attribute values  <code>attrs</code>  for an ordered list of attributes only</li>\n</ul>\n","type":"text/plain"},"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"45c9a656-aa60-4e7e-a194-5660c3e81a67"},{"name":"Filter context data by attribute in an Array","id":"e90886cd-5458-4718-ad30-fee503cc1491","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text","name":"Accept"}],"url":"http://localhost:1026/ngsi-ld/v1/entities/?type=Building&q=category==\"commercial\",\"office\"&options=keyValues","description":"<p>Within the standard <code>Building</code> model, the <code>category</code> attribute refers to an array of strings. This example returns all\n<code>Building</code> entities with a <code>category</code> attribute which contains either <code>commercial</code> or <code>office</code> strings. Filtering can be\ndone using the <code>q</code> parameter, comma separating the acceptable values.</p>\n<p>The response is returned in JSON-LD format with short form attribute names</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:1026"],"query":[{"key":"type","value":"Building"},{"key":"q","value":"category==\"commercial\",\"office\""},{"description":{"content":"<ul>\n<li><code>keyValues</code> option in order to get a more compact and brief representation, including just attribute values</li>\n<li><code>values</code> option combined with a list of attribute values  <code>attrs</code>  for an ordered list of attributes only</li>\n</ul>\n","type":"text/plain"},"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"e90886cd-5458-4718-ad30-fee503cc1491"},{"name":"Filter context data by sub-attribute value","id":"80121a8c-293d-4624-95a2-2c2e36efb6ea","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text"}],"url":"http://localhost:1026/ngsi-ld/v1/entities/?type=Building&q=address%5BaddressLocality%5D==\"Kreuzberg\"&options=keyValues","description":"<p>This example returns all stores found in the Kreuzberg District.</p>\n<p>Filtering can be done using the <code>q</code> parameter - sub-attributes are annotated using the bracket syntax e.g.\n<code>q=address[addressLocality]==Kreuzberg</code>. This differs from NGSI v2 where dot syntax was used.</p>\n<p>Use of the <code>Link</code> header and the <code>options=keyValues</code> parameter reduces the response to JSON-LD.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:1026"],"query":[{"key":"type","value":"Building"},{"key":"q","value":"address%5BaddressLocality%5D==\"Kreuzberg\""},{"description":{"content":"<ul>\n<li><code>keyValues</code> option in order to get a more compact and brief representation, including just attribute values</li>\n<li><code>values</code> option combined with a list of attribute values  <code>attrs</code>  for an ordered list of attributes only</li>\n</ul>\n","type":"text/plain"},"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"80121a8c-293d-4624-95a2-2c2e36efb6ea"},{"name":"Filter context data by metadata value","id":"1675ee8a-909c-4d91-972f-5b2f90d27922","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text"}],"url":"http://localhost:1026/ngsi-ld/v1/entities/?type=Building&q=address.verified==true&options=keyValues","description":"<p>This example returns the data of all <code>Building</code> entities with a verified address. The <code>verified</code> attribute is an example\nof a <em>Property-of-a-Property</em></p>\n<p>Metadata queries (i.e. Properties of Properties) are annotated using the dot syntax e.g. <code>q=address.verified==true</code>.\nThis supercedes the <code>mq</code> parameter from NGSI v2.</p>\n<p>Because of the use of the <code>options=keyValues</code>, the response consists of JSON only without the attribute <code>type</code> and\n<code>metadata</code> elements.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:1026"],"query":[{"key":"type","value":"Building"},{"key":"q","value":"address.verified==true"},{"description":{"content":"<ul>\n<li><code>keyValues</code> option in order to get a more compact and brief representation, including just attribute values</li>\n<li><code>values</code> option combined with a list of attribute values  <code>attrs</code>  for an ordered list of attributes only</li>\n</ul>\n","type":"text/plain"},"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"1675ee8a-909c-4d91-972f-5b2f90d27922"},{"name":"Filter context data by distance","id":"c6454020-2f49-4c34-8f0a-ec36df0fc16e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text"}],"url":"http://localhost:1026/ngsi-ld/v1/entities/?type=Building&geometry=Point&coordinates=%5B13.3777,52.5162%5D&georel=near;maxDistance==2000&options=keyValues","description":"<p>This example return all Stores within 2km the <strong>Brandenburg Gate</strong> in <strong>Berlin</strong> (<em>52.5162N 13.3777W</em>). To make a\ngeo-query request, three parameters must be specified, <code>geometry</code>, <code>coordinates</code> and <code>georel</code>.</p>\n<p>The syntax for NGSI-LD has been updated, the <code>coordinates</code> parameter is now represented in\n<a href=\"https://tools.ietf.org/html/rfc7946\">geoJSON</a> including the square brackets rather than the simple lat-long pairs\nrequired in NGSI v2.</p>\n<p>Note that by default the geo-query will be applied to the <code>location</code> attribute, as this is default specified in NGSI-LD.\nIf another attribute is is to be used, an additional <code>geoproperty</code> parameter is required.</p>\n<p>Because of the use of the <code>options=keyValues</code>, the response consists of JSON only without the attribute <code>type</code> and\n<code>metadata</code> elements.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:1026"],"query":[{"key":"type","value":"Building"},{"key":"geometry","value":"Point"},{"key":"coordinates","value":"%5B13.3777,52.5162%5D"},{"description":{"content":"<p>Ordered list of attribute names to display</p>\n","type":"text/plain"},"key":"georel","value":"near;maxDistance==2000"},{"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"c6454020-2f49-4c34-8f0a-ec36df0fc16e"}],"id":"284f5126-93d0-4bd7-b2db-fc61473589d4","description":"<h1 id=\"architecture\">Architecture</h1>\n<p>The demo application will send and receive NGSI-LD calls to a compliant context broker. Since both NSGI v2 and NSGI-LD\ninterfaces are available to an experimental version fo the\n<a href=\"https://fiware-orion.readthedocs.io/en/latest/\">Orion Context Broker</a>, our demo application will only make use of one\nFIWARE component.</p>\n<p>Currently, the Orion Context Broker relies on open source <a href=\"https://www.mongodb.com/\">MongoDB</a> technology to keep\npersistence of the context data it holds. Therefore, the architecture will consist of two elements:</p>\n<ul>\n<li>The <a href=\"https://fiware-orion.readthedocs.io/en/latest/\">Orion Context Broker</a> which will receive requests using\n<a href=\"https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/full_api.json\">NGSI-LD</a></li>\n<li>The underlying <a href=\"https://www.mongodb.com/\">MongoDB</a> database :<ul>\n<li>Used by the Orion Context Broker to hold context data information such as data entities, subscriptions and\nregistrations</li>\n</ul>\n</li>\n</ul>\n<p>Since all interactions between the two elements are initiated by HTTP requests, the entities can be containerized and\nrun from exposed ports.</p>\n<p><img src=\"https://fiware.github.io/tutorials.Linked-Data/img/architecture.png\" alt /></p>\n<p>The necessary configuration information can be seen in the services section of the associated <code>docker-compose.yml</code> file:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-yaml\">orion:\n    image: fiware/orion-ld\n    hostname: orion\n    container_name: fiware-orion\n    depends_on:\n        - mongo-db\n    networks:\n        - default\n    ports:\n        - \"1026:1026\"\n    command: -dbhost mongo-db -logLevel DEBUG\n    healthcheck:\n        test: curl --fail -s http://orion:1026/version || exit 1\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-yaml\">mongo-db:\n    image: mongo:3.6\n    hostname: mongo-db\n    container_name: db-mongo\n    expose:\n        - \"27017\"\n    ports:\n        - \"27017:27017\"\n    networks:\n        - default\n    command: --nojournal\n</code></pre>\n<p>Both containers are residing on the same network - the Orion Context Broker is listening on Port <code>1026</code> and MongoDB is\nlistening on the default port <code>27071</code>. Both containers are also exposing the same ports externally - this is purely for\nthe tutorial access - so that cUrl or Postman can access them without being part of the same network. The command-line\ninitialization should be self explanatory.</p>\n<p>The only notable difference to the introductory tutorials is that the required image name is currently\n<code>fiware/orion-ld</code>.</p>\n<h1 id=\"start-up\">Start Up</h1>\n<p>All services can be initialised from the command-line by running the\n<a href=\"https://github.com/FIWARE/tutorials.Linked-Data/blob/master/services\">services</a> Bash script provided within the\nrepository. Please clone the repository and create the necessary images by running the commands as shown:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">git clone git@github.com:FIWARE/tutorials.Linked-Data.git\ncd tutorials.Linked-Data\n\n./services orion\n</code></pre>\n<blockquote>\n<p><strong>Note:</strong> If you want to clean up and start over again you can do so with the following command:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>./services stop\n</code></pre></blockquote>\n","event":[{"listen":"prerequest","script":{"id":"c6f208cc-a59b-42b8-9620-62d9ef03ae93","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"b83a80ad-cdaa-46cb-86c8-33cd8ab776a0","type":"text/javascript","exec":[""]}}],"_postman_id":"284f5126-93d0-4bd7-b2db-fc61473589d4"},{"name":"Linked Data using Scorpio","item":[{"name":"Obtaining Version Information","id":"e089f828-7ff9-43ee-b9a7-7115989d62dd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:9090/scorpio/v1/info/","description":"<p>This tutorial recreates the same data entities as the intial <em>\"Powered by FIWARE\"</em> supermarket finder app, but using\nNGSI-LD linked data entities rather than NGSI v2.</p>\n<h2 id=\"checking-the-service-health\">Checking the service health</h2>\n<p>As usual, you can check if the Orion Context Broker is running by making an HTTP request to the exposed port.</p>\n<p>The format of the response has not changed. The <code>release_date</code> must be 16th July 2019 or later to be able to\nwork with the requests defined below.</p>\n","urlObject":{"protocol":"http","path":["scorpio","v1","info",""],"host":["localhost:9090"],"query":[],"variable":[]}},"response":[],"_postman_id":"e089f828-7ff9-43ee-b9a7-7115989d62dd"},{"name":"Obtain full Linked Data model context","id":"8fb0f674-e4e1-4b2c-b6d3-c070a784ac1d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://fiware.github.io/data-models/context.jsonld","description":"<p>Information about the data models and relationships used within this tutorial\ncan be obtained by requesting the full <code>@context</code> and <code>@graph</code>.</p>\n","urlObject":{"host":["https://fiware.github.io/data-models/context.jsonld"],"query":[],"variable":[]}},"response":[],"_postman_id":"8fb0f674-e4e1-4b2c-b6d3-c070a784ac1d"},{"name":"Creating your first Data Entity","id":"4610cae2-db40-493f-9610-9d36758daa6d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/ld+json"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"urn:ngsi-ld:Building:store001\",\n    \"type\": \"Building\",\n    \"category\": {\n    \t\"type\": \"Property\",\n        \"value\": [\"commercial\"]\n    },\n    \"address\": {\n        \"type\": \"Property\",\n        \"value\": {\n            \"streetAddress\": \"Bornholmer Straße 65\",\n            \"addressRegion\": \"Berlin\",\n            \"addressLocality\": \"Prenzlauer Berg\",\n            \"postalCode\": \"10439\"\n        },\n        \"verified\": {\n\t\t\t\"type\": \"Property\",\n\t\t\t\"value\": true\n\t\t}\n    },\n    \"location\": {\n        \"type\": \"GeoProperty\",\n        \"value\": {\n             \"type\": \"Point\",\n             \"coordinates\": [13.3986, 52.5547]\n        }\n    },\n    \"name\": {\n        \"type\": \"Property\",\n        \"value\": \"Bösebrücke Einkauf\"\n    },\n    \"@context\": [\n        \"https://fiware.github.io/data-models/context.jsonld\",\n        \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\"\n    ]\n}"},"url":"http://localhost:9090/ngsi-ld/v1/entities/","description":"<h2 id=\"creating-context-data\">Creating Context Data</h2>\n<p>When creating linked data entities, it is important to use common data models. This will allow us to easily combine data\nfrom multiple sources and remove ambiguity when comparing data coming from different sources.</p>\n<p>Creating linked data using full qualified names throughout would be painful, as each attribute would need to be a URN,\nso JSON-LD introduces the idea of an <code>@context</code> attribute which can hold pointers to context definitions. To add a\nFIWARE <a href=\"https://fiware-datamodels.readthedocs.io/en/latest/Building/Building/doc/spec/index.html\">Building</a> data entity,\nthe following <code>@context</code> would be required</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"id\": \"urn:ngsi-ld:Building:store001\",\n    \"type\": \"Building\",\n    ...  other data attributes\n    \"@context\": [\n        \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\",\n        \"https://schema.lab.fiware.org/ld/fiware-datamodels-context.jsonld\"\n    ]\n}\n</code></pre>\n<h3 id=\"core-context\">Core Context</h3>\n<p><a href=\"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\">https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld</a>\nrefers to the Core <code>@context</code> of NSGI-LD, this defines element such as <code>id</code> and <code>type</code> which are common to all NGSI\nentities, as well as defining terms such as <code>Property</code> and <code>Relationship</code>. The core context is so fundamental to\nNGSI-LD, that it is added by default to any <code>@context</code> sent to a request.</p>\n<h3 id=\"fiware-data-models\">FIWARE Data Models</h3>\n<p><a href=\"https://schema.lab.fiware.org/ld/fiware-datamodels-context.jsonld\">https://schema.lab.fiware.org/ld/fiware-datamodels-context.jsonld</a>\nrefers to the definition of standard data models supplied by FIWARE. Adding this to the <code>@context</code> will load the\ndefinitions of all the <a href=\"https://fiware-datamodels.readthedocs.io\">data models</a> defined by the FIWARE Foundation, a\nsummary of the FQNs related to <strong>Building</strong> can be seen below:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"@context\": {\n        \"Building\": \"https://uri.fiware.org/ns/datamodels/Building\",\n        ... etc\n        \"address\": \"http://schema.org/address\",\n        \"category\": \"https://uri.fiware.org/ns/datamodels/category\",\n        \"location\": \"http://uri.etsi.org/ngsi-ld/location\",\n        \"name\": \"http://schema.org/name\",\n        ...etc\n    }\n}\n</code></pre>\n<p>If we include this context definition, it means that we will be able to use short names for <code>Building</code>, <code>address</code>,\n<code>location</code> for our entities, but computers will also be able to read the FNQs when comparing with other sources.</p>\n<p>To create a valid <strong>Building</strong> data entity in the context broker, make a POST request to the\n<code>http://localhost:1026/ngsi-ld/v1/entities</code> endpoint as shown below. It is essential that the appropriate\n<code>Content-Type: application/ld+json</code> is also used, so that the data entity is recognized as Linked data.</p>\n<p>The first request will take some time, as the context broker must navigate and load all of the files mentioned in the\n<code>@context</code>.</p>\n<blockquote>\n<p><strong>Note</strong>: if <code>https://fiware.github.io/data-models/context.jsonld</code> is unavailable for some reason the request will fail</p>\n<p>For a working production system it is essential that the <code>@context</code> files are always available to ensure third parties can\nread the context. High availability infrastructure has not been considered for this tutorial to keep the architecture simple.</p>\n</blockquote>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:9090"],"query":[],"variable":[]}},"response":[],"_postman_id":"4610cae2-db40-493f-9610-9d36758daa6d"},{"name":"Creating your Second Data Entity","id":"2ae054eb-b13f-4b73-91c8-0ec7e462d09c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/ld+json"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"urn:ngsi-ld:Building:store002\",\n    \"type\": \"Building\",\n    \"category\": {\n    \t\"type\": \"Property\",\n        \"value\": [\"commercial\"]\n    },\n    \"address\": {\n        \"type\": \"Property\",\n        \"value\": {\n            \"streetAddress\": \"Friedrichstraße 44\",\n            \"addressRegion\": \"Berlin\",\n            \"addressLocality\": \"Kreuzberg\",\n            \"postalCode\": \"10969\"\n        },\n        \"verified\": {\n\t\t\t\"type\": \"Property\",\n\t\t\t\"value\": true\n\t\t}\n    },\n     \"location\": {\n        \"type\": \"GeoProperty\",\n        \"value\": {\n             \"type\": \"Point\",\n              \"coordinates\": [13.3903, 52.5075]\n        }\n    },\n    \"name\": {\n        \"type\": \"Property\",\n        \"value\": \"Checkpoint Markt\"\n    },\n    \"@context\": [\n        \"https://fiware.github.io/data-models/context.jsonld\",\n        \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\"\n    ]\n}"},"url":"http://localhost:9090/ngsi-ld/v1/entities/","description":"<p>Each subsequent entity must have a unique <code>id</code> for the given <code>type</code>.</p>\n<h3 id=\"defining-properties-within-the-ngsi-ld-entity-definition\">Defining Properties within the NGSI-LD entity definition</h3>\n<p>The attributes <code>id</code> and <code>type</code> should be familiar to anyone who has used NSGI v2, and these have not changed. As\nmentioned above, the type should refer to an included data model, in this case <code>Building</code> is being used as a short name\nfor the inclued URN <code>https://uri.fiware.org/ns/datamodels/Building</code>. Thereafter each <em>property</em> is defined as a JSON\nelement containing two attributes, a <code>type</code> and a <code>value</code>.</p>\n<p>The <code>type</code> of a <em>property</em> attribute must be one of the following:</p>\n<ul>\n<li><code>\"GeoProperty\"</code>: <code>\"http://uri.etsi.org/ngsi-ld/GeoProperty\"</code> for locations. Locations should be specified as\nLongitude-Latitude pairs in <a href=\"https://tools.ietf.org/html/rfc7946\">GeoJSON format</a>. The preferred name for the\nprimary location attribute is <code>location</code></li>\n<li><code>\"TemporalProperty\"</code>: <code>\"http://uri.etsi.org/ngsi-ld/TemporalProperty\"</code> for time-based values. Temporal properties\nshould be Date, Time or DateTime strings encoded be <a href=\"https://en.wikipedia.org/wiki/ISO_8601\">ISO 8601 format</a> - e.g.\n<code>YYYY-MM-DDThh:mm:ssZ</code></li>\n<li><code>\"Property\"</code>: <code>\"http://uri.etsi.org/ngsi-ld/Property\"</code> - for everything else</li>\n</ul>\n<blockquote>\n<p><strong>Note:</strong> that for simplicity, this data entity has no relationships defined. Relationships must be given the\n<code>type=\"Relationship</code>. Relationships will be discusssed in a subsequent tutorial.</p>\n</blockquote>\n<h3 id=\"defining-properties-of-properties-within-the-ngsi-ld-entity-definition\">Defining Properties-of-Properties within the NGSI-LD entity definition</h3>\n<p><em>Properties-of-Properties</em> is the NGSI-LD equivalent of metadata (i.e. <em>\"data about data\"</em>), it is use to describe\nproperties of the attribute value itself like accuracy, provider, or the units to be used. Some built-in metadata\nattributes already exist and these names are reserved:</p>\n<ul>\n<li><code>createdAt</code> (type: DateTime): attribute creation date as an ISO 8601 string.</li>\n<li><code>modifiedAt</code> (type: DateTime): attribute modification date as an ISO 8601 string.</li>\n</ul>\n<p>Additionally <code>observedAt</code>, <code>datasetId</code> and <code>instanceId</code> may optionally be added in some cases, and <code>location</code>,\n<code>observationSpace</code> and <code>operationSpace</code> have special meaning for Geoproperties.</p>\n<p>In the examples given above, one element of metadata (i.e. a <em>property-of-a-property</em>) can be found within the <code>address</code>\nattribute. a <code>verified</code> flag indicates whether the address has been confirmed. The commonest <em>property-of-a-property</em> is\n<code>unitCode</code> which should be used to hold the UN/CEFACT\n<a href=\"http://wiki.goodrelations-vocabulary.org/Documentation/UN/CEFACT_Common_Codes\">Common Codes</a> for Units of Measurement.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:9090"],"query":[],"variable":[]}},"response":[],"_postman_id":"2ae054eb-b13f-4b73-91c8-0ec7e462d09c"},{"name":"Obtain Entity Data by FNQ type","id":"76b8e6dd-a2e2-4e3c-8a41-1281ace0ae42","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Accept","value":"application/ld+json","type":"text"}],"url":"http://localhost:9090/ngsi-ld/v1/entities?type=https://uri.fiware.org/ns/data-models%23Building","description":"<p>This example returns the data of all <code>Building</code> entities within the context data The <code>type</code> parameter is mandatory for\nNGSI-LD and is used to filter the response.</p>\n<p>The response returns the Core <code>@context</code> by default\n(<code>https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/defaultContext/defaultContext.jsonld</code>) and all attributes are\nexpanded whenever possible.</p>\n<ul>\n<li><code>id</code>, <code>type</code> and <code>location</code> are defined in the core context and are not expanded.</li>\n<li><code>address</code> has been mapped to <code>http://schema.org/address</code></li>\n<li><code>name</code> has been mapped to <code>http://schema.org/name</code></li>\n<li><code>category</code> has been mapped to <code>https://uri.fiware.org/ns/datamodels#category</code></li>\n</ul>\n<p>Note that if an attribute has not been not associated to an FNQ when the entity was created, the short name will\n<strong>always</strong> be displayed.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities"],"host":["localhost:9090"],"query":[{"key":"type","value":"https://uri.fiware.org/ns/data-models%23Building"}],"variable":[]}},"response":[],"_postman_id":"76b8e6dd-a2e2-4e3c-8a41-1281ace0ae42"},{"name":"Obtain Entity Data by id","id":"081b277b-cfc0-4605-8406-3e6869448235","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Accept","value":"application/ld+json","type":"text"}],"url":"http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Building:store001","description":"<p>This example returns the data of <code>urn:ngsi-ld:Building:store001</code>.</p>\n<p>The response returns the Core <code>@context</code> by default\n(<code>https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/defaultContext/defaultContext.jsonld</code>) and all attributes are\nexpanded whenever possible.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities","urn:ngsi-ld:Building:store001"],"host":["localhost:9090"],"query":[{"disabled":true,"description":{"content":"<p>Entity type, to avoid ambiguity in case there are several entities with the same entity id</p>\n","type":"text/plain"},"key":"type","value":"Store"},{"disabled":true,"description":{"content":"<p>Ordered list of attribute names to display</p>\n","type":"text/plain"},"key":"attrs","value":"name"}],"variable":[]}},"response":[],"_postman_id":"081b277b-cfc0-4605-8406-3e6869448235"},{"name":"Obtain Entity Data by type and linked context","id":"865b5f65-30d8-4f7d-b4ae-b07cccef37bb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text","name":"Accept"}],"url":"http://localhost:9090/ngsi-ld/v1/entities?type=Building&options=keyValues","description":"<p>If a reference to the supplied data is supplied, it is possible to return short name data and limit responses to a\nspecific <code>type</code> of data. For example, the request below returns the data of all <code>Building</code> entities within the context\ndata. Use of the <code>type</code> parameter limits the response to <code>Building</code> entities only, use of the <code>options=keyValues</code> query\nparameter reduces the response down to standard JSON-LD.</p>\n<p>A <a href=\"https://www.w3.org/wiki/LinkHeader\"><code>Link</code> header</a> must be supplied to associate the short form <code>type=\"Building\"</code>\nwith the FNQ <code>https://uri.fiware.org/ns/datamodels/Building</code>. The full link header syntax can be seen below:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-text\">Link: &lt;https://schema.lab.fiware.org/ld/fiware-datamodels-context.jsonld&gt;; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\n</code></pre>\n<p>The standard HTTP <code>Link</code> header allows metadata (in this case the <code>@context</code>) to be passed in without actually touching\nthe resource in question. In the case of NGSI-LD, the metadata is a file of in <code>application/ld+json</code> format.</p>\n<p>Because of the use of the <code>options=keyValues</code>, the response consists of JSON only without the attribute defintions\n<code>type=\"Property\"</code> or any <em>properties-of-properties</em> elements. You can see that <code>Link</code> header from the request has been\nused as the <code>@context</code> returned in the response.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities"],"host":["localhost:9090"],"query":[{"key":"type","value":"Building"},{"description":{"content":"<ul>\n<li><code>keyValues</code> option in order to get a more compact and brief representation, including just attribute values</li>\n<li><code>values</code> option combined with a list of attribute values  <code>attrs</code>  for an ordered list of attributes only</li>\n</ul>\n","type":"text/plain"},"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"865b5f65-30d8-4f7d-b4ae-b07cccef37bb"},{"name":"Filter context data by attribute value","id":"2b91396f-04c2-4682-a955-679f6f8e19fc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text","name":"Accept"}],"url":"http://localhost:9090/ngsi-ld/v1/entities/?type=Building&q=name==\"Checkpoint Markt\"&options=keyValues","description":"<p>This example returns all <code>Building</code> entiies with the <code>name</code> attribute <em>Checkpoint Markt</em>. Filtering can be done using\nthe <code>q</code> parameter - if a string has spaces in it, it can be URL encoded and held within single quote characters <code>'</code> =\n<code>%27</code>.</p>\n<p>The <code>Link</code> header <code>https://schema.lab.fiware.org/ld/context</code> holds an array of <code>@context</code> as shown:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"@context\": [\n        \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\",\n        \"https://schema.lab.fiware.org/ld/fiware-datamodels-context.jsonld\"\n    ]\n}\n</code></pre>\n<p>and therefore includes the FIWARE Building model.</p>\n<p>This means that use of the <code>Link</code> header and the <code>options=keyValues</code> parameter reduces the response to short form\nJSON-LD as shown:</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:9090"],"query":[{"key":"type","value":"Building"},{"key":"q","value":"name==\"Checkpoint Markt\""},{"description":{"content":"<ul>\n<li><code>keyValues</code> option in order to get a more compact and brief representation, including just attribute values</li>\n<li><code>values</code> option combined with a list of attribute values  <code>attrs</code>  for an ordered list of attributes only</li>\n</ul>\n","type":"text/plain"},"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"2b91396f-04c2-4682-a955-679f6f8e19fc"},{"name":"Filter context data by attribute in an Array","id":"f1a9aa0a-5cae-46d9-9b3b-1d2bd69497a8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text","name":"Accept"}],"url":"http://localhost:9090/ngsi-ld/v1/entities/?type=Building&q=category==\"commercial\",\"office\"&options=keyValues","description":"<p>Within the standard <code>Building</code> model, the <code>category</code> attribute refers to an array of strings. This example returns all\n<code>Building</code> entities with a <code>category</code> attribute which contains either <code>commercial</code> or <code>office</code> strings. Filtering can be\ndone using the <code>q</code> parameter, comma separating the acceptable values.</p>\n<p>The response is returned in JSON-LD format with short form attribute names</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:9090"],"query":[{"key":"type","value":"Building"},{"key":"q","value":"category==\"commercial\",\"office\""},{"description":{"content":"<ul>\n<li><code>keyValues</code> option in order to get a more compact and brief representation, including just attribute values</li>\n<li><code>values</code> option combined with a list of attribute values  <code>attrs</code>  for an ordered list of attributes only</li>\n</ul>\n","type":"text/plain"},"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"f1a9aa0a-5cae-46d9-9b3b-1d2bd69497a8"},{"name":"Filter context data by sub-attribute value","id":"94104405-b26f-47ac-b109-195d3f1b4a95","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text"}],"url":"http://localhost:9090/ngsi-ld/v1/entities/?type=Building&q=address%5BaddressLocality%5D==\"Kreuzberg\"&options=keyValues","description":"<p>This example returns all stores found in the Kreuzberg District.</p>\n<p>Filtering can be done using the <code>q</code> parameter - sub-attributes are annotated using the bracket syntax e.g.\n<code>q=address[addressLocality]==Kreuzberg</code>. This differs from NGSI v2 where dot syntax was used.</p>\n<p>Use of the <code>Link</code> header and the <code>options=keyValues</code> parameter reduces the response to JSON-LD.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:9090"],"query":[{"key":"type","value":"Building"},{"key":"q","value":"address%5BaddressLocality%5D==\"Kreuzberg\""},{"description":{"content":"<ul>\n<li><code>keyValues</code> option in order to get a more compact and brief representation, including just attribute values</li>\n<li><code>values</code> option combined with a list of attribute values  <code>attrs</code>  for an ordered list of attributes only</li>\n</ul>\n","type":"text/plain"},"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"94104405-b26f-47ac-b109-195d3f1b4a95"},{"name":"Filter context data by metadata value","id":"74ef6a5f-d206-4574-84b8-c4544f511f71","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text"}],"url":"http://localhost:9090/ngsi-ld/v1/entities/?type=Building&q=address.verified==true&options=keyValues","description":"<p>This example returns the data of all <code>Building</code> entities with a verified address. The <code>verified</code> attribute is an example\nof a <em>Property-of-a-Property</em></p>\n<p>Metadata queries (i.e. Properties of Properties) are annotated using the dot syntax e.g. <code>q=address.verified==true</code>.\nThis supercedes the <code>mq</code> parameter from NGSI v2.</p>\n<p>Because of the use of the <code>options=keyValues</code>, the response consists of JSON only without the attribute <code>type</code> and\n<code>metadata</code> elements.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:9090"],"query":[{"key":"type","value":"Building"},{"key":"q","value":"address.verified==true"},{"description":{"content":"<ul>\n<li><code>keyValues</code> option in order to get a more compact and brief representation, including just attribute values</li>\n<li><code>values</code> option combined with a list of attribute values  <code>attrs</code>  for an ordered list of attributes only</li>\n</ul>\n","type":"text/plain"},"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"74ef6a5f-d206-4574-84b8-c4544f511f71"},{"name":"Filter context data by distance","id":"79ee8f5f-4905-43fa-8970-f589506c340b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Link","type":"text","value":"<https://fiware.github.io/data-models/context.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\""},{"key":"Accept","value":"application/ld+json","type":"text"}],"url":"http://localhost:9090/ngsi-ld/v1/entities/?type=Building&geometry=Point&coordinates=%5B13.3777,52.5162%5D&georel=near;maxDistance==2000&options=keyValues","description":"<p>This example return all Stores within 2km the <strong>Brandenburg Gate</strong> in <strong>Berlin</strong> (<em>52.5162N 13.3777W</em>). To make a\ngeo-query request, three parameters must be specified, <code>geometry</code>, <code>coordinates</code> and <code>georel</code>.</p>\n<p>The syntax for NGSI-LD has been updated, the <code>coordinates</code> parameter is now represented in\n<a href=\"https://tools.ietf.org/html/rfc7946\">geoJSON</a> including the square brackets rather than the simple lat-long pairs\nrequired in NGSI v2.</p>\n<p>Note that by default the geo-query will be applied to the <code>location</code> attribute, as this is default specified in NGSI-LD.\nIf another attribute is is to be used, an additional <code>geoproperty</code> parameter is required.</p>\n<p>Because of the use of the <code>options=keyValues</code>, the response consists of JSON only without the attribute <code>type</code> and\n<code>metadata</code> elements.</p>\n","urlObject":{"protocol":"http","path":["ngsi-ld","v1","entities",""],"host":["localhost:9090"],"query":[{"key":"type","value":"Building"},{"key":"geometry","value":"Point"},{"key":"coordinates","value":"%5B13.3777,52.5162%5D"},{"description":{"content":"<p>Ordered list of attribute names to display</p>\n","type":"text/plain"},"key":"georel","value":"near;maxDistance==2000"},{"key":"options","value":"keyValues"}],"variable":[]}},"response":[],"_postman_id":"79ee8f5f-4905-43fa-8970-f589506c340b"}],"id":"bd97c44e-2303-47b2-87ef-976f85a6638e","description":"<h1 id=\"architecture\">Architecture</h1>\n<p>The demo application will send and receive NGSI-LD calls to a compliant context broker. Since both NSGI v2 and NSGI-LD\ninterfaces are available to an experimental version fo the\n<a href=\"https://fiware-orion.readthedocs.io/en/latest/\">Orion Context Broker</a>, our demo application will only make use of one\nFIWARE component.</p>\n<p>Currently, the Orion Context Broker relies on open source <a href=\"https://www.mongodb.com/\">MongoDB</a> technology to keep\npersistence of the context data it holds. Therefore, the architecture will consist of two elements:</p>\n<ul>\n<li>The <a href=\"https://fiware-orion.readthedocs.io/en/latest/\">Orion Context Broker</a> which will receive requests using\n<a href=\"https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/full_api.json\">NGSI-LD</a></li>\n<li>The underlying <a href=\"https://www.mongodb.com/\">MongoDB</a> database :<ul>\n<li>Used by the Orion Context Broker to hold context data information such as data entities, subscriptions and\nregistrations</li>\n</ul>\n</li>\n</ul>\n<p>Since all interactions between the two elements are initiated by HTTP requests, the entities can be containerized and\nrun from exposed ports.</p>\n<p><img src=\"https://fiware.github.io/tutorials.Linked-Data/img/architecture.png\" alt /></p>\n<p>The necessary configuration information can be seen in the services section of the associated <code>docker-compose.yml</code> file:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-yaml\">orion:\n    image: fiware/orion-ld\n    hostname: orion\n    container_name: fiware-orion\n    depends_on:\n        - mongo-db\n    networks:\n        - default\n    ports:\n        - \"1026:1026\"\n    command: -dbhost mongo-db -logLevel DEBUG\n    healthcheck:\n        test: curl --fail -s http://orion:1026/version || exit 1\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-yaml\">mongo-db:\n    image: mongo:3.6\n    hostname: mongo-db\n    container_name: db-mongo\n    expose:\n        - \"27017\"\n    ports:\n        - \"27017:27017\"\n    networks:\n        - default\n    command: --nojournal\n</code></pre>\n<p>Both containers are residing on the same network - the Orion Context Broker is listening on Port <code>1026</code> and MongoDB is\nlistening on the default port <code>27071</code>. Both containers are also exposing the same ports externally - this is purely for\nthe tutorial access - so that cUrl or Postman can access them without being part of the same network. The command-line\ninitialization should be self explanatory.</p>\n<p>The only notable difference to the introductory tutorials is that the required image name is currently\n<code>fiware/orion-ld</code>.</p>\n<h1 id=\"start-up\">Start Up</h1>\n<p>All services can be initialised from the command-line by running the\n<a href=\"https://github.com/FIWARE/tutorials.Linked-Data/blob/master/services\">services</a> Bash script provided within the\nrepository. Please clone the repository and create the necessary images by running the commands as shown:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">git clone git@github.com:FIWARE/tutorials.Linked-Data.git\ncd tutorials.Linked-Data\n\n./services scorpio\n</code></pre>\n<blockquote>\n<p><strong>Note:</strong> If you want to clean up and start over again you can do so with the following command:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>./services stop\n</code></pre></blockquote>\n","event":[{"listen":"prerequest","script":{"id":"83da53ad-eed6-4bc8-baf1-28dae04deb58","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"8b5bbd87-a1a9-4a07-864e-aebff7afa941","type":"text/javascript","exec":[""]}}],"_postman_id":"bd97c44e-2303-47b2-87ef-976f85a6638e"}],"event":[{"listen":"prerequest","script":{"id":"581cc060-de73-4283-915a-fcaa1c126830","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"5215414e-418f-4c32-8070-b68d62c90ea4","type":"text/javascript","exec":[""]}}],"variable":[{"key":"orion","value":"localhost:1026"},{"key":"datamodels-context.jsonld","value":"https://fiware.github.io/data-models/context.jsonld"},{"key":"scorpio","value":"localhost:9090"}]}