Spyderisk / domain-network

Network domain model
Apache License 2.0
1 stars 0 forks source link

DebugMarker assets should be relatable to other assets #175

Open mike1813 opened 3 hours ago

mike1813 commented 3 hours ago

The asset class DebugMarker in the network domain model was introduced to provide a way to debug certain construction patterns.

System modeller already provides one construction pattern debugging diagnostic: when an inferred asset is created, system modeller adds a property core#createdByPattern referring to the domain model construction pattern that created it. However, this is of limited use, because:

Adding a DebugMarker to the CP as an inferred asset overcomes the last point, by providing a created asset with a core#createdByPattern property even if the original CP created no assets.

The other points can then be overcome by including every root node in the 'INS Includes' list for the inferred DebugMarker. The INS Includes lists the roles of assets whose URI should be used to generate a unique URI for the inferred asset. However, hash functions of the matching asset URIs are used in the new URI, so it is not easy to decode the new URI to find out which assets matched the CP and triggered DebugMarker creation.

Adding links from the inferred DebugMarker asset to assets that matched to trigger the CP provides a better solution. It is much easier to find assets that matched and triggered the CP by following links than by comparing hash values. If two CP created one asset, it should be possble to ensure that each will create a distinct DebugMarker asset, each linked to a different set of matched assets.

Propose that the new relationship should be something like debugLink, from a DebugMarker to any core#Asset.

mike1813 commented 3 hours ago

We might also want to make DebugMarker and the proposed debugLink into core model entities.

Debugging diagnostic facilities should be available in any domain model, but currently DebugMarker is defined in this domain model, and so is only available in this domain model.