Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-09-2020 06:47 AM
Hi,
In my following code, it is creating Node nodes whichever link is getting BUT I want to create/merge Category nodes if the link[''] value starts with 'Category:' and Node type nodes should be created if link[''] value doesn't start with 'Category:'.
P.S. In this Wikipedia API there is JSON field named as asterisk(*) by default, so don't get confuse with it.
CALL {
MATCH (n:Node { traversed:false })
RETURN n
LIMIT 5
}
CALL apoc.load.json('https://en.wikipedia.org/w/api.php?format=json&action=parse&prop=links&page=' + apoc.text.urlencode(n.name))
YIELD value as result
UNWIND result.parse.links AS link
MERGE (cn:Node {name: link['*']})
ON CREATE SET cn.traversed = false
MERGE (n)-[:Linked]->(cn)
SET n.traversed = true
RETURN 'Total nodes get: ' + count(result)
I have tried several WHERE and FOREACH clauses but these are not working with List type. Please let me know how to do it?
Thanks,
Mustafa
Solved! Go to Solution.
10-09-2020 04:05 PM
10-09-2020 04:05 PM
Take a look at your options here:
10-10-2020 02:42 PM
Hi, You could use an APOC
CALL apoc.do.when(Predicate, SENTENCE) YIELD value
Thanks
All the sessions of the conference are now available online