Skip to content
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

Convert2to3 error #210

Closed
Gonza10V opened this issue May 16, 2023 · 2 comments
Closed

Convert2to3 error #210

Gonza10V opened this issue May 16, 2023 · 2 comments
Assignees

Comments

@Gonza10V
Copy link
Contributor

I got a document in SBOL2 I tried to convert it to SBOL3 using the function convert2to3 and it returned me an error.
The 3.0 is a valid displayid.
Here is the error:

ValueError Traceback (most recent call last)
Cell In[7], line 1
----> 1 doc3 = convert2to3(doc2)

File ~/Documents/GitHub/SBOL-utilities/sbol_utilities/conversion.py:105, in convert2to3(sbol2_doc, namespaces)
103 rdf_xml = convert_identities2to3(rdf_xml)
104 doc = sbol3.Document()
--> 105 doc.read_string(rdf_xml, sbol3.RDF_XML)
107 # TODO: remove workaround after conversion errors fixed in SynBioDex/sboljs3#14
108 # add in the missing namespace fields where possible, defaulting otherwise
109 # TODO: add check for non-TopLevel? See SynBioDex/pySBOL3#295
110 needs_namespace = {o for o in doc.objects if o.namespace is None}

File ~/opt/anaconda3/envs/LOICA/lib/python3.9/site-packages/sbol3/document.py:334, in Document.read_string(self, data, file_format)
332 graph = rdflib.Graph()
333 graph.parse(data=data, format=file_format)
--> 334 return self._parse_graph(graph)

File ~/opt/anaconda3/envs/LOICA/lib/python3.9/site-packages/sbol3/document.py:247, in Document._parse_graph(self, graph)
246 def _parse_graph(self, graph) -> None:
--> 247 objects = self._parse_objects(graph)
248 child_objects = self._parse_attributes(objects, graph)
249 self._clean_up_singletons(objects)
...
58 msg += ' A displayId MUST be composed of only alphanumeric'
59 msg += ' or underscore characters and MUST NOT begin with a digit.'
---> 60 raise ValueError(msg)

ValueError: "3.0" is not a valid displayId. A displayId MUST be composed of only alphanumeric or underscore characters and MUST NOT begin with a digit.

@jakebeal
Copy link
Contributor

  1. Is the document valid before conversion?
  2. Can you attach a copy of the document?

@jakebeal jakebeal self-assigned this May 16, 2023
@jakebeal
Copy link
Contributor

Given the lack of response, I'm going to close this as likely no longer relevant. If you want to pursue it further, please answer the questions above and reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants