From 31ef859394fd7c40243fa0bc134b44a6bdbd99e9 Mon Sep 17 00:00:00 2001 From: Enrico Risa Date: Mon, 23 Sep 2024 09:20:55 +0200 Subject: [PATCH] chore: management API JSON-LD context improvements (#4485) --- .../document/management-context-v1.jsonld | 29 ++++++++++++------- .../test/e2e/managementapi/TestFunctions.java | 2 +- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/extensions/common/json-ld/src/main/resources/document/management-context-v1.jsonld b/extensions/common/json-ld/src/main/resources/document/management-context-v1.jsonld index e0eb082b4e5..be4720ee959 100644 --- a/extensions/common/json-ld/src/main/resources/document/management-context-v1.jsonld +++ b/extensions/common/json-ld/src/main/resources/document/management-context-v1.jsonld @@ -3,7 +3,15 @@ "@version": 1.1, "edc": "https://w3id.org/edc/v0.0.1/ns/", "Asset": "edc:Asset", - "PolicyDefinition": "edc:PolicyDefinition", + "PolicyDefinition": { + "@id": "edc:PolicyDefinition", + "@context": { + "@import": "http://www.w3.org/ns/odrl.jsonld", + "@propagate": true, + "uid": null, + "type": null + } + }, "DataAddress": { "@id": "edc:DataAddress", "@context": { @@ -13,7 +21,15 @@ }, "ContractDefinition": "edc:ContractDefinition", "Criterion": "edc:Criterion", - "ContractRequest": "edc:ContractRequest", + "ContractRequest": { + "@id": "edc:ContractRequest", + "@context": { + "@import": "http://www.w3.org/ns/odrl.jsonld", + "@propagate": true, + "uid": null, + "type": null + } + }, "QuerySpec": "edc:QuerySpec", "ContractNegotiation": { "@id": "edc:ContractNegotiation", @@ -91,14 +107,7 @@ }, "providerId": "edc:providerId", "policy": { - "@id": "edc:policy", - "@context": [ - "http://www.w3.org/ns/odrl.jsonld", - { - "uid": null, - "type": null - } - ] + "@id": "edc:policy" }, "counterPartyId": "edc:counterPartyId", "state": "edc:state", diff --git a/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/TestFunctions.java b/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/TestFunctions.java index 57c2d0b6fe5..bb3876e9ef5 100644 --- a/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/TestFunctions.java +++ b/system-tests/management-api/management-api-test-runner/src/test/java/org/eclipse/edc/test/e2e/managementapi/TestFunctions.java @@ -319,7 +319,7 @@ private static JsonArrayBuilder createCallbackAddress() { public static JsonObjectBuilder policy(JsonObject permission) { return createObjectBuilder() - .add(TYPE, "http://www.w3.org/ns/odrl/2/Set") + .add(TYPE, "Set") .add("obligation", createArrayBuilder().build()) .add("permission", permission) .add("target", "assetId")