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

bug: Catalog response contains empty Distribution jsonArray object outside of Dataset #1783

Open
suh-rao opened this issue Feb 4, 2025 · 2 comments
Labels
bug Something isn't working triage all new issues awaiting classification

Comments

@suh-rao
Copy link

suh-rao commented Feb 4, 2025

Describe the bug

When Catalog call made to connector version from 0.8.0 then we get offers response in which we get
" http://www.w3.org/ns/dcat#distribution : [ ]" , outside of dataset.

To Reproduce

From 0.7.* connector make a catalog call to 0.8.* connector.
Catalog response looks like below.

{
  "@id": "9f44e306-ad41-4939-97d3-4c3f609d17be",
  "@type": [
    "http://www.w3.org/ns/dcat#Catalog"
  ],
  "http://www.w3.org/ns/dcat#dataset": [
    {
      "@id": "blob-test-asset",
      "@type": [
        "http://www.w3.org/ns/dcat#Dataset"
      ],
      "http://www.w3.org/ns/odrl/2/hasPolicy": [
        {
          "@id": "Y29udHJhY3QtZGVmaW5pdGlvbi1ibG9iLXRlc3QtYWx3YXlzLXRydWU=:YmxvYi10ZXN0LWFzc2V0:Y2IzMGUxOGMtMjg1OS00MWEyLWE3M2YtOTBjNzE5ZTRlYjVm",
          "@type": [
            "http://www.w3.org/ns/odrl/2/Offer"
          ],
          "http://www.w3.org/ns/odrl/2/permission": [
            {
              "http://www.w3.org/ns/odrl/2/action": [
                {
                  "@id": "use"
                }
              ]
            }
          ],
          "http://www.w3.org/ns/odrl/2/prohibition": [],
          "http://www.w3.org/ns/odrl/2/obligation": []
        }
      ],
      "http://www.w3.org/ns/dcat#distribution": [
        {
          "@type": [
            "http://www.w3.org/ns/dcat#Distribution"
          ],
          "http://purl.org/dc/terms/format": [
            {
              "@id": "AzureStorage-PUSH"
            }
          ],
          "http://www.w3.org/ns/dcat#accessService": [
            {
              "@id": "1750127b-a7c9-4b54-94e7-68684d2a247f",
              "@type": [
                "http://www.w3.org/ns/dcat#DataService"
              ],
              "http://www.w3.org/ns/dcat#endpointDescription": [
                {
                  "@value": "dspace:connector"
                }
              ],
              "http://www.w3.org/ns/dcat#endpointUrl": [
                {
                  "@value": "https://connector-quality-xxx/api/v1/dsp"
                }
              ],
              "http://www.w3.org/ns/dcat#endpointURL": [
                {
                  "@value": "https://connector-quality-xxx/api/v1/dsp"
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "http://www.w3.org/ns/dcat#distribution": [],
  "http://www.w3.org/ns/dcat#service": [
    {
      "@id": "1750127b-a7c9-4b54-94e7-68684d2a247f",
      "@type": [
        "http://www.w3.org/ns/dcat#DataService"
      ],
      "http://www.w3.org/ns/dcat#endpointDescription": [
        {
          "@value": "dspace:connector"
        }
      ],
      "http://www.w3.org/ns/dcat#endpointUrl": [
        {
          "@value": "https://connector-quality-xxx/api/v1/dsp"
        }
      ],
      "http://www.w3.org/ns/dcat#endpointURL": [
        {
          "@value": "https://connector-quality-xxx/api/v1/dsp"
        }
      ]
    }
  ],
  "https://w3id.org/dspace/v0.8/participantId": [
    {
      "@value": "BPN1111"
    }
  ],
  "https://w3id.org/edc/v0.0.1/ns/participantId": [
    {
      "@value": "BPN1111"
    }
  ]
}

Expected behavior

This should not be the case as per protocol .

https://docs.internationaldataspaces.org/ids-knowledgebase/dataspace-protocol/catalog/catalog.protocol#id-3.1-ack-catalog

To handle data sovereignty requirement, In our connector we process the catalog response and filter the offers which are not required. TJson process fails because "Distribution" is present outside of "Dataset"
This was working correctly with 0.7.* connector version.

Screenshots/Error Messages

NA

Context Information

Possible Implementation

I guess this is happening because of changes from PR: eclipse-edc/Connector#4301

@suh-rao suh-rao added bug Something isn't working triage all new issues awaiting classification labels Feb 4, 2025
@lgblaumeiser
Copy link
Contributor

Hi @suh-rao , is this the exact structure you have received. I have changed the structure concerning indentation to check for closing brackets, and the structure above is not valid, there are not enough closing brackets. Concerning your description, it seems that the second distribution section is outside of a Dataset, but in the example it is within the Dataset as a second distribution section. The closing brackets just above this marked distribution section also looks incorrect. Could you recheck the input? Thanks!

@suh-rao
Copy link
Author

suh-rao commented Feb 4, 2025

@lgblaumeiser I only copied some part of catalog response + removed sensitive data.
I updated catalog response now.
Issue is " "http://www.w3.org/ns/dcat#distribution": []," which comes outside of Dataset.
This is not as per protocol standard https://docs.internationaldataspaces.org/ids-knowledgebase/dataspace-protocol/catalog/catalog.protocol#id-3.1-ack-catalog

I guess this change in catalog response is happening because of PR: eclipse-edc/Connector#4301

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

2 participants