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

Backend UI API Wrapper: Refactor AssetDto to be a type-safe UiAsset #459

Closed
5 of 6 tasks
Tracked by #420
richardtreier opened this issue Aug 30, 2023 · 0 comments · Fixed by sovity/edc-ce#512
Closed
5 of 6 tasks
Tracked by #420
Assignees
Labels
kind/enhancement New feature or request
Milestone

Comments

@richardtreier
Copy link
Collaborator

richardtreier commented Aug 30, 2023

Feature

New Asset Structure

For reasons our new Asset JSON-LD will look like this, no longer a flat object, but rather a complex object:

{
    "https://w3id.org/edc/v0.0.1/ns/": "urn:artifact:my-asset",

    "http://purl.org/dc/terms/identifier": "urn:artifact:my-asset",
    "http://purl.org/dc/terms/title": "My Asset",
    "http://purl.org/dc/terms/language": "https://w3id.org/idsa/code/EN",
    "http://purl.org/dc/terms/description": "Lorem Ipsum ...",
    "http://purl.org/dc/terms/creator": {
      "@type": "http://xmlns.com/foaf/0.1/Organization",
      "http://xmlns.com/foaf/0.1/name": "My Organization Name"
    },
    "http://purl.org/dc/terms/publisher": {
      "@type": "http://xmlns.com/foaf/0.1/Organization",
      "http://xmlns.com/foaf/0.1/homepage": "https://data-source.my-org/about"
    },
    "http://purl.org/dc/terms/license": "https://data-source.my-org/license",

    "http://www.w3.org/ns/dcat#version": "1.1",
    "http://www.w3.org/ns/dcat#keyword": ["some", "keywords"],
    "http://www.w3.org/ns/dcat#distribution": {
        "@type": "http://www.w3.org/ns/dcat#Distribution",
        "http://www.w3.org/ns/dcat#mediaType": "application/json"
    },
    "http://www.w3.org/ns/dcat#landingPage": "https://data-source.my-org/docs",

    "https://semantic.sovity.io/dcat-ext#httpDatasourceHintsProxyMethod": "true",
    "https://semantic.sovity.io/dcat-ext#httpDatasourceHintsProxyPath": "true",
    "https://semantic.sovity.io/dcat-ext#httpDatasourceHintsProxyQueryParams": "true",
    "https://semantic.sovity.io/dcat-ext#httpDatasourceHintsProxyBody": "true",
    
    "http://w3id.org/mds#dataCategory": "Infrastructure and Logistics",
    "http://w3id.org/mds#dataSubcategory": "General Information About Planning Of Routes",
    "http://w3id.org/mds#dataModel": "my-data-model-001",
    "http://w3id.org/mds#geoReferenceMethod": "my-geo-reference-method",
    "http://w3id.org/mds#transportMode": "my-geo-reference-method",

    "http://unknown/some-custom-property": "test",
}

From the standpoint that we really don't want to have to deal with the untangling in the UI, we want to add clean type-safe object for assets in our backend and handle the Asset JSON-LD <=> UiAsset mapping in the backend, similar to the policy.

Caveats

In JSON-LD fields like the "keyword" field can either be a string, a string array or if we are really unlucky an object like {"@value": "..."}. We ignore the latter, but support the former two variants.

Tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants