Skip to content

Commit 3a7b9ef

Browse files
committed
Explain IRIs
1 parent ec26ae1 commit 3a7b9ef

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

docs/linked-data.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,41 @@ related to **Building** can be seen below:
330330
If we include this context definition, it means that we will be able to use short names for `Building`, `address`,
331331
`location` for our entities, but computers will also be able to read the FQNs when comparing with other sources.
332332

333+
#### Context terms are IRIs not URLs
334+
335+
It should be noted that According to the [JSON-LD Spec](https://www.w3.org/TR/json-ld/#the-context) : _"a context is
336+
used to map terms to IRIs."_ - An IRI (Internationalized Resource Identifier) is not necessarily a URL - see
337+
[here](https://fusion.cs.uni-jena.de/fusion/blog/2016/11/18/iri-uri-url-urn-and-their-differences/) and therefore it is
338+
not unexpected if elements such as `https://uri.etsi.org/ngsi-ld/name` do not actually resolve to a web-page. However
339+
many IRIs within JSON-LD `@context` files, such as `http://schema.org/address` do indeed return web-pages with more
340+
information about themselves.
341+
342+
If you take the NGSI-LD [Core @context](https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld)
343+
344+
```jsonld
345+
{
346+
"@context": {
347+
348+
"ngsi-ld": "https://uri.etsi.org/ngsi-ld/",
349+
"geojson": "https://purl.org/geojson/vocab#",
350+
"id": "@id",
351+
"type": "@type",
352+
...
353+
"@vocab": "https://uri.etsi.org/ngsi-ld/default-context/"
354+
}
355+
}
356+
```
357+
358+
You can see that any unresolved short-name for an attribute will be mapped onto the default context i.e.:
359+
360+
- Unknown attribute `xxx` => `https://uri.etsi.org/ngsi-ld/default-context/xxx`
361+
362+
And unsurprisingly these default-context IRIs don't exist as valid webpages either.
363+
364+
To create a valid **Building** data entity in the context broker, make a POST request to the
365+
`http://localhost:1026/ngsi-ld/v1/entities` endpoint as shown below. It is essential that the appropriate
366+
`Content-Type: application/ld+json` is also used, so that the data entity is recognized as Linked data.
367+
333368
To create a valid **Building** data entity in the context broker, make a POST request to the
334369
`http://localhost:1026/ngsi-ld/v1/entities` endpoint as shown below. It is essential that the appropriate
335370
`Content-Type: application/ld+json` is also used, so that the data entity is recognized as Linked data.

0 commit comments

Comments
 (0)