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

import query fails #1

Open
gka opened this issue Mar 22, 2017 · 1 comment
Open

import query fails #1

gka opened this issue Mar 22, 2017 · 1 comment

Comments

@gka
Copy link

gka commented Mar 22, 2017

in the first import step, this query fails:

WITH
'https://docs.google.com/spreadsheets/u/1/d/1Z5Vo5pbvxKJ5XpfALZXvCzW26Cl4we3OaN73K9Ae5Ss/export?format=csv&gid=634968401' AS url,
['LOAN','LOBBIED','SALE','SUPPLIER','SHAREHOLDER','LICENSES','AFFILIATED','TIES','NEGOTIATION','INVOLVED','PARTNER'] AS terms
LOAD CSV WITH HEADERS FROM url AS row

WITH apoc.text.regreplace(toUpper(row.Connection),'\\W+','_') AS type, row, terms
WITH coalesce(head(filter(term IN terms WHERE type CONTAINS term)), type) AS type, row

MERGE (o1:Organization {name:row.`Organization A`})
MERGE (o2:Organization {name:row.`Organization B`})
WITH o1,o2,type,row
CALL apoc.create.relationship(o1,type, {source:row.`Source(s)`, connection:row.Connection},o2) YIELD rel
RETURN type(rel), count(*)
ORDER BY count(*) desc

Error:

Invalid input '(': expected an identifier character, whitespace, '?', '!', '.', node labels, '[', "=~", IN, STARTS, ENDS, CONTAINS, IS, '^', '*', '/', '%', '+', '-', '=', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR, AS, ',', ORDER, SKIP, LIMIT, WHERE, LOAD CSV, START, MATCH, UNWIND, MERGE, CREATE, SET, DELETE, REMOVE, FOREACH, WITH, CALL, RETURN, UNION, ';' or end of input (line 6, column 26 (offset: 325))
"WITH apoc.text.regreplace(toUpper(row.Connection),'\\W+','_') AS type, row, terms"
@jexp
Copy link
Member

jexp commented Mar 22, 2017

You are missing the apoc procedures

Best to use Neo4j 3.1.1 and apoc 3.1.0.4
https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/tag/3.1.0.4

Just copy that jar into your $NEO4J_HOME/plugins directory and restart

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