RakipInitiative / ModelRepository

Joint project of EFSA, Federal Institute For Risk Assessment, DTU and ANSES to create a online model repository.
GNU General Public License v3.0
2 stars 0 forks source link

Feature Request: Support generic resource files #471

Closed schuelet closed 1 year ago

schuelet commented 1 year ago

Currently the Writer only writes files that have a predefined URI into the FSKX archive. This is a contraint of the Combine Archive. The Reader also only loads files it knows (i.e. that are hardcoded) into the workspace. These URI's are predefined in the package FSKML, which is cumbersome to handle and update. Here is an excerpt from the WriterNodeModel.java: image.png

However there are more and more file types that start to appear which need to be also considered. Each time a model creator has a new file type, be it markdown,html, or now ONNX, we would need to go into the Writer/Reader code and add the URI for that. I propose to have a function that generates and retrieves these URI's based on the file extension. Since the URI's don't need to actually resolve to anything, we can just make it up.

public static URI generateURI(String extension)

Both the Writer and Reader could use that for any file-type so we can be sure that at least most resource types are supported in the future.

We probably need to have some exceptions, like .exe or .dll or .sh. Anything that could be executed and potentially harm the system we should not allow.

schuelet commented 1 year ago

implemented. Now every file except those on a blacklist will be accepted by FSK-Lab.