Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-10-2019 03:56 PM
Error
Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure
apoc.load.json: Caused by: java.lang.RuntimeException: Can't read URL or key {$url} as json: {$url}
Statement
CALL apoc.periodic.iterate("
MATCH (n)
RETURN n as node
", "
CALL apoc.load.json($url + node.someId + '/' + node.someValue) YIELD value as v
// Problem is that some of the URLs will return 404
RETURN v
",
"
params: {
url: "someUrl"
}
")
Description
apoc.periodic.iterate
apoc.load.json
What is the best way to handle an error when calling apoc.load.json
on a 404 during an apoc.periodic.iterate
so that I can skip the bad URLs?
Solved! Go to Solution.
01-10-2019 04:21 PM
There is an option for apoc.load.jsonParams to ignore missing files.
apoc.load.jsonParams('url',{header:value},payloadOrNull, {failOnError:false}) YIELD value - load from JSON URL (e.g. web-api) while sending headers / payload to import JSON as stream of values if the JSON was an array or a single value if it was a map
01-10-2019 04:21 PM
There is an option for apoc.load.jsonParams to ignore missing files.
apoc.load.jsonParams('url',{header:value},payloadOrNull, {failOnError:false}) YIELD value - load from JSON URL (e.g. web-api) while sending headers / payload to import JSON as stream of values if the JSON was an array or a single value if it was a map
01-10-2019 06:08 PM
This is exactly what I needed. Thanks!
07-26-2019 04:27 AM
I am trying to execute following cypher
call apoc.load.jdbc('jdbc:sqlserver://xxxxx','exec tempProcedure[department]') YIELD row with row.displayName as data call apoc.load.json(data) yield value return value
getting below error
Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure apoc.load.json
: Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 0: [{"target_table":"xxx","source_table":"yyy","source_column_name":"abc","weight":1,"Neo_Relationship_Name":"FUNCTIONAL_UNIT_AT"}]
Can anyone help me on this
08-14-2019 12:17 PM
data
needs to be an URL, are you sure it is? Or did you just miss to add the URL prefix to apoc.load.json?
something like:
call apoc.load.jdbc('jdbc:sqlserver://xxxxx','exec tempProcedure[department]')
YIELD row with row.displayName as data
call apoc.load.json("http://host/path?q="+data)
yield value return value
All the sessions of the conference are now available online