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

Catalog policies don't expand correctly #3636

Closed
ndr-brt opened this issue Nov 21, 2023 · 1 comment
Closed

Catalog policies don't expand correctly #3636

ndr-brt opened this issue Nov 21, 2023 · 1 comment
Labels
bug_report Suspected bugs, awaiting triage triage all new issues awaiting classification

Comments

@ndr-brt
Copy link
Member

ndr-brt commented Nov 21, 2023

Bug Report

Describe the Bug

Currently the Catalog is serialized as:

{
  "@id": "4a1b413c-da01-476e-8686-89152c0fe1c4",
  "@type": "dcat:Catalog",
  "dcat:dataset": [
    {
      "@id": "4cb54e4e-a046-4de5-9b3b-8eb8ed98333a",
      "@type": "dcat:Dataset",
      "odrl:hasPolicy": [
        {
          "@id": "ZGVmaW5pdGlvbi0wMjQ4ZWFjYS1hOTkwLTQwMDEtYmYxZi0xODYwODBlYWRjM2M=:NGNiNTRlNGUtYTA0Ni00ZGU1LTliM2ItOGViOGVkOTgzMzNh:Y2U4NzZkOGQtZTJiYS00NDA3LWI0MGYtZDVkMDQ4MDIxMWRh",
          "@type": "odrl:Set",
          "odrl:permission": [],
          "odrl:prohibition": [],
          "odrl:obligation": [],
          "odrl:target": "4cb54e4e-a046-4de5-9b3b-8eb8ed98333a"
        }
      ],
      "dcat:distribution": [
        {
          "@type": "dcat:Distribution",
          "dct:format": {
            "@id": "HttpProxy"
          },
          "dcat:accessService": "b08ad415-a78e-4497-9bd1-3f3430fadeca"
        }
      ],
      "asset:prop:name": "product description",
      "asset:prop:contenttype": "application/json",
      "asset:prop:id": "4cb54e4e-a046-4de5-9b3b-8eb8ed98333a",
      "edc:id": "4cb54e4e-a046-4de5-9b3b-8eb8ed98333a"
    }
  ],
  "dcat:service": {
    "@id": "b08ad415-a78e-4497-9bd1-3f3430fadeca",
    "@type": "dcat:DataService",
    "dct:terms": "connector",
    "dct:endpointUrl": "http://provider-connector:9194/protocol"
  },
  "edc:participantId": "provider",
  "@context": {
    "dct": "https://purl.org/dc/terms/",
    "edc": "https://w3id.org/edc/v0.0.1/ns/",
    "dcat": "https://www.w3.org/ns/dcat/",
    "odrl": "http://www.w3.org/ns/odrl/2/",
    "dspace": "https://w3id.org/dspace/v0.8/"
  }
}

but this expands as:

[
  {
    "@id": "4a1b413c-da01-476e-8686-89152c0fe1c4",
    "@type": [
      "https://www.w3.org/ns/dcat/Catalog"
    ],
    "https://www.w3.org/ns/dcat/dataset": [
      {
        "@id": "4cb54e4e-a046-4de5-9b3b-8eb8ed98333a",
        "@type": [
          "https://www.w3.org/ns/dcat/Dataset"
        ],
        "asset:prop:contenttype": [
          {
            "@value": "application/json"
          }
        ],
        "asset:prop:id": [
          {
            "@value": "4cb54e4e-a046-4de5-9b3b-8eb8ed98333a"
          }
        ],
        "asset:prop:name": [
          {
            "@value": "product description"
          }
        ],
        "https://www.w3.org/ns/dcat/distribution": [
          {
            "@type": [
              "https://www.w3.org/ns/dcat/Distribution"
            ],
            "https://www.w3.org/ns/dcat/accessService": [
              {
                "@value": "b08ad415-a78e-4497-9bd1-3f3430fadeca"
              }
            ],
            "https://purl.org/dc/terms/format": [
              {
                "@id": "HttpProxy"
              }
            ]
          }
        ],
        "https://w3id.org/edc/v0.0.1/ns/id": [
          {
            "@value": "4cb54e4e-a046-4de5-9b3b-8eb8ed98333a"
          }
        ],
        "http://www.w3.org/ns/odrl/2/hasPolicy": [
          {
            "@id": "ZGVmaW5pdGlvbi0wMjQ4ZWFjYS1hOTkwLTQwMDEtYmYxZi0xODYwODBlYWRjM2M=:NGNiNTRlNGUtYTA0Ni00ZGU1LTliM2ItOGViOGVkOTgzMzNh:Y2U4NzZkOGQtZTJiYS00NDA3LWI0MGYtZDVkMDQ4MDIxMWRh",
            "@type": [
              "http://www.w3.org/ns/odrl/2/Set"
            ],
            "http://www.w3.org/ns/odrl/2/obligation": [],
            "http://www.w3.org/ns/odrl/2/permission": [],
            "http://www.w3.org/ns/odrl/2/prohibition": [],
            "http://www.w3.org/ns/odrl/2/target": [
              {
                "@value": "4cb54e4e-a046-4de5-9b3b-8eb8ed98333a"
              }
            ]
          }
        ]
      }
    ],
    "https://www.w3.org/ns/dcat/service": [
      {
        "@id": "b08ad415-a78e-4497-9bd1-3f3430fadeca",
        "@type": [
          "https://www.w3.org/ns/dcat/DataService"
        ],
        "https://purl.org/dc/terms/endpointUrl": [
          {
            "@value": "http://provider-connector:9194/protocol"
          }
        ],
        "https://purl.org/dc/terms/terms": [
          {
            "@value": "connector"
          }
        ]
      }
    ],
    "https://w3id.org/edc/v0.0.1/ns/participantId": [
      {
        "@value": "provider"
      }
    ]
  }
]

