Schema Updating

Welcome to the Community @ITM007!

I am going to try to translate what you are asking into a logical question that I can answer.

So you have thousands of nodes without types. Some of these nodes are Employers and some of them are Employees. The Employers have a predicate of employee and the Employees have a predicate of employer

This would look something like this datawise:

  <0x1> <employee> <0x2> .
  <0x2> <employer> <0x1> .
  <0x3> <employee> <0x4> .
  <0x4> <employer> <0x3> .

0x1 and 0x3 would be your Employers and 0x2 and 0x4 would be your Employees

Let me know if this is on track. If so, I will continue to answer the question and show how you can use upserts to do this progmatically.


If that isn’t right, then I am thinking you might have a confusion between types, predicates, and edges.

  • Types: https://dgraph.io/docs/query-language/type-system/
  • Predicate: A property of a data node in a graph database; also a discrete piece of information available to request in a graph database.
  • Edge: A relationship between two data nodes in a graph database.

Understanding how data is stored as Triples might help as well: https://dgraph.io/docs/mutations/triples/

If you could post what data you are working with so far, any schema you have posted, and what results you want, we may be able to answer this question better.

If you are new to Dgraph and want a tutorial to follow using DQL then I would recommend: https://dgraph.io/docs/tutorial-1/

This can cause some confusion at first and if you are struggling to get started figuring this out, then let me point you to: