trungdong/prov

XML deserialization with prov as default namespace

mf-16 opened this issue · 0 comments

mf-16 commented

Hello @krischer, I have been told that you are the author of the XML conversion module.
I have encountered an issue when deserializing this document:

<document xmlns="http://www.w3.org/ns/prov#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:prov="http://www.w3.org/ns/prov#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ex="https://example.org/">
  
    
      <entity prov:id="ex:e">
        <value xsi:type="xsd:int">1</value>
      </entity>
    
  
</document>

After deserializing, we get a document that looks like this in PROVN.

entity(ex:e, [None:value=1])

When we try to serialize this document back to XML we get this exception:
ValueError: Invalid tag name 'None:value'

I suppose that there is a mistake somewhere in handling XML qname and mapping it to QualifiedName in method
xml_qname_to_QualifiedName(element, qname_str) during the deserialization.

This issue poses a problem with interoperability between this library and ProvToolbox in Java since the document shown above is serialized in ProvToolbox using version 2.0.4.