I am new to neo4j and I am trying to play with it by trying to load an XML file into a map.
I tried the following example posted in APOC User Guide:
call apoc.load.xml("https://raw.githubusercontent.com/neo4j-contrib/neo4j-apoc-procedures/3.4/src/test/resources/xml/books.xml") yield value as catalog
UNWIND catalog._children as book
WITH book.id as id, [attr IN book._children WHERE attr._type IN ['author','title'] | [attr._type, attr._text]] as pairs
CALL apoc.map.fromPairs(pairs) yield value
RETURN id, value
But I am getting the following error:
Neo.ClientError.Procedure.ProcedureNotFound: There is no procedure with the name `apoc.map.fromPairs` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.
I read on the note that "apoc.map.fromPairs" is not a Procedure under "apoc-3.4.0.1" so I tried the following instead. So I tried to convert the statement to:
call apoc.load.xml("https://raw.githubusercontent.com/neo4j-contrib/neo4j-apoc-procedures/3.4/src/test/resources/xml/books.xml") yield value as catalog
UNWIND catalog._children as book
WITH book.id as id, [attr IN book._children WHERE attr._type IN ['author','title'] | [attr._type, attr._text]] as pairs
RETURN apoc.map.fromPairs(pairs)
Which did not work. I got the following error:
Neo.ClientError.Statement.SyntaxError: Unknown function 'apoc.map.fromPairs' (line 4, column 8 (offset: 320))
"RETURN apoc.map.fromPairs(pairs)"
any thought on how I can fix this?
Thanks