Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-14-2022 06:45 PM
I have data:
upload data :
load csv with headers from "file:///data_latihan.csv" as row
merge(v:Character{name: row.source})
merge(t:Character{name: row.target})
with v, t, row
call{
with v, t, row
with v, t, row
where row.Relasi = 'Mentions'
merge(t)-[:MENTIONS]->(v)
}
call{
with v, t, row
with v, t, row
where row.Relasi = 'Replies_to'
merge(t)-[:REPLIES_TO]->(v)
}
call{
with v, t, row
with v, t, row
where row.Relasi = 'Tweet'
merge(t)-[:TWEET]->(v)
}
call{
with v, t, row
with v, t, row
where row.Relasi = 'MentionsInRetweet'
merge(t)-[:MentionsInRetweet]->(v)
}
call{
with v, t, row
with v, t, row
where row.Relasi = 'Retweet'
merge(t)-[:Retweet]->(v)
}
call graph:
MATCH p=(:Character)-[:TWEET|MENTIONS|REPLIES_TO|MentionsInRetweet|Retweet]-(:Character)
RETURN p limit 100
output :
I have a problem calling graph, filter by ket = "ichsan"
I try like this,
Variable `row` not defined (line 2, column 7 (offset: 95)) "where row.ket = 'ichsan'" ^
08-15-2022 04:28 AM
You first cypher
load csv with headers from "file:///data_latihan.csv" as row
merge(v:Character{name: row.source})
merge(t:Character{name: row.target})
with v, t, row
...
......
.........
reads file:///data_latihan.csv and each row from this file is aliased to variable row and his variable is used in subsequent merge/call statements.
The 2nd cypher statement makes no reference to row and as the first statement is complete it is no longer available in cypher context.
Given 'ichsan' is in your data and from the initial cypher it appears to be associated with nodes which have label :Character. If this is the case then try
I try like this,
MATCH p=(c:Character)-[:TWEET|MENTIONS|REPLIES_TO|MentionsInRetweet|Retweet]-(:Character)
where c.ket = 'ichsan'
RETURN p limit 100
also from a performance perspective if this is a common/frequent query you might want to create an index on :Character(ket);
All the sessions of the conference are now available online