From d58e9fba5a0574b3876afe171ad2e4aa14943bca Mon Sep 17 00:00:00 2001 From: Julien Fleury Date: Thu, 12 Sep 2024 16:06:03 +0200 Subject: [PATCH] Open it context v4 (#229) * feat: added givenBy, givenTo & opensGate which are all relationships * feat: updated authorization payload & organized alphabetically * refactor: organized alphabetically * feat: updated key payload with opensGate * refactor: organized gate payload alphabetically --- openIt/jsonld-contexts/openIt.jsonld | 3 ++ openIt/ngsild-payloads/authorization.jsonld | 50 ++++++++++++--------- openIt/ngsild-payloads/gate.jsonld | 8 ++-- openIt/ngsild-payloads/key.jsonld | 20 +++++---- 4 files changed, 48 insertions(+), 33 deletions(-) diff --git a/openIt/jsonld-contexts/openIt.jsonld b/openIt/jsonld-contexts/openIt.jsonld index ee1aa0e..cf68ca7 100644 --- a/openIt/jsonld-contexts/openIt.jsonld +++ b/openIt/jsonld-contexts/openIt.jsonld @@ -5,9 +5,12 @@ "Key": "https://vocab.egm.io/Key", "codes": "https://vocab.egm.io/codes", "forGate": "https://vocab.egm.io/forGate", + "givenBy": "https://vocab.egm.io/givenBy", + "givenTo": "https://vocab.egm.io/givenTo", "initDate": "https://vocab.egm.io/initDate", "keyNumber": "https://vocab.egm.io/keyNumber", "name": "https://schema.org/name", + "opensGate": "https://vocab.egm.io/opensGate", "period": "https://vocab.egm.io/period", "rotationPeriod": "https://vocab.egm.io/rotationPeriod", "usesKey": "https://vocab.egm.io/usesKey", diff --git a/openIt/ngsild-payloads/authorization.jsonld b/openIt/ngsild-payloads/authorization.jsonld index fc53862..e449997 100644 --- a/openIt/ngsild-payloads/authorization.jsonld +++ b/openIt/ngsild-payloads/authorization.jsonld @@ -1,26 +1,6 @@ { "id": "urn:ngsi-ld:Authorization:01", "type": "Authorization", - "validationStatus": { - "type": "Property", - "value": "accepted" - }, - "period": { - "type": "JsonProperty", - "json": { - "startDate": "2024-09-01T11:00:00.000Z", - "endDate": "2024-09-02T11:00:00.000Z" - } - }, - "forGate": { - "type": "Relationship", - "object": "urn:ngsi-ld:Gate:123" - }, - "usesKey": { - "type": "Relationship", - "object": "urn:ngsi-ld:Key:123", - "datesetId": "urn:ngsi-ld:Dataset:Key123" - }, "codes": [ { "type": "Property", @@ -61,5 +41,33 @@ "value": "2024-08-30T11:00:00.000Z" } } - ] + ], + "forGate": { + "type": "Relationship", + "object": "urn:ngsi-ld:Gate:123" + }, + "givenBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:UserProfile:123" + }, + "givenTo": { + "type": "Relationship", + "object": "urn:ngsi-ld:UserProfile:ABC" + }, + "period": { + "type": "JsonProperty", + "json": { + "startDate": "2024-09-01T11:00:00.000Z", + "endDate": "2024-09-02T11:00:00.000Z" + } + }, + "usesKey": { + "type": "Relationship", + "object": "urn:ngsi-ld:Key:123", + "datesetId": "urn:ngsi-ld:Dataset:Key123" + }, + "validationStatus": { + "type": "Property", + "value": "accepted" + } } diff --git a/openIt/ngsild-payloads/gate.jsonld b/openIt/ngsild-payloads/gate.jsonld index 155af41..f91a28c 100644 --- a/openIt/ngsild-payloads/gate.jsonld +++ b/openIt/ngsild-payloads/gate.jsonld @@ -1,10 +1,6 @@ { "id": "urn:ngsi-ld:Gate:AwesomeGateName", "type": "Gate", - "name": { - "type": "Property", - "value": "AwesomeGateName" - }, "location": { "type": "GeoProperty", "value": { @@ -14,5 +10,9 @@ 1.5 ] } + }, + "name": { + "type": "Property", + "value": "AwesomeGateName" } } diff --git a/openIt/ngsild-payloads/key.jsonld b/openIt/ngsild-payloads/key.jsonld index 0a3dfc7..5f9cf72 100644 --- a/openIt/ngsild-payloads/key.jsonld +++ b/openIt/ngsild-payloads/key.jsonld @@ -1,14 +1,6 @@ { "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" @@ -16,5 +8,17 @@ "keyNumber": { "type": "Property", "value": "001" + }, + "name": { + "type": "Property", + "value": "AwesomeKeyName" + }, + "opensGate": { + "type": "Relationship", + "object": "urn:ngsi-ld:Gate:AwesomeGateName" + }, + "rotationPeriod": { + "type": "Property", + "value": "P1D" } }