Open manulera opened 7 months ago
The differences that you've identified cluster into three distinct categories:
visit_sequence
remaps http://sbols.org/v3#Sequence
, http://sbols.org/v3#elements
, and http://sbols.org/v3#encoding
to their SBOL2 equivalent when it creates the sbol2.Sequence
object.https://identifiers.org/SO:
vs. http://identifiers.org/so/SO:
and http://identifiers.org/biomodels.sbo/SBO:
vs https://identifiers.org/SBO:
: these should be handled by matching and rewriting prefixes since it affects all of the thousands of members of the ontology.sbol3.IUPAC_DNA_ENCODING
and sbol2.SBOL_ENCODING_IUPAC
: these should be handled by conversion tables in the relevant visitor routine, e.g., the encoding_map
table in visit_sequence
at https://github.com/SynBioDex/SBOL-utilities/blob/8a30f7b9fdc0d01b5f1637146e852cf3cc7a1702/sbol_utilities/sbol3_sbol2_conversion.py#L255For the latter two, the place to put them differs between the current wrapped-JavaScript converter and one focused on the new converter.
For the wrapped JavaScript converter, the convert2to3
function has a set of type remappings starting at https://github.com/SynBioDex/SBOL-utilities/blob/8a30f7b9fdc0d01b5f1637146e852cf3cc7a1702/sbol_utilities/conversion.py#L137 . There is a similar set in the convert3to2
function. These are where type remappings can go.
For the Python-native converter in sbol3_sbol2_conversion.py
, the conversion should be done at the visitor for the affected property, such as the encoding_map
table in visit_sequence
at https://github.com/SynBioDex/SBOL-utilities/blob/8a30f7b9fdc0d01b5f1637146e852cf3cc7a1702/sbol_utilities/sbol3_sbol2_conversion.py#L255
I realised this during the COMBINE meeting while working on the converter, and we discussed over video conference with @jakebeal . The value of certain identifiers.org constants differ between SBOL2 and SBOL3.
For example:
It seems the issue only affects the identifiers.org constants. I checked with this script:
@jakebeal do you know where could be a good place in the code to introduce the conversion from one uri to the other?
Below the full lists of constant values that differ. They are only from identifiers.org and http://sbols.org (this one is expected).