What Dgraph client (and version) are you using?
(put “x” in the box to select)
- Dgo
- PyDgraph
- Dgraph4J
- Dgraph-js
- Dgraph-js-http
- Dgraph.NET
Version: 21.03.0
What version of Dgraph are you using?
[v22.0.2]
What I want to do
Using pydgraph, I want to store a Directed Acyclic Graph in dgraph, where I am storing a predecessor ID to point from one node to its predecessor.
Is there a good way to control the uid:s assigned to my nodes? Preferably I would want to manually set my own uid:s, but as I understand it it is done automatically.
As it stands right now, it seems like I would have to fetch the data of the predecessor node to see its uid. The graphs I am handling can be quite large, so this isn’t really feasible to do.
Side note: Is there a way in pydgraph to define inverse?
I would like for my schema to look like what is defined below
<taskID>: string .
<name>: string @index(exact, term) @lang .
<problemID>: string .
<predID>: [uid] @inverse(field: "succID") .
<succID>: uid @inverse(field: "predID") .
type <Task> {
taskID
name
problemID
predID
succID
}
But then I get the error:
while lexing \n\n : string .\n : string index(exact, term) lang .\n : string .\n : [uid] inverse(field: “succID”) .\n : uid @inverse(field: “predID”) .\n\n type {\n taskID\n name\n problemID\n predID\n succID\n }\n at line 6 column 44: Invalid schema. Unexpected “”
Thanks very much if anyone can help me!