You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a number of use cases where having a map type predicate would simplify our usage of dgraph. A good example is real-world address node, which may have multiple known address strings that refer to that address (e.g. ["32 Heren Gracht, Amsterdam, 1015BA","32, Herengracht, Amsterdam, 1015BA, NL"]). We run the addresses through a parser to extract known features such as number, postcode, country etc. Storing these as separate properties is problematic as it loses the lineage/grouping (which house number goes with which postcode etc in the raw data). A map (or preferably, a set of maps) would allow such nested/grouped structures.
I know this could instead be modelled as child nodes, but that a) makes our logic much more complex, and b) doesnt model the data in a way suitable for client usage patterns. So for now we marshall maps backwards and forwards from strings to achieve this.
As mentioned, can marshal to or from strings, or use child nodes, but both are suboptimal via perfomance overhead and query complexity
Solution proposal
Main complexity would be this will need a mechanism to query fields within maps. Perhaps libraries like https://github.com/elgs/jsonql can be of inspiration for what functionality may be of use here. For MVP just having a map object that i interact with client side would be already a big help.
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Use case
We have a number of use cases where having a map type predicate would simplify our usage of dgraph. A good example is real-world address node, which may have multiple known address strings that refer to that address (e.g. ["32 Heren Gracht, Amsterdam, 1015BA","32, Herengracht, Amsterdam, 1015BA, NL"]). We run the addresses through a parser to extract known features such as number, postcode, country etc. Storing these as separate properties is problematic as it loses the lineage/grouping (which house number goes with which postcode etc in the raw data). A map (or preferably, a set of maps) would allow such nested/grouped structures.
I know this could instead be modelled as child nodes, but that a) makes our logic much more complex, and b) doesnt model the data in a way suitable for client usage patterns. So for now we marshall maps backwards and forwards from strings to achieve this.
Links to Discuss, RFC or previous Issues and PRs
No response
Links to examples and research
https://docs.arcadedb.com/#DataTypes
https://neo4j.com/docs/cypher-manual/current/values-and-types/maps/
Current state
As mentioned, can marshal to or from strings, or use child nodes, but both are suboptimal via perfomance overhead and query complexity
Solution proposal
Main complexity would be this will need a mechanism to query fields within maps. Perhaps libraries like https://github.com/elgs/jsonql can be of inspiration for what functionality may be of use here. For MVP just having a map object that i interact with client side would be already a big help.
Additional Information
No response
The text was updated successfully, but these errors were encountered: