Skip to content

Commit

Permalink
feat: improves JSON-LD objects (#331)
Browse files Browse the repository at this point in the history
* feat: improves JSON-LD payloads

* chore: fix tests
  • Loading branch information
wolf4ood authored Sep 11, 2024
1 parent 82cc2cd commit 0577dbc
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 76 deletions.
54 changes: 23 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,14 @@ These requirements are formulated as EDC policies:
```json
{
"policy": {
"@type": "http://www.w3.org/ns/odrl/2/Set",
"odrl:obligation": [
"@type": "Set",
"obligation": [
{
"odrl:action": "use",
"odrl:constraint": {
"@type": "LogicalConstraint",
"odrl:leftOperand": "DataAccess.level",
"odrl:operator": {
"@id": "odrl:eq"
},
"odrl:rightOperand": "processing"
"action": "use",
"constraint": {
"leftOperand": "DataAccess.level",
"operator": "eq",
"rightOperand": "processing"
}
}
]
Expand Down Expand Up @@ -378,7 +375,7 @@ similar to this:
```json
{
"@id": "asset-1",
"@type": "http://www.w3.org/ns/dcat#Dataset",
"@type": "dcat:Dataset",
"odrl:hasPolicy": {
"@id": "bWVtYmVyLWFuZC1wY2YtZGVm:YXNzZXQtMQ==:MThhNTgwMzEtNjE3Zi00N2U2LWFlNjMtMTlkZmZlMjA5NDE4",
"@type": "odrl:Offer",
Expand All @@ -390,16 +387,16 @@ similar to this:
},
"odrl:constraint": {
"odrl:leftOperand": {
"@id": "FrameworkCredential.pcf"
"@id": "DataAccess.level"
},
"odrl:operator": {
"@id": "odrl:eq"
},
"odrl:rightOperand": "active"
"odrl:rightOperand": "processing"
}
}
},
"http://www.w3.org/ns/dcat#distribution": [
"dcat:distribution": [
//...
],
"description": "This asset requires Membership to view and negotiate.",
Expand All @@ -412,11 +409,10 @@ service entry should be:

```json
{
"http://www.w3.org/ns/dcat#service": {
"dcat:service": {
// ...
"http://www.w3.org/ns/dcat#endpointUrl": "http://provider-qna-controlplane:8082/api/dsp",
"http://purl.org/dc/terms/terms": "dspace:connector",
"http://purl.org/dc/terms/endpointUrl": "http://provider-qna-controlplane:8082/api/dsp"
"dcat:endpointUrl": "http://provider-qna-controlplane:8082/api/dsp",
"dcat:endpointDescription": "dspace:connector",
// ...
}
}
Expand All @@ -435,9 +431,8 @@ into the `policy.@id` field of the `ControlPlane Management/Initiate Negotiation
"counterPartyId": "{{PROVIDER_ID}}",
"protocol": "dataspace-protocol-http",
"policy": {
"@context": "http://www.w3.org/ns/odrl.jsonld",
"@type": "http://www.w3.org/ns/odrl/2/Offer",
"@id": "bWVtYmVyLWFuZC1wY2YtZGVm:YXNzZXQtMQ==:MThhNTgwMzEtNjE3Zi00N2U2LWFlNjMtMTlkZmZlMjA5NDE4",
"@type": "Offer",
"@id": "bWVtYmVyLWFuZC1wY2YtZGVm:YXNzZXQtMQ==:MThhNTgwMzEtNjE3Zi00N2U2LWFlNjMtMTlkZmZlMjA5NDE4",
//...
```

Expand Down Expand Up @@ -570,17 +565,14 @@ relevant scope string to the access token upon DSP egress. A policy, that requir

```json
{
"@type": "http://www.w3.org/ns/odrl/2/Set",
"odrl:obligation": [
"@type": "Set",
"obligation": [
{
"odrl:action": "use",
"odrl:constraint": {
"@type": "LogicalConstraint",
"odrl:leftOperand": "DataAccess.level",
"odrl:operator": {
"@id": "odrl:eq"
},
"odrl:rightOperand": "processing"
"action": "use",
"constraint": {
"leftOperand": "DataAccess.level",
"operator": "eq",
"rightOperand": "processing"
}
}
]
Expand Down
42 changes: 21 additions & 21 deletions deployment/postman/MVD.postman_collection.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=org.eclipse.edc
version=0.8.2-SNAPSHOT
version=0.10.0-SNAPSHOT

edcGradlePluginsVersion=0.8.2-SNAPSHOT
annotationProcessorVersion=0.8.2-SNAPSHOT
edcGradlePluginsVersion=0.10.0-SNAPSHOT
annotationProcessorVersion=0.10.0-SNAPSHOT
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ format.version = "1.1"
[versions]
assertj = "3.24.2"
awaitility = "4.2.2"
edc = "0.8.2-SNAPSHOT"
edc = "0.10.0-SNAPSHOT"
failsafe = "3.3.2"
jackson = "2.17.2"
jakarta-json = "2.1.3"
Expand Down Expand Up @@ -39,6 +39,7 @@ edc-config-filesystem = { module = "org.eclipse.edc:configuration-filesystem", v
edc-auth-tokenbased = { module = "org.eclipse.edc:auth-tokenbased", version.ref = "edc" }
edc-auth-configuration = { module = "org.eclipse.edc:auth-configuration", version.ref = "edc" }
edc-api-management-config = { module = "org.eclipse.edc:management-api-configuration", version.ref = "edc" }
edc-api-management-jsonld-context = { module = "org.eclipse.edc:management-api-json-ld-context", version.ref = "edc" }
edc-api-version = { module = "org.eclipse.edc:version-api", version.ref = "edc" }
edc-api-management = { module = "org.eclipse.edc:management-api", version.ref = "edc" }
edc-api-management-asset = { module = "org.eclipse.edc:asset-api", version.ref = "edc" }
Expand Down Expand Up @@ -165,7 +166,8 @@ dpf = ["edc-dpf-selector-core", "edc-spi-dataplane-selector", "edc-dpf-selector-

connector = ["edc-boot", "edc-core-connector", "edc-ext-http", "edc-ext-observability", "edc-ext-jsonld"]

controlplane = ["edc-controlplane-core", "edc-config-filesystem", "edc-auth-tokenbased", "edc-auth-configuration", "edc-api-management", "edc-api-management-config","edc-api-management-edr","edc-api-management-dataplaneselector",
controlplane = ["edc-controlplane-core", "edc-config-filesystem", "edc-auth-tokenbased", "edc-auth-configuration", "edc-api-management", "edc-api-management-config",
"edc-api-management-jsonld-context","edc-api-management-edr","edc-api-management-dataplaneselector",
"edc-api-observability", "edc-dsp", "edc-spi-jwt", "edc-ext-http", "edc-controlplane-callback-dispatcher-event", "edc-controlplane-callback-dispatcher-http",
"edc-identity-core-did", "edc-dcp-core", "edc-identity-trust-transform", "edc-api-control-configuration", "edc-lib-transform",
"edc-identity-vc-ldp", "edc-did-web", "edc-lib-jws2020", "edc-core-edrstore", "edc-edr-storereceiver"]
Expand Down
1 change: 1 addition & 0 deletions launchers/catalog-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies {
runtimeOnly(libs.bundles.connector) // base runtime
runtimeOnly(libs.edc.api.management)
runtimeOnly(libs.edc.api.management.config)
runtimeOnly(libs.edc.api.management.jsonld.context)
runtimeOnly(libs.edc.controlplane.core) //default store impls, etc.
runtimeOnly(libs.edc.controlplane.services) // aggregate services
runtimeOnly(libs.edc.dsp) // protocol webhook
Expand Down
1 change: 0 additions & 1 deletion launchers/dataplane/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dependencies {
runtimeOnly(libs.edc.dataplane.selfregistration)
runtimeOnly(libs.edc.dataplane.http)
runtimeOnly(libs.edc.dataplane.http.oauth2)
runtimeOnly(libs.edc.dataplane.api.control)
runtimeOnly(libs.edc.dataplane.api.public)
runtimeOnly(libs.edc.dataplane.api.signaling)
runtimeOnly(libs.edc.dataplane.iam)
Expand Down
29 changes: 11 additions & 18 deletions tests/end2end/src/test/resources/negotiation-request.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
{
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"@type": "https://w3id.org/edc/v0.0.1/ns/ContractRequest",
"@context": [
"https://w3id.org/edc/connector/management/v0.0.1"
],
"@type": "ContractRequest",
"counterPartyAddress": "{{PROVIDER_DSP_URL}}/api/dsp",
"counterPartyId": "{{PROVIDER_ID}}",
"protocol": "dataspace-protocol-http",
"policy": {
"@context": "http://www.w3.org/ns/odrl.jsonld",
"@type": "http://www.w3.org/ns/odrl/2/Offer",
"@type": "Offer",
"@id": "{{OFFER_ID}}",
"assigner": "{{PROVIDER_ID}}",
"permission": [],
"prohibition": [],
"odrl:obligation": {
"odrl:action": {
"@id": "use"
},
"odrl:constraint": {
"odrl:leftOperand": {
"@id": "DataAccess.level"
},
"odrl:operator": {
"@id": "odrl:eq"
},
"odrl:rightOperand": "processing"
"obligation": {
"action": "use",
"constraint": {
"leftOperand": "DataAccess.level",
"operator": "eq",
"rightOperand": "processing"
}
},
"target": "asset-1"
Expand Down

0 comments on commit 0577dbc

Please sign in to comment.