Expected Behavior

the policy target should be expanded this way:

            "http://www.w3.org/ns/odrl/2/target": [
              {
                "@id": "4cb54e4e-a046-4de5-9b3b-8eb8ed98333a"
              }
            ]

because it identifies an entity, and it's not a value

Observed Behavior

ODRL model documents need the odrl.jsonld file to be compacted/expanded correctly

Steps to Reproduce

  • Request a catalog
  • negotiate a contract using the given policy
  • connector respond with 400

Context Information

EDC 0.4.1

Possible Implementation

You already know the root cause of the erroneous state and how to fix it? Feel free to share your thoughts.

@ndr-brt ndr-brt added bug_report Suspected bugs, awaiting triage triage all new issues awaiting classification labels Nov 21, 2023
@ndr-brt
Copy link
Member Author

ndr-brt commented Nov 21, 2023

I was using wrong version, the dataset looks like this and it is correct:

{
  "@id": "24fe907c-98b8-43d0-980e-8d9a72c932d2",
  "@type": "dcat:Dataset",
  "odrl:hasPolicy": {
    "@id": "Y2U0NTdjYmYtNjE1ZC00Nzg4LWFiMTctZjU5ZTgyODRlZTQ1:MjRmZTkwN2MtOThiOC00M2QwLTk4MGUtOGQ5YTcyYzkzMmQy:ZmUzMjE1NzUtMzlmMS00MTQ0LWEzNTktNTQ3YjEwYmI0Mzdh",
    "@type": "odrl:Set",
    "odrl:permission": [],
    "odrl:prohibition": [],
    "odrl:obligation": [],
    "odrl:target": {
      "@id": "24fe907c-98b8-43d0-980e-8d9a72c932d2"
    }
  },
  "dcat:distribution": [
    {
      "@type": "dcat:Distribution",
      "dct:format": {
        "@id": "HttpProxy"
      },
      "dcat:accessService": "e7523139-3726-4903-b4da-60bf35501f2e"
    },
    {
      "@type": "dcat:Distribution",
      "dct:format": {
        "@id": "HttpData"
      },
      "dcat:accessService": "e7523139-3726-4903-b4da-60bf35501f2e"
    },
    {
      "@type": "dcat:Distribution",
      "dct:format": {
        "@id": "Kafka"
      },
      "dcat:accessService": "e7523139-3726-4903-b4da-60bf35501f2e"
    },
    {
      "@type": "dcat:Distribution",
      "dct:format": {
        "@id": "HttpProvision"
      },
      "dcat:accessService": "e7523139-3726-4903-b4da-60bf35501f2e"
    }
  ],
  "description": "description",
  "id": "24fe907c-98b8-43d0-980e-8d9a72c932d2",
  "@context": {
    "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
    "edc": "https://w3id.org/edc/v0.0.1/ns/",
    "dcat": "https://www.w3.org/ns/dcat/",
    "dct": "https://purl.org/dc/terms/",
    "odrl": "http://www.w3.org/ns/odrl/2/",
    "dspace": "https://w3id.org/dspace/v0.8/"
  }
}

@ndr-brt ndr-brt closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug_report Suspected bugs, awaiting triage triage all new issues awaiting classification
Projects
None yet
Development

No branches or pull requests

1 participant