simphony / simphony-osp

A framework that aims to achieve interoperability between software such as simulation engines, databases and data repositories using a knowledge graph as the common language.
https://simphony.readthedocs.io
Other
16 stars 12 forks source link

Support deserialization of CUDS even when ontologies are not installed #751

Open yoavnash opened 2 years ago

yoavnash commented 2 years ago

Edited A serialized CUDS object may be transferred across to network to a user that may not have the required ontologies installed on their local OSP-core. Therefore, an attempt to deserialize the received data will fail.

Ways to mitigate:

yoavnash commented 2 years ago

@csadorf

csadorf commented 2 years ago

@yoavnash I think the actual issue that @CasperWa brought up, is that it is not possible to deserialize a CUDS container object in case that the ontologies cannot be downloaded at all, e.g., because the server is offline or there is no internet connection.

CasperWA commented 2 years ago

Indeed. In case one does not have the ontology/-ies locally and they are not available online (due to incorrect IRIs or servers being offline or other) then there is no way to serialize the JSON content to Python objects - I believe? It's essentially what you're writing in the OP as well - just with the addition of a complete halt in the serialization process if the information is not available anywhere.

At such a point, the only solution left is to manipulate the JSON object directly, which is far from ideal and defeats the purpose of this package (in my opinion).

kysrpex commented 2 years ago

I think "automatic fetching of ontologies from IRI upon CUDS deserialization" is the wrong approach. Why would one bother downloading the resource from the internet, when the sender has the ontology installed? It makes more sense to send the resource (the ontology) over the network if the receiver does not have it. This is actually issue #438 in my opinion.

CasperWA commented 2 years ago

@kysrpex this is true. The issue here is also that deserialization is not at all possible if there is no ontology access whatsoever.

yoavnash commented 2 years ago

I updated the title and description. I hope it now better describes the main point that was raised. Thanks for the feedback.

yoavnash commented 2 years ago

I think "automatic fetching of ontologies from IRI upon CUDS deserialization" is the wrong approach. Why would one bother downloading the resource from the internet, when the sender has the ontology installed? It makes more sense to send the resource (the ontology) over the network if the receiver does not have it. This is actually issue #438 in my opinion.

Note that CUDS are not necessarily sent via the transport layer. Instead, they could be deserialized using the utility function and sent via other means.