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

docs(asset): Add documentation of asset creation on new management API #361

Conversation

saschaisele-zf
Copy link
Contributor

WHAT

Adds a documentation with examples for the new management API.

WHY

With extensive changes to the API and the migration to a new protocol, both the requests and the terminology change significantly.
This documentation aims to alleviate the confusion.

…of assets on the new management api

Signed-off-by: Sascha Isele <[email protected]>
added values table to asset creation, started with terminology entries and expanded assets examples to asset entry examples

Signed-off-by: Sascha Isele <[email protected]>
@ndr-brt ndr-brt self-requested a review May 17, 2023 06:12
@saschaisele-zf saschaisele-zf changed the title feat(docs): add Documentation of asset creation on new management API docs(asset): add Documentation of asset creation on new management API May 17, 2023
@saschaisele-zf saschaisele-zf changed the title docs(asset): add Documentation of asset creation on new management API docs(asset): Add documentation of asset creation on new management API May 17, 2023
Signed-off-by: Sascha Isele <[email protected]>
additionally adjusted the examples lean more towards real use-cases

Signed-off-by: Sascha Isele <[email protected]>
@saschaisele-zf
Copy link
Contributor Author

Still needs some work but it should be enough for a proper review now.
@paullatzelsperger , @ndr-brt , @florianrusch-zf

@saschaisele-zf saschaisele-zf marked this pull request as ready for review May 17, 2023 16:27
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information


## 1. Optional - Local Setup

TODO link to a 0.4.x example setup.
Copy link
Contributor

Choose a reason for hiding this comment

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

When will this be available?


## 2. Terminology

With the migration to a new protocol and with it new specifications, DCAT Catalogs in the context of assets, there is a need to clarify the terminology that is used.
Copy link
Contributor

Choose a reason for hiding this comment

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

Additionally, can we provide links to the new protocol and the specification?

Suggested change
With the migration to a new protocol and with it new specifications, DCAT Catalogs in the context of assets, there is a need to clarify the terminology that is used.
With the migration to the new protocol and with its new specification, DCAT Catalogs in the context of assets, there is a need to clarify the terminology that is used.

Comment on lines +39 to +45
| Key | Description |
|----------|--------------------------------------------------------------------------------------------------------------------------------------|
| @context | JSON-LD context aims to enable the local usage of compact and meaningful names which are later still identifiable in a larger scope. |
| @vocab | The value of `@vocab` is added as prefix to any key consisting of a plain string without any other prefix. |
| edc | `edc` defines a specific prefix for the connector. |
| @id | `@id` contains a distinct identifier enabling global references to this field, also called a Node. |
| @type | Specifies the path to the schema which describes this Node. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| Key | Description |
|----------|--------------------------------------------------------------------------------------------------------------------------------------|
| @context | JSON-LD context aims to enable the local usage of compact and meaningful names which are later still identifiable in a larger scope. |
| @vocab | The value of `@vocab` is added as prefix to any key consisting of a plain string without any other prefix. |
| edc | `edc` defines a specific prefix for the connector. |
| @id | `@id` contains a distinct identifier enabling global references to this field, also called a Node. |
| @type | Specifies the path to the schema which describes this Node. |
| Key | Description |
|------------|--------------------------------------------------------------------------------------------------------------------------------------|
| `@context` | JSON-LD context aims to enable the local usage of compact and meaningful names which are later still identifiable in a larger scope. |
| `@vocab` | The value of `@vocab` is added as prefix to any key consisting of a plain string without any other prefix. |
| `edc` | `edc` defines a specific prefix for the connector. |
| `@id` | `@id` contains a distinct identifier enabling global references to this field, also called a Node. |
| `@type` | Specifies the path to the schema which describes this Node. |

| @context | JSON-LD context aims to enable the local usage of compact and meaningful names which are later still identifiable in a larger scope. |
| @vocab | The value of `@vocab` is added as prefix to any key consisting of a plain string without any other prefix. |
| edc | `edc` defines a specific prefix for the connector. |
| @id | `@id` contains a distinct identifier enabling global references to this field, also called a Node. |
Copy link
Contributor

Choose a reason for hiding this comment

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

field or object?

|----------|--------------------------------------------------------------------------------------------------------------------------------------|
| @context | JSON-LD context aims to enable the local usage of compact and meaningful names which are later still identifiable in a larger scope. |
| @vocab | The value of `@vocab` is added as prefix to any key consisting of a plain string without any other prefix. |
| edc | `edc` defines a specific prefix for the connector. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Whats the purpose of this prefix?

| Key | Description |
|----------|--------------------------------------------------------------------------------------------------------------------------------------|
| @context | JSON-LD context aims to enable the local usage of compact and meaningful names which are later still identifiable in a larger scope. |
| @vocab | The value of `@vocab` is added as prefix to any key consisting of a plain string without any other prefix. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Whats the purpose of this?

Comment on lines +65 to +68
"edc:dataAddress": {
"@type": "edc:dataAddress",
"type": "test-type",
"keyName": "test-key-name"
Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion using a real type of dataAddress would be more beneficial. E.g. HttpData


The asset entry is then sent to the management API of the connector through a POST request.

**CON_DATAMGMT_URL** specifies the URL of the management API.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
**CON_DATAMGMT_URL** specifies the URL of the management API.
**CON_DATAMGMT_URL** specifies the base URL of the connector context, where the management API is available.

"edc:version": "0.2.1",
"contenttype": "application/json"
},
"edc:privateProperties": {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we have here the edc prefix and on the "normale" properties not?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it, because the edc stores everything which is prefixed with edc: separately?

Comment on lines +232 to +233
An example is the `payload` field and its contents.
Here the `payload` contains the name and age of a person.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can it be anything? Because then I wouldn't use the term payload. This sounds like, that I can store the to be transmitted data within this field.

"edc": "https://w3id.org/edc/v0.0.1/ns/"
},
"edc:asset": {
"@type": "edc:asset",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"@type": "edc:asset",
"@type": "Asset",

"@id": "some-asset-id"
},
"edc:dataAddress": {
"@type": "edc:dataAddress",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"@type": "edc:dataAddress",
"@type": "DataAddress",


The asset entry is then sent to the management API of the connector through a POST request.

**CON_DATAMGMT_URL** specifies the URL of the management API.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
**CON_DATAMGMT_URL** specifies the URL of the management API.
**MANAGEMENT_URL** specifies the URL of the management API.

The asset entry is then sent to the management API of the connector through a POST request.

**CON_DATAMGMT_URL** specifies the URL of the management API.
The path `/management/v2` allows access to the functionality of the new management API.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The path `/management/v2` allows access to the functionality of the new management API.
The path `/v2` allows access to the functionality of the new management API.

> Once that is done, the new management API can be reached through `/management`.

```bash
curl -X POST "${CON_DATAMGMT_URL}/management/v2/assets" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
curl -X POST "${CON_DATAMGMT_URL}/management/v2/assets" \
curl -X POST "${MANAGEMENT_URL}/v2/assets" \

as /management should be already part of the MANAGEMENT_URL (and, in fact, it is configurable)

"properties": {
"name": "some-asset-name",
"description": "some description",
"edc:version": "0.2.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

please either namespace all the properties of none of them, unless we'd want/need to add tractusx specific properties, that could be namespaced accordingly

@saschaisele-zf saschaisele-zf deleted the docs/management_api/create_asset branch July 14, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants