Does dgraph support multiple facets?

Yes, but not the way you suggest it. Facets can only be Edge to Edge, there’s no way to extend it.

If you want to do something more “dynamic” I would recommend creating a nodes structure and relating people to these Nodes.

Facet example:

_:alice <friend> _:bob (since=2006-02-02T13:01:09, close=true, know1=WORK, know2=SCHOOL, know3=FAMILY) .

would return this way:

 "friend|close": true,
 "friend|know1": "WORK",
 "friend|know2": "SCHOOL",
 "friend|know3": "FAMILY"

And if you do:

_:alice <friend> _:bob (since=2006-02-02T13:01:09, close=true, how_we_know_each_other="WORK, SCHOOL, FAMILY") .

would return this way:

 "friend": [
          {
            "friend|close": true,
            "friend|how_we_know_each_other": "WORK, SCHOOL, FAMILY",
            "friend|since": "2006-02-02T13:01:09Z"
          }
        ]
1 Like