Skip to content

Commit

Permalink
chore: Replaced asset:prop:type with dct type in frontend. Fixed smal…
Browse files Browse the repository at this point in the history
…l code mispellings in EdcAdapterService.
  • Loading branch information
f-zimmer committed Apr 17, 2024
1 parent 6ed34b2 commit 1ad8c04
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private Response sendPostRequest(JsonNode requestBody, List<String> pathSegments
*/
public boolean registerAssetsInitially() {
boolean result;
log.info("Registration of framework agreement policy successful " + (result = createFrameWorkPolicy()));
log.info("Registration of framework agreement policy successful " + (result = createContractPolicy()));
log.info("Registration of DTR Asset successful " + (result &= registerDtrAsset()));
log.info("Registration of ItemStock 2.0.0 submodel successful " + (result &= registerItemStockSubmodel()));
return result;
Expand Down Expand Up @@ -638,7 +638,7 @@ private boolean negotiateForPartnerItemStockSubmodel(MaterialPartnerRelation mpr
if ("urn:samm:io.catenax.item_stock:2.0.0#ItemStock".equals(aasSemantics.get("@id").asText())) {
if (itemStockAssetId.equals(entry.get("edc:id").asText())) {
if (targetCatalogEntry == null) {
if (testFrameworkAgreementConstraint(entry)) {
if (testContractPolicyConstraints(entry)) {
targetCatalogEntry = entry;
} else {
log.error("Contract Negotiation with partner " + partner.getBpnl() + " has " +
Expand Down Expand Up @@ -889,7 +889,6 @@ private boolean initiateDtrTransferForLookupApi(Partner partner, String specific
* authCode under index 1, the endpoint under index 2 and the contractId under index 3.
*
* @param partner the partner
* @param apiMethod the api method
* @return A String array or null, if negotiation or transfer have failed or the authCode did not arrive
*/
public String[] getContractForPartTypeInfoSubmodel(Partner partner) {
Expand All @@ -912,7 +911,7 @@ public String[] getContractForPartTypeInfoSubmodel(Partner partner) {
String idString = semanticId.get("@id").asText();
if ("urn:samm:io.catenax.part_type_information:1.0.0#PartTypeInformation".equals(idString)) {
if (targetCatalogEntry == null) {
if (testFrameworkAgreementConstraint(entry)) {
if (testContractPolicyConstraints(entry)) {
targetCatalogEntry = entry;
} else {
log.error("Contract Negotiation for PartTypeInformation Submodel asset with partner " + partner.getBpnl() + " has " +
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/edc/useCatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const useCatalog = (edcUrl: string | null) => {
? (data['dcat:dataset']?.map((item) => {
return {
assetId: item['@id'],
assetType: item['asset:prop:type'],
assetType: item['dct:type']['@id'],
assetVersion: item['https://w3id.org/catenax/ontology/common#version'],
permission: item['odrl:hasPolicy'] && item['odrl:hasPolicy']['odrl:permission'],
prohibitions: item['odrl:hasPolicy'] && item['odrl:hasPolicy']['odrl:prohibition'],
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/models/types/edc/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export type CatalogPermission = {
export type RawCatalogData = {
'dcat:dataset': {
'@id': string;
'asset:prop:type': string;
'dct:type': {
'@id': string;
}
'https://w3id.org/catenax/ontology/common#version': string;
'odrl:hasPolicy': {
'odrl:permission': CatalogPermission;
Expand Down

0 comments on commit 1ad8c04

Please sign in to comment.