I've spared sometimes to find a reasonable solution for this problem. Unfortunately, the tool that Dimitar hoped will not appear soon (as GML is not what gdal wanted to use for projection) . I'd like to propose my idea:
+ I agree with Prof. Peter, the translation from EPSG GML to WKT is not what SECORE need to concern.
+ However, if we don't support for SECORE to have a feature to resolve in WKT, then it will lead to no georeferenced metadata (here is a problem from PS-2 CRSs http://rasdaman.org/ticket/1457).
In short words, I think CRS extension only can transform from existing CRSs supported by GDAL (e.g: EPSG:4326 - EPSG:32633, but not from user defined CRS, EPSG:4326 - FICTION:4326_upgraded (FICTION:4326_upgraded is a copy of EPSG:4326 with only change a value of angle from UNIT["degree",0.0174532925199433], to UNIT["degree",0.0274532925199433]).
As you can see, gdal already stores the wkt of all the supported EPSG:Crss so we don't need to provide wkt as input parameter. However, if someone can understand and can create/modify an existing CRS, we can assume he can create +proj4 definition for this CRS as well (he should be a geologist and can do like this https://docs.qgis.org/2.2/en/docs/user_manual/working_with_projections/working_with_projections.html#custom-coordinate-reference-system)
so what need to be discussed here is how to allow to add +proj4 manually in SECORE (proj4 is likable as it is short and straightforward), then in Petascope it can just add these parameters to encode().
EPSG:4326
proj4:
"+proj=longlat +datum=WGS84 +no_defs"
WKT:
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",
6378137,298.257223563,AUTHORITY["EPSG","7030"]],
TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9108"]],
AUTHORITY["EPSG","4326"]]
If gdal/geotool or some library can convert GML (validated by GML 3.2.1 schema) to proj4 then we just don't ask user to add the proj4 when he creates/updates definition anymore, but it is of course not what can be happened soon.