I am new to dgraph and don’t have experience in graphQL. Facing problems in creating schema and loading data using the bulk loader.
The schema required is as follows:
Nodes:
label: material
properties: name(string),type(string),number(float/int)
count: approx 2 million
Relationship:
label: parent (material->parent->material) directed
properties: rel_name(string),quantity(int/float)
count: 3 million
I also tried, installing dgraph on local system using docker, and source build. But the port 8080 is not accessing from dgraph-ratel.
Request you to share the schema and data loading steps with syntax.
This depends of some context. Have you exposed the port? are you using a native installation of Docker or Docker in VM? If VM you have to use the IP of the VM.
Your intention is to use GraphQL? You should take a time to learn GraphQL first. There are a ton of tutorials and courses related. Dgraph is covered by all of them. But with extra notations/directives.
There’s no Bulkloader for GraphQL, I mean, you can bulkload an existing Dgraph dataset that came from a GraphQL setup (created on Dgraph only). But Bulkload is Dgraph exclusive, so you have to build the dataset with its structure to be able to use it. No dataset out there is compatible with it.
I am using docker, to download dgraph in my local system.
Reference: https://dgraph.io/docs/deploy/download/
Steps followed for dgraph installation are as follows:
docker pull dgraph/dgraph:v21.03.1
You can test that it worked fine, by running:
docker run -it dgraph/dgraph:v21.03.1 dgraph
3. In one terminal started dgraph zero instance:
docker run -it dgraph/dgraph:v21.03.1 dgraph zero
4. docker run -it dgraph/dgraph:v21.03.0 dgraph bulk -s schema -f nodes.json
Error:
Encrypted input: false; Encrypted output: false
Schema path(schema) does not exist.
The json files are created using the following reference: https://dgraph.io/docs/migration/loading-csv-data/
Schema is the same mentioned in one of the replies.
Please help me to resolve the issue.
Using the schema you shared by changing the following lines:
type Material {
name: String
type: String
number: Float! @id
children: [MaterialProgeny]
parents: [MaterialProgeny]
}
type MaterialProgeny {
id: ID!
parent: Material @hasInverse(field: children)
child: Material @hasInverse(field: parents)
rel_name: String
quantity: Float
}
Error while processing schema file “schema”: rpc error: code = Unknown desc = line 2 column 22: Expected new line after field declaration. Got @
rpc error: code = Unknown desc = line 2 column 22: Expected new line after field declaration. Got @amaster507
Are you sending this via GraphQL Admin endpoint? This schema is GraphQL, you should send it via GQL Admin or via the GraphQL flag. And also there is a trick that you have to do, which consist(for Liveloader or Bulkloader) add a fake DQL schema and them your GQL Schema.
@MichelDiz I am new to dgraph and still exploring it. Apologize, but I didn’t get the solution and how to move forward. The steps which I followed are as follows:
I have gone through the documentation, didn’t find how can we pass the schema file in URL. I think we need support from dgraph team or who have already worked on it.
I have a couple of questions, would be great if you can answer them. I will discuss them with my team and get back to you or contact dgraph team for further assistance:
I want to load 1.5 million nodes and approx 3.5 million relations between them. Nodes contain 24 properties and relation 7 respectively. How much time it will take to load the same in dgraph ??
What are the hardware configuration required with number of server’s and other important details to achieve the same?
Does dgraph support multiple schema’s on same instance? For example: On one instance we want two graph with name graph1 and graph2 as independent schema’s?
Would you like to comment on the performance of aggregation, filter queries?
Please answer the questions, it will help us to come to the conclusion whether we can move forward with dgraph.
I agree with you. I am doing a POC related to graph database. I am not sure how can I contact support team or concerned team from where I can get the answers.
Yea no problem, for visibility and topic-awareness I would just make a new topic with your above questions. - while marking a solution on this thread if this issue is solved by something here.