dgraph
dgraph copied to clipboard
Consider supporting edge naming via value variable
Experience Report
What you wanted to do
Make a direct migration from Neo4J to Dgraph using the JSON structure that is exported via APOC.
What you actually did
uid(from) <val(EDGE)> val(to) .
upsert {
query {
var(func: has(properties)) @filter(eq(type,"relationship") AND NOT has(migrationDone) ){
EDGE as label
properties {
summary as summary
rating as rating
roles as roles
}
start {
ID as id
}
end {
endID as id
}
summaryMe as sum(val(summary))
ratingMe as sum(val(rating))
rolesMe as sum(val(roles))
}
from(func: eq(id, val(ID) )) @filter(NOT eq(type,"relationship") AND NOT has(~start) AND NOT has(~end)) {
from as uid
}
to(func: eq(id, val(endID) )) @filter(NOT eq(type,"relationship") AND NOT has(~start) AND NOT has(~end)) {
to as uid
}
}
mutation {
set {
uid(from) <migrationDone> "True" .
uid(from) <val(EDGE)> val(to) .
# (...)
}
}
}
I believe this is too much to expect from the query language. This should be done through a script instead.
Github issues have been deprecated. This issue has been moved to discuss. You can follow the conversation there and also subscribe to updates by changing your notification preferences.
