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

Issues with adding mediaType to ids:representation (v4.2.5) #13

Open
juliapampus opened this issue Oct 21, 2021 · 4 comments
Open

Issues with adding mediaType to ids:representation (v4.2.5) #13

juliapampus opened this issue Oct 21, 2021 · 4 comments

Comments

@juliapampus
Copy link

Using Infomodel library v4.2.5.

According to the Infomodel, it should be possible to add official IANAMediaTyoes and custom media types to the representation:

ids:MediaType. Removed instances for ids:IANAMediaType.

Media types via ids:mediaType with range ids:IANAMediaType should be used with the corresponding IANA URLs, as these have complete coverage. E.g., for JSON-LD:
"ids:mediaType": {
  "@id":   "https://www.iana.org/assignments/media-types/application/ld+json",
  "@type": "ids:IANAMediaType"
}
For custom media types (ids:CustomMediaType), it is advised to use a recognizable unique identifier.

With the newest library version, the IANAMediaTypeBuilder has been removed. Since the MediaType and CustomMediaType do not inherit from each other and both classes are enums, it is not possible to add other types than the provided json or other. Can you give a hint on how to implement? Perhaps I have missed something.

@tmberthold
Copy link

International-Data-Spaces-Association/InformationModel#516 (comment)

@SebastianOpriel
Copy link
Member

@JohannesLipp We see, that this is still an open issue. Currently data offerings of DSC contain the media type in following structure:

 "ids:mediaType" : {
      "@type" : "ids:IANAMediaType",
      "@id" : "https://w3id.org/idsa/autogen/iANAMediaType/971f7e84-f697-4783-9683-0c6a5a2d45fb",
      "ids:filenameExtension" : "application/json"
    }

See full example here: https://international-data-spaces-association.github.io/DataspaceConnector/Documentation/v6/Messages#resourceupdatemessage

A proper structure is described by Julia above. As far as I seem this shall be possible to archive by simple calling constructor and setting the id as parameter


Am I right? Are you aware of any problems, which might occur in other components when setting the id correctly? @sebplorenz @timwirtz86

Another related issues: International-Data-Spaces-Association/InformationModel#224

@JohannesLipp
Copy link
Member

@SebastianOpriel @juliapampus what is the respective infomodel version for "Infomodel library v4.2.5"?

In short: IMHO @SebastianOpriel suggests a correct solution by passing the IANA URL as id to the respective builder method.

The ids:IANAMediaType hints to the possibility of using pre-defined IANA media types, such as e.g. application/json as listed at IANA at https://www.iana.org/assignments/media-types/.

@SebastianOpriel
Copy link
Member

Currently 4.2.7 is used: https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/blob/1f55002f8063b6af4af2615fbf850c815446f092/pom.xml#L89
Changelog see: https://github.com/International-Data-Spaces-Association/Java-Representation-of-IDS-Information-Model/blob/main/Changelog.md#427---2021-11-03
I am not aware how IAIS is tracking the version. This was also a big confusion in a discussion some time ago. You maybe know responsible contacts for infomodel library better than me.

Thanks for your opinion, we will take that as an request for improvement.

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

No branches or pull requests

4 participants