Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Policy representation: refinement on action is not parsed correctly #4482

Closed
gkirtzou opened this issue Sep 19, 2024 · 2 comments
Closed

Policy representation: refinement on action is not parsed correctly #4482

gkirtzou opened this issue Sep 19, 2024 · 2 comments
Labels
enhancement New feature or request triage all new issues awaiting classification

Comments

@gkirtzou
Copy link

Bug Report

Describe the Bug

One of the most popular policies that would be used in data spaces is the one that regards payment obligation.
I tried the typical way that payment is represented in ODRL (inspired by Example 20 in the official odrl model page https://www.w3.org/TR/odrl-model/#duty-policy), which is defined as a refinement on the action of "odrl:compensate", but EDC cannot parse it properly and produces an error during policy creation.

Expected Behavior

ECD was expected to parse and store the following policy during policy creation:

{
    "@context": {
        "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
        "edc": "https://w3id.org/edc/v0.0.1/ns/",
        "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
        "dcat": "http://www.w3.org/ns/dcat#",
        "xsd": "http://www.w3.org/2001/XMLSchema#",
        "foaf": "http://xmlns.com/foaf/0.1/",
        "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
        "adms": "http://www.w3.org/ns/adms#",
        "dcmitype": "http://purl.org/dc/dcmitype/",
        "skos": "http://www.w3.org/2004/02/skos/core#",
        "dct": "http://purl.org/dc/terms/",
        "odrl": "http://www.w3.org/ns/odrl/2/",
        "owl": "http://www.w3.org/2002/07/owl#",
        "cc": "http://creativecommons.org/ns#",
        "dalicc": "https://dalicc.net/ns#",
        "dalicclib": "https://dalicc.net/licenselibrary/",
        "osl": "http://opensource.org/licenses/",
        "prov": "http://www.w3.org/ns/prov#",
        "spdx": "http://spdx.org/rdf/terms#",
        "example": "http://www.example.com/"
    },
    "policy": {
        "@type": "odrl:Set",
        "dct:description": {
            "@language": "en",
            "@value":"Payment Once - odrl:compensate"
        },
        "dct:title": {
            "@language": "en",
            "@value": "Payment Once - odrl:compensate"
        },
        "odrl:permission": [
            {
                "@type": "odrl:Permission",
                "odrl:action": {
                    "@id": "odrl:use"
                }
            }
        ],
        "odrl:obligation": [
            {
                "@type": "odrl:Duty",
                "odrl:action":
                {
                    "rdf:value": {
                      "@id": "odrl:compensate"
                    },
                    "odrl:refinement": [
                      {
                        "odrl:leftOperand": {
                            "@id": "odrl:payAmount"
                        },
                        "odrl:operator": {
                            "@id": "odrl:eq"
                        },
                        "odrl:rightOperand": {
                            "@type": "http://www.w3.org/2001/XMLSchema#decimal",
                            "@value": "100.0"
                          },
                        "odrl:unit": "http://dbpedia.org/resource/Euro"
                      }
                    ]
                }
            }
        ],
        "odrl:prohibition": null
    }
}

Observed Behavior

EDC returns the following error during creation:

  [ 
               {
                 "message": "Failed to construct instance: type",
                 "type": "InvalidRequest",
                 "path": null,
                 "invalidValue": null
               },
               {
                  "message": "ARRAY must be org.eclipse.edc.policy.model.Action but was: unknown",
                  "type": "InvalidRequest",
                  "path": null,
                  "invalidValue": null
              }
]

Context Information

Used version EDC v0.8.0

Possible Implementation

I believe the problem lies in the "rdf:value" property.

@github-actions github-actions bot added the triage all new issues awaiting classification label Sep 19, 2024
@jimmarino
Copy link
Contributor

This is not a feature we will implement. The DSP specification profiles ODRL, meaning only a subset of the possible serializations are supported.

The specification group is currently refining its JSON Schemas to explicitly not require conformant implementations to support anything beyond the normative serialization.

An implementation may, of course, support this type of extensibility, but the EDC won't, so I am closing this.

@gkirtzou
Copy link
Author

Thank you for clarifying these issues. Is it possible to point me to the documentation of the DSP specification profiles ODRL and the JSON Schemas from the specification group that the EDC is and will support, so that I can study them and see if and how an equivalent representation of this important policy for our dataspace could be represented within the limitations imposed by the DSP specification profiles ODRL and the EDC implementation?

Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage all new issues awaiting classification
Projects
None yet
Development

No branches or pull requests

2 participants