SDM-TIB / SDM-RDFizer

An Efficient RML-Compliant Engine for Knowledge Graph Construction
https://doi.org/10.5281/zenodo.3872103
Apache License 2.0
112 stars 25 forks source link

rdfizer does not create triples when the xml source contains xmlns #81

Closed RichDijk closed 2 years ago

RichDijk commented 2 years ago

Describe the bug rdfizer does not create triples when the xml source contains xmlns xmlns="http://graphml.graphdrawing.org/xmlns"

rmlmapper-java has the same behaviour, see issue

To Reproduce

Read XML source containing xmlns

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
  <!--Created by yEd 3.21.1-->
  <key attr.name="Description" attr.type="string" for="graph" id="d0"/>

No triples are created

remove the xmlns declaration

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
  <!--Created by yEd 3.21.1-->
  <key attr.name="Description" attr.type="string" for="graph" id="d0"/>

triples are created

Desktop (please complete the following information): Running Windows 10 Python 3.9 rdfizer 4.0.5. rdflib 6.1.1.

yedmapping1.rml.zip

eiglesias34 commented 2 years ago

Hello @RichDijK,

First of all, thank you for using the SDM-RDFizer. I determined that the problem was how the XML namespaces are handled in Python. In this case, some default namespaces are already defined within the library, which is why there was an output when "xmlns" was not declared. I updated the code to handle the definition of new namespaces. Please note that I changed the code, not the library. I will update the library when I receive confirmation that the problem was solved on your end.

Thank you again Sincerely, Enrique Iglesias

eiglesias34 commented 2 years ago

Hello @RichDijk,

Since it has been more than a week since there was any activity in this issue I will close it. If the problem persists the issue can be reopened.

Sincerely, Enrique Iglesias