Fair enough. So we have to do the most obvious, analyze the RDF line by line… And compare with what was actually written.
You have 98 writes with "<category>" predicate. And have 74 predicates with <category.id>
Asking for
search(func: has(category.id))
We found Found 74 nodes
Asking for
search(func: has(brand.id)) {
uid
category {uid expand(_all_)}
}
We found 75 nodes and 74 edges.
In the original RDF you have 98 writes with “tCount” Edge atribute. But in Dgraph has only 74.
_:brand-1102 <category> _:category-23902 (tCount=1877, sCount=9, geo="IN") .
_:brand-1102 <category> _:category-23902 (tCount=6785, sCount=59, geo="US") .
So, what are you doing? you are overwriting the same edge 2 times.
You cannot use the same predicate and the same Child
_:Blank_Node and expects create two children in the same batch.
Actually not even other way, if you make UID to UID, it will have overwrite the same way. Because the relationship “parent to child” is unique. You have to use other predicate tho. One edge can’t have two differents Facets at once.
98 - 24 = 74
See below what you’re repeating. There are 24 overwrites.
_:category-27717 used 2 times
_:category-23079 used 2 times
_:category-22710 used 2 times
_:category-20094 used 2 times
_:category-26162 used 2 times
_:category-17677 used 2 times
_:category-16915 used 2 times
_:category-25931 used 2 times
_:category-19242 used 2 times
_:category-22199 used 2 times
_:category-20906 used 2 times
_:category-17881 used 2 times
_:category-23902 used 2 times
_:category-27719 used 2 times
_:category-23486 used 2 times
_:category-17988 used 2 times
_:category-23922 used 2 times
_:category-19142 used 2 times
_:category-20538 used 2 times
_:category-24427 used 2 times
_:category-22109 used 2 times
_:category-27718 used 2 times
_:category-25310 used 2 times
_:category-22953 used 2 times
Cheers.