Dgraph live loader error: cannot be greater than lease

mutation

#1

When I use dgraph live loader, error appears, can anyone help me? thanks!
I search this forum, but I can’t find any useful solution…

COMMAND:
dgraph live -r example.rdf -s example_schema

ERROR:
Processing example.rdf
Error while mutating Uid: [7766484892885944148] cannot be greater than lease: [20000]
Error while mutating Uid: [7766484892885944148] cannot be greater than lease: [20000]
Error while mutating Uid: [7766484892885944148] cannot be greater than lease: [20000]
Error while mutating Uid: [7766484892885944148] cannot be greater than lease: [20000]
Error while mutating Uid: [7766484892885944148] cannot be greater than lease: [20000]
Error while mutating Uid: [7766484892885944148] cannot be greater than lease: [20000]
Error while mutating Uid: [7766484892885944148] cannot be greater than lease: [20000]
Error while mutating Uid: [7766484892885944148] cannot be greater than lease: [20000]
Error while mutating Uid: [7766484892885944148] cannot be greater than lease: [20000]
Error while mutating Uid: [7766484892885944148] cannot be greater than lease: [20000]

CONTENT in example.rdf ( COPIED FROM docs.dgraph.io) :

<0x6bc818dc89e78754> <0xc3bcc578868b719d> .
<0x6bc818dc89e78754> <0xb294fb8464357b0a> .
<0x6bc818dc89e78754> “awesome class” .
<0xc3bcc578868b719d> “Alice” .
<0xc3bcc578868b719d> “Mars” .
<0xc3bcc578868b719d> <0xb294fb8464357b0a> .
<0xb294fb8464357b0a> “Bob” .

CONTENT in example_schema:
it took me long time to find that the at symbol stop me from posting, so I remove it. I have nothing to say about that…

student: uid reverse count .
name: string index(exact, term) .
planet: string index(exact, term) .
friend: uid reverse count .


(Daniel Mai) #2

The UIDs in your rdf file are very high. Can you replace the UIDs with blank nodes and try again?


#3

Thanks.

I retried with bland nodes. And I found that dgraph take the same blank node in multiple RDFs are different nodes, which is not my expectation. Could you please help me with this? Thanks!

command1: dgraph live -r demo1.rdf -s demo.schema
command2: dgraph live -r demo2.rdf

both demo1.rdf and demo2.rdf have the same blank node “_:alice”, but dgraph take it as TWO nodes!!!

CONTENT in demo1.rdf:
_:alice “Alice” .
_:bob “Bob” .
_:charlie “Charlie” .
_:dave “Dave” .
_:alice _:bob .

CONTENT in demo2.rdf:
_:alice _:charlie .
_:alice _:dave .

If I query with
{
test (func: has(friend)) {
uid
name
friend {
uid
name }
}
}

returns:
{
“data”: {
“test”: [
{
“uid”: “0x11171”,
“name”: “Alice”,
“friend”: [
{
“uid”: “0x13881”,
“name”: “Bob”
}
]
},
{
“uid”: “0x1d4c1”,
“friend”: [
{
“uid”: “0x1fbd1”
},
{
“uid”: “0x222e1”
}
]
}
]
}
}


(Daniel Mai) #4

Blank nodes are not unique across RDF files, so they are each assigned as two uids.

If you want to use UIDs across RDFs, then you’ll need to use UID literals like you had earlier.

You can increase the timestamp leases yourself by using the Zero HTTP endpoint /assignIds?num=100 to get a range of UIDs that you can use in your RDFs. For example, if you start a Zero and then call /assignIds?num=100:

$ curl 'localhost:6080/assignIds?num=100'
{"startId":"1","endId":"100"}

You can use UIDs 1 (0x1) to 100 (0x64) in your RDF file directly.

And if you call it again,

$ curl 'localhost:6080/assignIds?num=100'
{"startId":"101","endId":"200"}

You can now use UIDs 101 (0x65) to 200 (0xc8) in your RDFs.

Doing this will let you avoid the “cannot be greater than lease” error you saw.