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

Feat/jsonld contracting #416

Merged

Conversation

eschrewe
Copy link
Contributor

@eschrewe eschrewe commented May 28, 2024

Description

  • added JsonLdUtils service. This service expands contract negotiation messages and catalogs from the control plane

  • updated EdcRequestBodyBuilder and EdcAdapterService to only use exapanded versions of the above mentioned messages

  • solves Usage Policy evaluation currently dependend on expansion of usage policy #401

  • IP check required because of the data in backend/resources/json-ld

  • updated tx-version to 0.7.2

Pre-review checks

Please ensure to do as many of the following checks as possible, before asking for committer review:

Copy link
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the work!

Findings are just small refactorings. I alos checked regarding the update of the NOTICE.md for the IP check. I propose the following. Also I asked via matrix, if I might missed the origin of some of the files.

## Third-Party Content

...

### Remote Contexts

#### cx-policy-v1 ([main](./backend/src/main/java/resources/cx-policy-v1.jsonld), [test](./backend/src/main/java/resources/cx-policy-v1.jsonld))

* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: https://github.com/eclipse-tractusx/tractusx-profiles/blob/main/LICENSE
* Source URL: https://github.com/eclipse-tractusx/tractusx-profiles/blob/main/cx/credentials/schema/context/policy.context.json

#### dspace ([main](./backend/src/main/java/resources/dspace.jsonld), [test](./backend/src/main/java/resources/dspace.jsonld))

* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: https://github.com/International-Data-Spaces-Association/ids-specification/blob/main/LICENSE
* Source URL: https://international-data-spaces-association.github.io/ids-specification/2024-1/common/schema/context.json

#### edc-v1 ([main](./backend/src/main/java/resources/edc-v1.jsonld), [test](./backend/src/main/java/resources/edc-v1.jsonld))

* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: https://github.com/eclipse-tractusx/tractusx-edc/blob/d728d8311196572b0d34cef7be788c7ef06f46e5/LICENSE
* Source URL: https://github.com/eclipse-tractusx/tractusx-edc/blob/d728d8311196572b0d34cef7be788c7ef06f46e5/core/json-ld-core/src/main/resources/document/edc-v1.jsonld

#### odrl ([main](./backend/src/main/java/resources/odrl.jsonld), [test](./backend/src/main/java/resources/odrl.jsonld))

* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: https://www.w3.org/copyright/software-license-2015/
* Source URL: https://www.w3.org/ns/odrl.jsonld

#### tx-auth-v1 ([main](./backend/src/main/java/resources/tx-auth-v1.jsonld), [test](./backend/src/main/java/resources/tx-auth-v1.jsonld))

* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: https://github.com/eclipse-tractusx/tractusx-edc/blob/d728d8311196572b0d34cef7be788c7ef06f46e5/LICENSE
* Source URL: https://github.com/eclipse-tractusx/tractusx-edc/blob/d728d8311196572b0d34cef7be788c7ef06f46e5/core/json-ld-core/src/main/resources/document/tx-auth-v1.jsonld

#### tx-v1 ([main](./backend/src/main/java/resources/tx-v1.jsonld), [test](./backend/src/main/java/resources/tx-v1.jsonld))

* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: https://github.com/eclipse-tractusx/tractusx-edc/blob/d728d8311196572b0d34cef7be788c7ef06f46e5/LICENSE
* Source URL: https://github.com/eclipse-tractusx/tractusx-edc/blob/d728d8311196572b0d34cef7be788c7ef06f46e5/core/json-ld-core/src/main/resources/document/tx-v1.jsonld

Copy link
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

I did some cross-checking:

  • I incorrectly pasted the test related file path for the NOTICE.md
  • We need to increase the EDC version in our README.md
  • The catalog query in the frontend doesn't work anymore

The latter results of different handling of the edc jsonLd which we just bypass to the frontend. Beside that we didn't expand it, also changes in the EDC affect the frontend, which is not needed. We really should in future use a DTO for the Frontend EDC Interfaces. I already handled the changes mentioned below and above so that we can start IP Clearing.

frontend/src/hooks/edc/useCatalog.ts

assetType: item['dct:type']['@id'],

frontend/src/hooks/edc/useCatalog.ts

export type CatalogPermission = {
    'odrl:target': string;
    'odrl:action': {
        '@id': string; #change
    }
    'odrl:constraint': {
        'odrl:leftOperand': { 
            "@id": string; #change
        }; 
        'odrl:operator': {
            '@id': string;
        };
        'odrl:rightOperand': string;
    } | {
        '@type': string,
        'odrl:and': {
            '@type': string,
            'odrl:leftOperand': {
                "@id": string; #change
            };
            'odrl:operator': {
                '@id': string;
            };
            'odrl:rightOperand': string;
        }[]
    };
};

export type RawCatalogData = {
    'dcat:dataset': {
        '@id': string;
        'dct:type': { #change
            '@id': string;
        }
        'https://w3id.org/catenax/ontology/common#version': string;
        'odrl:hasPolicy': {
            'odrl:permission': CatalogPermission;
            'odrl:prohibition': CatalogOperation[];
            'odrl:obligation': CatalogOperation[];
        };
    }[];
};

frontend/src/views/CatalogView.ts

const permissionString = `${constraint['odrl:leftOperand']['@id']} ${getCatalogOperator(constraint['odrl:operator']['@id'])} ${ 

frontend/src/views/CatalogView.ts

const actionString = row.row.permission['odrl:action']['@id'];

@tom-rm-meyer-ISST
Copy link
Contributor

Filed IP check at EF.

Copy link
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Works as a charme! IP check also succeded.

@tom-rm-meyer-ISST tom-rm-meyer-ISST merged commit 570d7cb into eclipse-tractusx:main Jul 9, 2024
12 checks passed
@tom-rm-meyer-ISST tom-rm-meyer-ISST deleted the feat/jsonld-catalog branch July 9, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants