I think the ratel it’s confusing with same prefix of predicates:
Queries showed are equals, changing only predicates aliases.
All predicates have records.
Note that in first image, both predicates pessoa.recebeu_empenho and pessoa.emitiu_nota_fisical has same prefix, then UI ratel aliased predicates to pe.
Thank you for taking your time to write a very detailed bug report.
I’m having difficulties reproducing it on a test dataset though, so need to clarify a few things:
Are you sure you are running the latest Ratel version? Is the bug present on https://play.dgraph.io ?
Are there any non-latin characters in the predicate names you are using? I’ve copy-pasted the names you’ve provided, but maybe your dataset has umlauts or something? (sorry I have no idea what language is that and what alphabet it uses)
If two different predicates are pointing to the same uid Ratel may visualize only one of the relationships. (e.g. <:Alice> <:Bob> and also <:Alice> <:Bob>). Can this be the case in your failing tests?
I’ve tried reproduce the issue and i noticed that maybe it’s issue is not related with colors, but related with limit of showing node and ordering of result.
I think that rename predicates cause reordering of results. Testing a query direct in dgraph (reordering is not applied without/with predicate alias), i think that is ratel related and maybe it’s not a issue, but probably it’s causes confusion.
I have swapped a and b to make sure alphabetic order of predicates is same as your original query. If this new query produces a graph with only green edges we have a confirmation that this is due to ordering of nodes in the response.
I cannot explain why forcing aliases would cause nodes to be returned in a different order, but that behavior would definitely explain the coloring difference, and would not be a bug. Will ask the backend team about this