Skip to content

Feat/jsonld contracting#416

Merged
tom-rm-meyer-ISST merged 17 commits intoeclipse-tractusx:mainfrom
FraunhoferISST:feat/jsonld-catalog
Jul 9, 2024
Merged

Feat/jsonld contracting#416
tom-rm-meyer-ISST merged 17 commits intoeclipse-tractusx:mainfrom
FraunhoferISST:feat/jsonld-catalog

Conversation

@eschrewe
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread backend/pom.xml Outdated
Copy link
Copy Markdown
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
Copy Markdown
Contributor

Filed IP check at EF.

Copy link
Copy Markdown
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
@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