-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle None namespace and version suffix in conversion #285
base: develop
Are you sure you want to change the base?
Conversation
Created a function that strips the end of the identity when converting to sbol3 in case it ends with the version number (as per the sbol2.3 specification) Added this conversion to all implemented objects Added roundtrip inclusion of sbol2version in the sbol2 identity. Defaults to "1"
@jakebeal @tcmitchell - Just wanted to tag you in this. Are you happy with this? |
also properly determining identities in toplevel objects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to have the GitHub action tests run on it (turn them on in your fork) and needs to have new test cases added that are capable of reproducing the failures in #283 if these changes are not added.
@@ -73,6 +73,10 @@ def _convert_identified(self, obj3: sbol3.Identified, obj2: sbol2.Identified): | |||
obj2.description = self._value_or_property(obj3, obj3.description, 'http://purl.org/dc/terms/description') | |||
obj2.wasDerivedFrom = obj3.derived_from | |||
obj2.wasGeneratedBy = obj3.generated_by | |||
|
|||
# Add version to identity | |||
obj2.identity = obj2.identity + "/" + obj3.sbol2_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's safe to assume that the sbol2_version
property is necessarily set.
Co-authored-by: Jacob Beal <[email protected]>
…into issue_283
dropped python versions 3.7 and 3.8 (reaching EOL by the end of the year) and adding 3.12
as described in issue 283
As mentioned in Issue #283, the current version of the converter doesn't know how to handle identities that end in the version number. You get these in the case of using
sbol2.ConfigOptions.SBOL_COMPLIANT_URIS
asTrue
, so I added a function_sbol3_identity()
to be used whenever converting an identity value from sbol2 to sbol3, and exchanged each case of an sbol3 object being assigned an identity to use that function.The converter also didn't include the version number in the identity when converting back to sbol2, so I included that in
_convert_identified()
. Note that this will default to '1', as per the SBOL 3.1.0 specification, section 10.2, item 3:Another problem I ran into was with
None
namespaces when converting to sbol3, so I added that case to_sbol3_namespace()
.Now, my conversion of a simple document with an example ComponentDefinition should work. The roundtrip will enforce the use of the version at the end of the object's identity though, overriding the option
sbol2.ConfigOptions.SBOL_COMPLIANT_URIS
if it was set toFalse