Skip to content

XML deserialization with prov as default namespace #155

@mf-16

Description

@mf-16

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions