open-simulation-platform / osp-validator

Ontology-based systems structure validator
Mozilla Public License 2.0
4 stars 1 forks source link

FMU Proxy URI is not recognised as a simulator source #74

Open THEvang opened 4 years ago

THEvang commented 4 years ago

OSP Validator does not recognise FMUs with fmu proxy is source. For instance, <Simulator name="vessel_model" source="fmu-proxy://localhost:9090?guid=b71f76f7-b51e-40d5-affb-f63905622e2b" stepSize="0.05"/> gives the following error message:

Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unsupported URI schema: 'fmu-proxy' in URI: 'fmu-proxy://localhost:9090?guid=b71f76f7-b51e-40d5-affb-f63905622e2b' . Supported schemas are: [file, fmuproxy] at com.opensimulationplatform.systemstructure.util.DefaultOspModelDescriptionLocator.get(DefaultOspModelDescriptionLocator.java:58) at com.opensimulationplatform.cli.Validator.getModelDescriptionErrorMessages(Validator.java:93) at com.opensimulationplatform.cli.Validator.validate(Validator.java:48) at com.opensimulationplatform.cli.Main.main(Main.java:79) Caused by: java.lang.RuntimeException: Unsupported URI schema: 'fmu-proxy' in URI: 'fmu-proxy://localhost:9090?guid=b71f76f7-b51e-40d5-affb-f63905622e2b' . Supported schemas are: [file, fmuproxy]

THEvang commented 4 years ago

I think the issue is here:

https://github.com/open-simulation-platform/osp-validator/blob/3a88f10bb561343ca176df8c246489c1d0b88908/osp-system-structure/src/main/java/com/opensimulationplatform/systemstructure/util/DefaultOspModelDescriptionLocator.java#L30

In the config files I have received, FMU Proxy is spelled fmu-proxy, not fmuproxy.

THEvang commented 4 years ago

The scheme fmu-proxy is used in libcosim's fmu-proxy uri resolver:

https://github.com/open-simulation-platform/libcosim/blob/2c383e418820ff88f6ee2102002aafe56a739499/src/cosim/fmuproxy/fmuproxy_uri_sub_resolver.hpp#L26

THEvang commented 4 years ago

In the above example, there is also the issue of specifying the FMU by GUID and not by name. I don't think the osp-validator is able to find the FMUs modelDescription based on ID. Looks like it uses the name of the FMU.

ljamt commented 2 years ago

@THEvang, I assume this issue can be closed as it's fixed?