How to make composit keys in Dgraph

Feels like you have two questions. One about an issue with city “collisions” names and other a question about composite keys. Is it right?

In Dgraph we don’t have the concept of composite keys. But you could try facets to try to simulate that.

About the city names. You could create a tree just for places. A tree with relations. Like “Country => State => Region || province => City => Neighborhood || district => Street => Building || gated community => Block”. A cognitive tree (similar to a knowledge graph). And then relate the person to the last object in the tree.

Through such a custom tree you can create important data that can be easily read(and displayed in graphs). Like “How many people live in NY”. That would be easy to know because using “count” you would have this value already set. Instead of doing an extensive query with aggregations.