-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feat/jsonld contracting #416
Conversation
There was a problem hiding this 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
...main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java
Outdated
Show resolved
Hide resolved
...main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java
Show resolved
Hide resolved
...main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java
Outdated
Show resolved
Hide resolved
...main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/EdcAdapterService.java
Outdated
Show resolved
Hide resolved
...ain/java/org/eclipse/tractusx/puris/backend/common/edc/logic/util/EdcRequestBodyBuilder.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/util/JsonLdUtils.java
Show resolved
Hide resolved
backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/util/JsonLdUtils.java
Outdated
Show resolved
Hide resolved
...t/java/org/eclipse/tractusx/puris/backend/common/edc/logic/service/util/JsonLdUtilsTest.java
Show resolved
Hide resolved
backend/src/main/java/org/eclipse/tractusx/puris/backend/common/edc/logic/util/JsonLdUtils.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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'];
There was a problem hiding this 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.
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: