eclipse-basyx / basyx-databridge

Eclipse Public License 2.0
11 stars 18 forks source link

Issues with aasserver.json for DotAAS V3 #265

Closed aaronzi closed 1 year ago

aaronzi commented 1 year ago

This is mainly a documentation issue I would say.

BaSyx wiki:

First of all, in the BaSyx wiki for the DataBridge is an example configuration for the AAS Endpoint when using DotAAS V3:

[
    {
        "uniqueId": "ConnectedSubmodel/ConnectedPropertyA",
        "submodelEndpoint": "http://localhost:4001/shells/TestUpdatedDeviceAAS/aas/submodels/ConnectedSubmodel/submodel",
        "idShortPath": "ConnectedPropertyA",
        "api": "DotAAS-V3"
    }
]

Here, the main issue is the submodelEndpoint which should not be the endpoint of the AAS Repository but rather the Submodel Repository.

DataBridge GitHub repository:

Here, an example for the aasserver.json is provided for use with DotAAS V3:

[
    {
        "uniqueId": "ConnectedTestSubmodel/DotAASV3ConformantApiProperty",
        "submodelEndpoint": "http://localhost:4001/submodels/submodelId/submodel",
        "idShortPath": "DotAASV3ConformantApiProperty",
        "api": "DotAAS-V3"
    }
]

This example has the submodelEnpoint almost right. Here, the suffix /submodel has to be removed from the endpoint.

Also, the submodelId has to be base64 URL encoded. @mdanish98 said this was implemented but it definitely does not work as of right now. Personally I would say to not implement this as a feature for the DataBridge but rather let the user encode the ID. this way the user does not have to change the endpoint URL when retrieving it from for example the AAS Web UI or the Submodel Repositories Swagger.

Another issue can be seen in the idShortPath documentation. The AAS V3 spec states that the elements in the path should be dot-separated. This is currently not done by the DataBridge itself. I would also personally not implement this in the DataBridge but also let the user dot-seperate the elements in the path instead of translating "/" to ".". My argument here is the same as with the SubmodelId encoding.

Here is an example aasserver.json configuration for DotAAS V3 that is currently working:

[
    {
        "uniqueId": "ConnectedTestSubmodel/DotAASV3ConformantApiProperty",
        "submodelEndpoint": "http://localhost:4001/submodels/{base64_encoded_submodel_identifier}",
        "idShortPath": "V3ConformantSubmodelElementCollection.DotAASV3ConformantApiProperty",
        "api": "DotAAS-V3"
    }
]
mdanish98 commented 1 year ago

Hi @aaronzi

Thanks for raising this issue.

We will take a deeper look on the documentation part and will correct it.

Regarding the part "Also, the submodelId has to be base64 URL encoded. @mdanish98 said this was implemented but it definitely does not work as of right now." I think there might be some communication gap, as I wrote that "yes, we have to provide the encoded IDs for SM and AAS because DataBridge doesn’t do that currently.". It means that we have to provide the encoded IDs in the configuration because DataBridge does not encode the provided IDs.

aaronzi commented 1 year ago

Ah sorry, I misunderstood you then. Anyway, my point is to keep the implementation as is and just update the documentation. Thank you for taking a look at that.