How to merge nodes or avoid Duplicate nodes in Dgraph live loading?

I have 2 json files.
one file contains 2 users say, user1 and user2 skills data
another file contains user1 company data
file 1:

[
  {
    "dgraph.type": "Candidate",
    "uid": "_:user1",
    "userId": "user1",
    "HAS_SKILL": [
      {
        "dgraph.type": "Skill",
        "uid": "_:java",
        "name": "java"
      },
      {
        "dgraph.type": "Skill",
        "uid": "_:c",
        "name": "c"
      }
    ]
  },
  {
    "dgraph.type": "Candidate",
    "uid": "_:user2",
    "userId": "user2",
    "HAS_SKILL": [
      {
        "dgraph.type": "Skill",
        "uid": "_:java",
        "name": "java"
      },
      {
        "dgraph.type": "Skill",
        "uid": "_:c",
        "name": "c"
      }
    ]
  }
]

file 2:

[
  {
    "dgraph.type": "Candidate",
    "uid": "_:user1",
    "userId": "user1",
    "WORKED_IN": [
      {
        "dgraph.type": "Company",
        "uid": "_:ABC",
        "name": "abc"
      }
    ]
  }
]

How to use live loader with these files without creation of duplicates?
How can I merge the skills properly?

Check this out:

Dgraph Live Loader can optionally write the xiduid mapping to a directory specified using the --xidmap flag, which can reused given that live loader completed successfully in the previous run.

https://dgraph.io/docs/deploy/fast-data-loading/live-loader/

@amaster507
what is the difference between the --xidmap and -U “xid” flags.
currently I am loading my data using the below command

dgraph live --files mydata.json --upsertPredicate "xid"

will this cause duplicates?
I havent seen duplicates, they got merged properly when i tried that command.
Is this correct way to use ?
can you brief me what that xid does in the above command?

xidmap creates mapping files so you can use them later.
XID flag records the blank node in the XID field of your nodes.

This upserts the data based on the XID field recorded previously.

No, if your blank nodes are unique.

You should choose one of those procedures. Not both.

and these blank nodes should be consistent in all the files right ,for proper upserting?

“unique” and “consistent,” I think that are synonyms in this context. Right? Or do you mean something else? Patterns and so you can do, it is good to keep things standardized.