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

leftOperand in the catalog is handled as value and not as id #1321

Closed
matgnt opened this issue May 18, 2024 · 5 comments
Closed

leftOperand in the catalog is handled as value and not as id #1321

matgnt opened this issue May 18, 2024 · 5 comments
Labels
bug Something isn't working triage all new issues awaiting classification

Comments

@matgnt
Copy link

matgnt commented May 18, 2024

Test input for the policy (tractusx-edc 0.7.1)

{
    "@type": "LogicalConstraint",
    "odrl:and": [
        {
            "@type": "Constraint",
            "odrl:leftOperand": "UsagePurpose",
            "odrl:operator": {
                "@id": "odrl:eq"
            },
            "odrl:rightOperand": "cx.core.industrycore:1"
        },
        {
            "@type": "Constraint",
            "odrl:leftOperand": "https://w3id.org/catenax/policy/UsagePurpose",
            "odrl:operator": {
                "@id": "odrl:eq"
            },
            "odrl:rightOperand": "cx.core.industrycore:1"
        },
        {
            "@type": "Constraint",
            "odrl:leftOperand": "cx-policy:UsagePurpose",
            "odrl:operator": {
                "@id": "odrl:eq"
            },
            "odrl:rightOperand": "cx.core.industrycore:1"
        },
        {
            "@type": "Constraint",
            "odrl:leftOperand": {
                "@id": "https://w3id.org/catenax/policy/UsagePurpose"
            },
            "odrl:operator": {
                "@id": "odrl:eq"
            },
            "odrl:rightOperand": "cx.core.industrycore:1"
        },

    ]
}

Result in the catalog is:

   "odrl:hasPolicy": {
    "@id": "ODIyNjgyZGItOWE1Ni00ZTM4LWIzZjAtODJiYTMyYTYwMmZm:YzU5ZmU1YzMtZTRiYi00NmFiLTkxZjItOTAwYWQ4MDY2OTAx:NDFhM2VhYjUtYmI2NC00OWM5LWJlMDgtZTBhM2UxMjMyZTQw",
    "@type": "odrl:Offer",
    "odrl:permission": {
     "odrl:action": {
      "odrl:type": "use"
     },
     "odrl:constraint": {
      "odrl:and": [
       {
        "odrl:leftOperand": "UsagePurpose",
        "odrl:operator": {
         "@id": "odrl:eq"
        },
        "odrl:rightOperand": "cx.core.industrycore:1"
       },
       {
        "odrl:leftOperand": "https://w3id.org/catenax/policy/UsagePurpose",
        "odrl:operator": {
         "@id": "odrl:eq"
        },
        "odrl:rightOperand": "cx.core.industrycore:1"
       },
       {
        "odrl:leftOperand": "cx-policy:UsagePurpose",
        "odrl:operator": {
         "@id": "odrl:eq"
        },
        "odrl:rightOperand": "cx.core.industrycore:1"
       },
       {
        "odrl:leftOperand": "https://w3id.org/catenax/policy/UsagePurpose",
        "odrl:operator": {
         "@id": "odrl:eq"
        },
        "odrl:rightOperand": "cx.core.industrycore:1"
       }
      ]
     }
    },

with the catalog's context:

 "@context": {
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
  "edc": "https://w3id.org/edc/v0.0.1/ns/",
  "tx": "https://w3id.org/tractusx/v0.0.1/ns/",
  "tx-auth": "https://w3id.org/tractusx/auth/",
  "cx-policy": "https://w3id.org/catenax/policy/",
  "dcat": "http://www.w3.org/ns/dcat#",
  "dct": "http://purl.org/dc/terms/",
  "odrl": "http://www.w3.org/ns/odrl/2/",
  "dspace": "https://w3id.org/dspace/v0.8/"
 }

this doesn't produce the expected structure in the expanded version.
The leftOperand is always treated as value instead as an id.

Even the last example, explicitly using @id doesn't result and the expected @id in the catalog output.

One option as a quick fix would be to add the ODRL remote context to the catalog @context, that defines this for the leftOperand.

"http://www.w3.org/ns/odrl.jsonld"

Any thoughts on this?


Matthias Binzer

@matgnt matgnt added bug Something isn't working triage all new issues awaiting classification labels May 18, 2024
@wolf4ood
Copy link
Contributor

Hi @matgnt

thanks for the issue, this has already been notified in upstream EDC here, and fixed.

It will be incorporated in the next EDC version and Tractusx EDC 0.7.2

Thanks

@matgnt
Copy link
Author

matgnt commented May 21, 2024

Thanks @wolf4ood , good to hear! Where do we track the required changes for the next tx-edc release?

@wolf4ood
Copy link
Contributor

All the relevant changes will be in the migration document here and in changelogs EDC and TX-EDC

@matgnt
Copy link
Author

matgnt commented May 21, 2024

ah, maybe this was a misunderstanding. The question was how to track issues that need to go into the next tx-edc release.
Not documentation / migration guide for the user.

@jimmarino
Copy link
Contributor

@matgnt We have been through this before. It's fine to open an issue against this repo, but if it turns out to be an upstream issue (as this one is), please do not continue to use the issue in question for "tracking" or other purposes. As we explained, this burdens committers and duplicates information where it may not be found upstream.

Use the sig-release repository (there's even an EDC label) or another mechanism for your tracking, but please do not continue creating duplicate issues in this repository for those purposes.

Given the above, I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage all new issues awaiting classification
Projects
None yet
Development

No branches or pull requests

3 participants