neo4j / apoc

Apache License 2.0
96 stars 28 forks source link

Add an option to apoc.load.xml to add the element prefix in '_prefix' instead of only the local element name in '_type' #535

Open kvegter opened 11 months ago

kvegter commented 11 months ago

Feature description

Add a configuration parameter for including the element namespace '_prefix' as a property besides '_type' and '_children'.

Considered alternatives

There is no neo4j procedure alternative. To solve this we had to use an xpath query to get all the local names for a given namespace. But then we loose the exact information available in the xml. There can be overlap in local names for classes and members (see below). Also this requires two times parsing the same xml document.

How this feature can improve the project?

The reason for this for parsing xml structures which are in this case a dump of classes. For example there is a namespace for classes 'xc:' and for members of those classes 'xm:' for example:

<xs:Book>
  <xm:name>bookname</xm:name>
  <xm:title>a title</xm:title>
<xs:Book>

This is a simple example. The real example has about 2600 different 'xs: elements'

Lojjs commented 11 months ago

Hi @kvegter! APOC core is in maintained by Neo4j engineering but we currently do not add much new functionality to it. As this is a feature request and I know you work at Neo4j, can you instead open a ticket on the Product Request Trello board so that PM can decide if this functionality should be added and how it should be prioritized compared with other features. Thanks in advance, Louise, Neo4j Cypher team