neo4j-contrib / neo4j-apoc-procedures

Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            
https://neo4j.com/labs/apoc
Apache License 2.0
1.7k stars 495 forks source link

Null pointer exception on Edge without a data node #1585

Closed pjljvandelaar closed 3 years ago

pjljvandelaar commented 4 years ago

Original submitted as https://github.com/neo4j/neo4j/issues/12544 Neo4j asked to submit here since is apoc issue.

Version Info

Steps to reproduce

  1. Add a new database.
  2. Install the APOC plug-in
  3. Add to settings
    dbms.security.procedures.unrestricted=apoc.import.* 
    apoc.import.file.enabled=true
  4. Create File "test.graphml" in directory C:\Users\<name>\.Neo4jDesktop\neo4jDatabases\database-<id>\installation-<neo4j-version>\import\ with content
    <?xml version="1.0" encoding="utf-8"?>
    <graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
    <key id="Node.Path" for="node" attr.name="Path" attr.type="string"/>
    <key id="Edge.Path" for="edge" attr.name="Path" attr.type="string"/>
    <graph id="Nexperia" edgedefault="directed">
        <node id="A" labels=":Unit">
            <data key="Path">C:\bright\itecembed\obj\ada\a3_status.ads</data>
        </node>
        <node id="B" labels=":Unit">
            <data key="Path">C:\bright\itecembed\obj\ada\b3_status.ads</data>
        </node>
        <edge source="A" target="B">
            <!-- <data key="Path">C:\bright\itecembed\obj\ada\b3_status.ads</data> -->
        </edge>
    </graph>
    </graphml>
  5. Load file into database with
    CALL apoc.import.graphml("test.graphml",{batchSize: 10000, readLabels: true, storeNodeIds: false, defaultRelationshipType:"RELATED"}) YIELD file, source, format, nodes, relationships, properties, time

    Expected behavior

    File to be loaded. Yed and XmlChecker all agree it is a fine file.

Actual behavior

Null pointer exception is thrown. image

Notes

adding the node (by removing the comment tags) on line 13, results in the expected behaviour.

vga91 commented 3 years ago

Closed via f292b48d9b881add585b8a9c6276c40e2e6938e0