From 206b638787ff020edbbacf9c3a9efbdfd68b8eca Mon Sep 17 00:00:00 2001 From: George J Padayatti Date: Tue, 23 Aug 2022 16:59:57 +0530 Subject: [PATCH] Add JSONLD context and example for Permission Signed-off-by: George J Padayatti --- .../README.md | 0 .../dexa-context.jsonld} | 36 +++++++++++++++++-- .../example-dda.jsonld} | 10 +++--- .../jsonld/example-permission.jsonld | 26 ++++++++++++++ 4 files changed, 64 insertions(+), 8 deletions(-) rename interface-specs/{data-disclosure-agreement-schema => jsonld}/README.md (100%) rename interface-specs/{data-disclosure-agreement-schema/data-disclosure-agreement-schema-context.jsonld => jsonld/dexa-context.jsonld} (79%) rename interface-specs/{data-disclosure-agreement-schema/example.jsonld => jsonld/example-dda.jsonld} (86%) create mode 100644 interface-specs/jsonld/example-permission.jsonld diff --git a/interface-specs/data-disclosure-agreement-schema/README.md b/interface-specs/jsonld/README.md similarity index 100% rename from interface-specs/data-disclosure-agreement-schema/README.md rename to interface-specs/jsonld/README.md diff --git a/interface-specs/data-disclosure-agreement-schema/data-disclosure-agreement-schema-context.jsonld b/interface-specs/jsonld/dexa-context.jsonld similarity index 79% rename from interface-specs/data-disclosure-agreement-schema/data-disclosure-agreement-schema-context.jsonld rename to interface-specs/jsonld/dexa-context.jsonld index 6a84b24..f80c6ee 100644 --- a/interface-specs/data-disclosure-agreement-schema/data-disclosure-agreement-schema-context.jsonld +++ b/interface-specs/jsonld/dexa-context.jsonld @@ -2,10 +2,11 @@ "@context": { "@version": 1.1, "@protected": true, - "ddaRegistry": "https://docs.igrant.io/docs/data-exchange-agreements/#", + "dexaRegistry": "https://docs.igrant.io/docs/data-exchange-agreements/#", + "permissionVocab": "https://docs.igrant.io/schema/permission/v1.0/#", "DataDisclosureAgreement": { - "@id": "ddaRegistry:data-disclosure-agreement", - "@type": "ddaRegistry:data-disclosure-agreement", + "@id": "dexaRegistry:data-disclosure-agreement", + "@type": "dexaRegistry:data-disclosure-agreement", "@context": { "dda": "https://docs.igrant.io/schema/data-disclosure-agreement/v1.0/#", "schema": "https://schema.org/", @@ -141,6 +142,35 @@ "@container": "@list" } } + }, + "Permission": { + "@id": "dexaRegistry:permission", + "@type": "dexaRegistry:permission", + "@context": { + "permissionVocab": "https://docs.igrant.io/schema/permission/v1.0/#", + "mydataDidVocab": "https://docs.igrant.io/schema/mydata-did/v2.0/#", + "@version": 1.1, + "@protected": true, + "personalDataAttributes": { + "@id": "permissionVocab:personalDataAttributes", + "@type": "@id", + "@container": "@list", + "@context": { + "dda": "https://docs.igrant.io/schema/data-disclosure-agreement/v1.0/#", + "permissionVocab": "https://docs.igrant.io/schema/permission/v2.0/#", + "@version": 1.1, + "@protected": true, + "attributeId": "dda:pdAttributeId", + "permission": "permissionVocab:permission" + } + }, + "dataAgreementDid": "mydataDidVocab:dataAgreementDid", + "proofChain": { + "@id": "sec:proof", + "@type": "@id", + "@container": "@list" + } + } } } } \ No newline at end of file diff --git a/interface-specs/data-disclosure-agreement-schema/example.jsonld b/interface-specs/jsonld/example-dda.jsonld similarity index 86% rename from interface-specs/data-disclosure-agreement-schema/example.jsonld rename to interface-specs/jsonld/example-dda.jsonld index d739801..9c85f26 100644 --- a/interface-specs/data-disclosure-agreement-schema/example.jsonld +++ b/interface-specs/jsonld/example-dda.jsonld @@ -1,6 +1,6 @@ { "@context": [ - "https://raw.githubusercontent.com/decentralised-dataexchange/data-exchange-agreements/main/interface-specs/data-disclosure-agreement-schema/data-disclosure-agreement-schema-context.jsonld", + "https://raw.githubusercontent.com/decentralised-dataexchange/data-exchange-agreements/main/interface-specs/jsonld/dexa-context.jsonld", "https://w3id.org/security/v2" ], "@id": "urn:uuid:xyz", @@ -62,10 +62,10 @@ "proofChain": [ { "id": "urn:uuid:proof", - "type": "Assertion", - "created": "1234", - "verificationMethod": "Assertion", - "proofPurpose": "Assertion", + "type": "Ed25519Signature2018", + "created": "2017-06-18T21:19:10Z", + "verificationMethod": "did:key:abc", + "proofPurpose": "authentication", "proofValue": "x.y.z" } ] diff --git a/interface-specs/jsonld/example-permission.jsonld b/interface-specs/jsonld/example-permission.jsonld new file mode 100644 index 0000000..e7ba052 --- /dev/null +++ b/interface-specs/jsonld/example-permission.jsonld @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://raw.githubusercontent.com/decentralised-dataexchange/data-exchange-agreements/main/interface-specs/jsonld/dexa-context.jsonld", + "https://w3id.org/security/v2" + ], + "@id": "urn:uuid:xyz", + "@type": [ + "Permission" + ], + "personalDataAttributes": [ + { + "permission": "allow", + "attributeId": "abc" + } + ], + "dataAgreementDid": "did:mydata:zj53m..", + "proofChain": [ + { + "type": "Ed25519Signature2018", + "created": "2017-06-18T21:19:10Z", + "verificationMethod": "did:key:abc", + "proofPurpose": "authentication", + "proofValue": "x.y.z" + } + ] +} \ No newline at end of file