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

[New Model]: Pi10 new model IdBasedComment #405

Merged
merged 8 commits into from
Oct 24, 2023
Merged

[New Model]: Pi10 new model IdBasedComment #405

merged 8 commits into from
Oct 24, 2023

Conversation

nhaenis
Copy link
Contributor

@nhaenis nhaenis commented Oct 12, 2023

Description

New model for an ID based data exchange of comments belonging to a UUID / entity.

Closes #308

MS2 Criteria

(to be filled out by PR reviewer)

  • the model validates with the SAMM SDS SDK in the version specified in the Readme.md of this repository by the time of the MS2 check (e.g., 'java -jar samm-cli.jar aspect <path-to-aspect-model> validate ). The SAMM CLI is available here and in GitHub
  • use Camel-Case (e.g., "MyModelElement" or "TimeDifferenceGmtId", when in doubt follow https://google.github.io/styleguide/javaguide.html#s5.3-camel-case)
  • the identifiers for all model elements start with a capital letter except for properties
  • the identifier for properties starts with a small letter
  • all model elements at least contain the fields "preferred name" and "description" in English language. The description must be comprehensible. It is not required to write full sentences but style should be consistent over the whole model
  • Property and the referenced Characteristic should not have the same name
  • the versioning in the URN follows semantic versioning, where minor version bumps are backwards compatible and major version bumps are not backwards compatible.
  • use abbreviations only when necessary and if these are sufficiently common
  • avoid redundant prefixes in property names (consider adding properties to an enclosing Entity or even adapt the namespace of the model elements, e.g., instead of having two properties DismantlerId and DismantlerName use an Entity Dismantler with the properties name and id or use a URN like io.catenax.dismantler:0.0.1)
  • fields preferredName and description are not the same
  • preferredName should be human readable and follow normal orthography (e.g., no camel case but normal word separation)
  • name of aspect is singular except if it only has one property which is a Collection, List or Set. In theses cases, the aspect name is plural.
  • units are referenced from the SAMM unit catalog whenever possible
  • use constraints to make known constraints from the use case explicit in the aspect model
  • when relying on external standards, they are referenced through a "see" element
  • all properties with an simple type have an example value
  • metadata.json exists with status "release"
  • generated json schema validates against example json payload
  • file RELEASE_NOTES.md exists and contains entries for proposed model changes
  • all contributors to this model are mentioned in copyright header of model file

MS3 Criteria

(to be filled out by semantic modeling team before merge to main-branch)

  • All required reviewers have approved this PR (see reviewers section)
  • The new aspect (version) will be implemented by at least one data provider
  • The new aspect (version) will be consumed by at least one data consumer
  • There exists valid test data
  • In case of a new (incompatible) major version to an existing version, a migration strategy has been developed
  • The model has at least version '1.0.0'
  • If a previous model exists, model deprecation has been checked for previous model
  • The release date in the Release Note is set to the date of the MS3 approval

@github-actions
Copy link

Validation Report for io.catenax.id_based_comment/1.0.0/IdBasedComment.ttl

Input model is valid

@nhaenis nhaenis changed the title [New Model]: Pi10 new model id based comment [New Model]: Pi10 new model IdBasedComment Oct 12, 2023
:IdBasedComment a samm:Aspect ;
samm:preferredName "Id Based Comment"@en ;
samm:description "Aspect model for an exchange of comment belongig to a entity."@en ;
samm:properties ( :commentId :objectId [ samm:property :author; samm:optional true ] [ samm:property :postedAt; samm:optional true ] [ samm:property :changedAt; samm:optional true ] [ samm:property :commentText; samm:optional true ] [ samm:property :commentType; samm:optional true ] [ samm:property :requestDelete; samm:optional true ] [ samm:property :listOfReferenceDates; samm:optional true ] :objectType ) ;
Copy link
Contributor

@LukasHeimann LukasHeimann Oct 12, 2023

Choose a reason for hiding this comment

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

This model is lacking customer and supplier. However, they are crucial for this model to be sound. Let me elaborate:

A customer-supplier relationship is a directed one: One party is customer, one is supplier. Comments, as well as the Material Demands and Capacity Groups they refer to, have IDs. These IDs are, in their description, explicitly defined to only be unique "within the business relationship between a customer and its supplier". Hence, to uniquely resolve a comment by its commentId, as well as a Material Demand or Capacity Group by an $(objectId, objectType)$ tuple, you need to also know the supplier and the customer.

It is not possible to infer this information from the message header, as the message header only contains information about the sender and the receiver of the message. However, as both customer and supplier can send (create/update/delete) comments, it is not possible to know if the sender of the message is the customer or the supplier. Thus, it is not possible to derive the correct customer-supplier relationship. Hence, we can't uniquely address the comment, material demand or capacity group.

Example: As per our standard, it is valid that two companies $A$ and $B$ are both supplier and customer to each other -- so there are two business partner relationships $(customer, supplier)$: $(A, B)$ and $(B, A)$. In both relationships, a material demand can be created with the same UUID. $B$ creates a Material Demand for $A$ with ID 123, and $A$ creates a Material Demand for $B$ with ID 123. The standard, today, forces us to not throw an error but treat those as separate Material Demands (because the ID must be treated as unique only within the relationship, not globally). Now, A posts a comment on objectId 123. Which Material Demand should receive the comment? A surely is the sender and B the receiver of the message, but from that you can't derive whether the business partner relationship $(A, B)$ or $(B, A)$ is targeted, because $A$ could have commented on the Material Demand where it is supplier, or on the one where it is customer.

I know this is an edge case, but we allow (and must allow) sender-controlled IDs, and the other standards define them as not globally unique (allowing us to fail when we receive a second material demand (or comment/capacity group) with the same UUID but a different business partner relationship), but uniquely valid only within the business partner relationship (forcing us to accept them). Thus, the standards must also deal with this edge case.

Copy link
Contributor

Choose a reason for hiding this comment

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

properties were added as discussed in the architecture meeting today

@github-actions
Copy link

Validation Report for io.catenax.id_based_comment/1.0.0/IdBasedComment.ttl

Input model is valid

@@ -0,0 +1,1123 @@

<!doctype html>
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove completely the 'gen' folder as this will be generated at run time automatically.

:objectId a samm:Property ;
samm:preferredName "Object ID"@en ;
samm:description "The ID of the object to which the comment belongs."@en ;
samm:characteristic :UUIDv4IdTrait ;
Copy link
Contributor

Choose a reason for hiding this comment

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

:customer a samm:Property ;
samm:preferredName "Customer"@en ;
samm:description "The Business Partner Number Legal Entity (BPNL) of the party requesting materials from a supplier."@en ;
samm:characteristic :BPNLTrait ;
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I love it, this would make sense for the other models of DCM as well!


:CommentTextCharacteristic a samm:Characteristic ;
samm:preferredName "Comment Text Characteristic"@en ;
samm:description "A text."@en ;
Copy link
Contributor

Choose a reason for hiding this comment

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

would be great to provide a bit more elaborated description here.

Copy link
Contributor

@agg3fe agg3fe left a comment

Choose a reason for hiding this comment

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

please check my comments

@github-actions
Copy link

Validation Report for io.catenax.id_based_comment/1.0.0/IdBasedComment.ttl

Input model is valid

@nhaenis
Copy link
Contributor Author

nhaenis commented Oct 17, 2023

@agg3fe & @LukasHeimann: model uses shared BPN's + UUID aspect now, fixed description for the text. Ready for review


:IdBasedComment a samm:Aspect ;
samm:preferredName "Id Based Comment"@en ;
samm:description "Aspect model for an exchange of comment belongig to a entity."@en ;
Copy link
Contributor

Choose a reason for hiding this comment

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

typo belongig

@agg3fe
Copy link
Contributor

agg3fe commented Oct 23, 2023

@nhaenis could you please correct a small typo mentioned in my PR comment. then we can do the MS2 today.
Also please change the date in the release notes. you can put today's date in case we do the MS3 also today.

@github-actions
Copy link

Validation Report for io.catenax.id_based_comment/1.0.0/IdBasedComment.ttl

Input model is valid

@agg3fe agg3fe added MS2_Approved Checklist "MS2 Valid Model" is approved. MS3_Approved Checklist "MS3 Release Model" is approved. The associated pull request can be merged to the "main-br labels Oct 23, 2023
@agg3fe agg3fe merged commit f2ad180 into eclipse-tractusx:main Oct 24, 2023
@nhaenis
Copy link
Contributor Author

nhaenis commented Oct 24, 2023

@agg3fe the picture in the HTML in gen folder is not generated correctly. Is there already a bug in SAMM CLI opened for a fix of the visual representations of the aspects when another aspect is added as ext-ref? Locally i have the same issue and need to comment out the lines of the models UUID and BPN (lines 24 to 29 in both BPN aspect and UUID aspect) in order to generate it properly

@agg3fe
Copy link
Contributor

agg3fe commented Oct 25, 2023

@agg3fe the picture in the HTML in gen folder is not generated correctly. Is there already a bug in SAMM CLI opened for a fix of the visual representations of the aspects when another aspect is added as ext-ref? Locally i have the same issue and need to comment out the lines of the models UUID and BPN (lines 24 to 29 in both BPN aspect and UUID aspect) in order to generate it properly

@nhaenis I think there are some issues going on with the SDK and they are working on it. I will have a look into it.

@nhaenis nhaenis deleted the pi10_new_model_id_based_comment branch October 30, 2023 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MS2_Approved Checklist "MS2 Valid Model" is approved. MS3_Approved Checklist "MS3 Release Model" is approved. The associated pull request can be merged to the "main-br
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Model]: IdBasedComment for DCM use case
3 participants