From 4d1b55206ce0475bc42749c7a4861c4ff857ffa7 Mon Sep 17 00:00:00 2001 From: Julien Fleury Date: Mon, 2 Sep 2024 14:55:56 +0200 Subject: [PATCH] OpenIt Context (#225) * fix: found a typo in user.jsonld, in particular subscribedToAlerts * feat: added contexts for authorization, gate & key * feat: added config examples for authorization, gate & key as well changes to contexts * feat: added general authorization context & fixed codes into from typo * fix: renamed payload files to follow correct syntax * feat: updated context one one file, updated compound & name points to schema.org now * fix: updated status to validationStatus as status is in core context already * fix: fixed typo in validityStartDate * fix: added datasetId key to codes --- openIt/jsonld-contexts/openIt-compound.jsonld | 9 +++ openIt/jsonld-contexts/openIt.jsonld | 16 ++++++ openIt/ngsild-payloads/authorization.jsonld | 57 +++++++++++++++++++ openIt/ngsild-payloads/gate.jsonld | 18 ++++++ openIt/ngsild-payloads/key.jsonld | 16 ++++++ user/user.jsonld | 10 ++-- 6 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 openIt/jsonld-contexts/openIt-compound.jsonld create mode 100644 openIt/jsonld-contexts/openIt.jsonld create mode 100644 openIt/ngsild-payloads/authorization.jsonld create mode 100644 openIt/ngsild-payloads/gate.jsonld create mode 100644 openIt/ngsild-payloads/key.jsonld diff --git a/openIt/jsonld-contexts/openIt-compound.jsonld b/openIt/jsonld-contexts/openIt-compound.jsonld new file mode 100644 index 0000000..06b1327 --- /dev/null +++ b/openIt/jsonld-contexts/openIt-compound.jsonld @@ -0,0 +1,9 @@ +{ + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/openIt/jsonld-contexts/openIt.jsonld", + "https://easy-global-market.github.io/ngsild-api-data-models/user/user.jsonld", + "https://easy-global-market.github.io/ngsild-api-data-models/device/jsonld-contexts/device.jsonld", + "https://easy-global-market.github.io/ngsild-api-data-models/authorization/jsonld-contexts/authorization.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld" + ] +} diff --git a/openIt/jsonld-contexts/openIt.jsonld b/openIt/jsonld-contexts/openIt.jsonld new file mode 100644 index 0000000..b97ea78 --- /dev/null +++ b/openIt/jsonld-contexts/openIt.jsonld @@ -0,0 +1,16 @@ +{ + "@context": { + "Authorization": "https://vocab.egm.io/Authorization", + "Gate": "https://vocab.egm.io/Gate", + "Key": "https://vocab.egm.io/Key", + "codes": "https://vocab.egm.io/codes", + "from": "https://vocab.egm.io/from", + "initDate": "https://vocab.egm.io/initDate", + "name": "https://schema.org/name", + "rotationPeriod": "https://vocab.egm.io/rotationPeriod", + "to": "https://vocab.egm.io/to", + "validationStatus": "https://vocab.egm.io/validationStatus", + "validityEndDate": "https://vocab.egm.io/validityEndDate", + "validityStartDate": "https://vocab.egm.io/validityStartDate" + } +} diff --git a/openIt/ngsild-payloads/authorization.jsonld b/openIt/ngsild-payloads/authorization.jsonld new file mode 100644 index 0000000..05ffe21 --- /dev/null +++ b/openIt/ngsild-payloads/authorization.jsonld @@ -0,0 +1,57 @@ +{ + "id": "urn:ngsi-ld:Authorization:01", + "type": "Authorization", + "validationStatus": { + "type": "Property", + "value": "accepted", + "from": { + "type": "Property", + "value": "2024-09-01T11:00:00.000Z" + }, + "to": { + "type": "Property", + "value": "2024-09-02T11:00:00.000Z" + } + }, + "codes": [ + { + "type": "Property", + "value": "1234", + "datasetId": "urn:ngsi-ld:Dataset:1234", + "validityStartDate": { + "type": "Property", + "value": "2024-09-01T11:00:00.000Z" + }, + "validityEndDate": { + "type": "Property", + "value": "2024-09-02T11:00:00.000Z" + } + }, + { + "type": "Property", + "value": "8931", + "datasetId": "urn:ngsi-ld:Dataset:8931", + "validityStartDate": { + "type": "Property", + "value": "2024-08-30T11:00:00.000Z" + }, + "validityEndDate": { + "type": "Property", + "value": "2024-08-31T11:00:00.000Z" + } + }, + { + "type": "Property", + "value": "3910", + "datasetId": "urn:ngsi-ld:Dataset:3910", + "validityStartDate": { + "type": "Property", + "value": "2024-08-29T11:00:00.000Z" + }, + "validityEndDate": { + "type": "Property", + "value": "2024-08-30T11:00:00.000Z" + } + } + ] +} diff --git a/openIt/ngsild-payloads/gate.jsonld b/openIt/ngsild-payloads/gate.jsonld new file mode 100644 index 0000000..155af41 --- /dev/null +++ b/openIt/ngsild-payloads/gate.jsonld @@ -0,0 +1,18 @@ +{ + "id": "urn:ngsi-ld:Gate:AwesomeGateName", + "type": "Gate", + "name": { + "type": "Property", + "value": "AwesomeGateName" + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + 1.5, + 1.5 + ] + } + } +} diff --git a/openIt/ngsild-payloads/key.jsonld b/openIt/ngsild-payloads/key.jsonld new file mode 100644 index 0000000..1417504 --- /dev/null +++ b/openIt/ngsild-payloads/key.jsonld @@ -0,0 +1,16 @@ +{ + "id": "urn:ngsi-ld:Key:AwesomeKeyName", + "type": "Key", + "name": { + "type": "Property", + "value": "AwesomeKeyName" + }, + "rotationPeriod": { + "type": "Property", + "value": "P1D" + }, + "initDate": { + "type": "Property", + "value": "2024-09-02T11:00:00.000Z" + } +} diff --git a/user/user.jsonld b/user/user.jsonld index 88d8628..3fce512 100644 --- a/user/user.jsonld +++ b/user/user.jsonld @@ -1,7 +1,7 @@ { - "@context": { - "UserProfile": "https://smartdatamodels.org/UserProfile", - "subcribedToAlerts": "https://vocab.egm.io/subcribedToAlerts", - "userInfos": "https://vocab.egm.io/userInfos" - } + "@context": { + "UserProfile": "https://smartdatamodels.org/UserProfile", + "subscribedToAlerts": "https://vocab.egm.io/subscribedToAlerts", + "userInfos": "https://vocab.egm.io/userInfos" + } }