diff --git a/artifacts/src/main/resources/catalog/example/catalog.json b/artifacts/src/main/resources/catalog/example/catalog.json index d4f101c..4b7cc80 100644 --- a/artifacts/src/main/resources/catalog/example/catalog.json +++ b/artifacts/src/main/resources/catalog/example/catalog.json @@ -30,9 +30,11 @@ "rightOperand": "http://example.org/EU" } ], - "duty": { - "action": "Attribution" - } + "duty": [ + { + "action": "Attribution" + } + ] } ] } diff --git a/artifacts/src/main/resources/context/odrl.jsonld b/artifacts/src/main/resources/context/odrl.jsonld index 60e8590..7aaa476 100644 --- a/artifacts/src/main/resources/context/odrl.jsonld +++ b/artifacts/src/main/resources/context/odrl.jsonld @@ -55,7 +55,8 @@ "Duty": "odrl:Duty", "duty": { "@type": "@id", - "@id": "odrl:duty" + "@id": "odrl:duty", + "@container": "@set" }, "Constraint": "odrl:Constraint", "constraint": { diff --git a/artifacts/src/main/resources/negotiation/contract-schema.json b/artifacts/src/main/resources/negotiation/contract-schema.json index 4019c64..f7a449a 100644 --- a/artifacts/src/main/resources/negotiation/contract-schema.json +++ b/artifacts/src/main/resources/negotiation/contract-schema.json @@ -166,7 +166,10 @@ } }, "duty": { - "$ref": "#/definitions/Duty" + "type": "array", + "items": { + "$ref": "#/definitions/Duty" + } } }, "required": [ diff --git a/artifacts/src/main/resources/negotiation/example/contract-agreement-message-full.json b/artifacts/src/main/resources/negotiation/example/contract-agreement-message-full.json index 053d6e3..a648ccd 100644 --- a/artifacts/src/main/resources/negotiation/example/contract-agreement-message-full.json +++ b/artifacts/src/main/resources/negotiation/example/contract-agreement-message-full.json @@ -71,16 +71,18 @@ "rightOperand": "gold" } ], - "duty": { - "action": "report", - "constraint": [ - { - "leftOperand": "event", - "operator": "gt", - "rightOperand": "use" - } - ] - } + "duty": [ + { + "action": "report", + "constraint": [ + { + "leftOperand": "event", + "operator": "gt", + "rightOperand": "use" + } + ] + } + ] }, { "action": "use", diff --git a/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/PolicySchemaTest.java b/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/PolicySchemaTest.java index 29c7858..a6fc2bf 100644 --- a/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/PolicySchemaTest.java +++ b/artifacts/src/test/java/org/eclipse/dsp/schema/negotiation/PolicySchemaTest.java @@ -54,9 +54,9 @@ void setUp() { "operator": "eq", "rightOperand": "gold" }], - "duty": { + "duty": [{ "action": "report" - } + }] } ] }"""; @@ -75,9 +75,9 @@ void setUp() { "operator": "eq", "rightOperand": "gold" }], - "duty": { + "duty": [{ "action": "report" - } + }] } ] }"""; @@ -96,9 +96,9 @@ void setUp() { "operator": "eq", "rightOperand": "gold" }], - "duty": { + "duty": [{ "action": "report" - } + }] } ] }"""; @@ -117,14 +117,14 @@ void setUp() { "operator": "eq", "rightOperand": "gold" }], - "duty": { + "duty": [{ "action": "report", "constraint": [{ "leftOperand": "event", "operator": "gt", "rightOperand": "use" }] - } + }] } ] }""";