Skip to content

Different representation of relationships in the diagram, openapi schema, and plugin implementation #4

@Fak3

Description

@Fak3

In the doc there is a uml diagram of how a relationship is linked with Entity:
Screenshot_20200113_235529
Which implies that Entity json object has a source json key with a value that contains a Relationship json object, which in turn has target json key with a value that contains only identifying property(ies) of a target Entity. For ex:

{
  "name": "TransportMovement",
  "source": [
    {
      "name": "usedTransportMeans",
      "description": "The means of transport used for this logistics transport movement.",
      "type": "references",
      "minCardinality": 0,
      "maxCardinality": 1,
      "target": {
        "name": "TransportMeans"
      }
    }
  ]
}

Diagram defines 3 possible values of type:
Screenshot_20200114_001622

The openapi schema referenced from the interchange spec is called JSON Schema (which it is not): https://edi3.org/specs/edi3-model-interchange/develop/#json-schema-1. This schema defines standalone Relationship object, not nested under Entity, in contrast to the uml schema given above.

The current model-interchange staruml plugin does something different:

  • nests Relationship under the Entity object which this relationship is sourced from, but call this attribute "Relationship"
  • uses composition/aggregation/associationClassLink/generalization/interfaceRealization/interface as Relationship type, instead of 3 possible types defined in diagram (screenshot above).
  • has both source and target json keys, instead of just target
  • does not have minCardinality/maxCardinality, but instead have cardinality under both source and target json sub-objects.
  • source and target json sub-objects also have property "type": "Entity" and "navigable": true

example:

    "LogisticsLocation": {
        "type": "Entity",
        "name": "LogisticsLocation",
        "isAbstract": false,
        "description": "A logistics related physical location or place.",
        "version": "",
        "status": "",
        "Required": [
            "Unlocode"
        ],
        "Property": [
             ...
        ],
        "Relationship": [
            {
                "name": "PostalTradeAddress",
                "description": "The postal trade address information for this logistics related location.",
                "type": "interface",
                "source": {
                    "name": "LogisticsLocation",
                    "type": "Entity",
                    "cardinality": "",
                    "navigable": true
                },
                "target": {
                    "name": "TradeAddress",
                    "type": "Entity",
                    "cardinality": "0..1",
                    "navigable": true
                }
            }
        ]
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions