Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The apoc.export.graphml.query export additional unwanted nodes #2890

Closed
vga91 opened this issue May 16, 2022 · 0 comments
Closed

The apoc.export.graphml.query export additional unwanted nodes #2890

vga91 opened this issue May 16, 2022 · 0 comments

Comments

@vga91
Copy link
Collaborator

vga91 commented May 16, 2022

If we want to execute something like this use case,
but via apoc.export.graphml.query instead of apoc.export.graphml.data,
the relationships file's export will add additional unwanted nodes.

Expected Behavior (Mandatory)

Should import only relationships

Actual Behavior (Mandatory)

Import start and end nodes as well

How to Reproduce the Problem

Create a simple rel:

CREATE (:Start {id: 1})-[:REL {foo: 'bar'}]->(:End {id: '1'})

Execute this query:

call apoc.export.graphml.query("MATCH (start:Start)-[rel:REL]->(end:End) RETURN rel", null, {stream: true})
YIELD  data

Note that the data result contains <node...> tags::

"<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key id="labels" for="node" attr.name="labels"/>
<key id="foo" for="edge" attr.name="foo"/>
<key id="label" for="edge" attr.name="label"/>
<graph id="G" edgedefault="directed">
<node id="n14" labels=":Start"><data key="labels">:Start</data><data key="id">1</data></node>
<node id="n15" labels=":End"><data key="labels">:End</data><data key="id">1</data></node>
<edge id="e13" source="n14" target="n15" label="REL"><data key="label">REL</data><data key="foo">bar</data></edge>
</graph>
</graphml>
"

Versions

  • OS: OSX
  • Neo4j: 4.4.0.5
  • Neo4j-Apoc: 4.4.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants