title: How to bulk load data into a dgraph/standalone:graphql container?
body: <p>Assuming I've a db like the quick-start of <a href="https://graphql.dgraph.io/docs/quick-start/" rel="nofollow noreferrer">https://graphql.dgraph.io/docs/quick-start/</a></p>
  
  <p>i.e. </p>
  
  <pre><code>type Product {
      productID: ID!
      name: String @search(by: [term])
      reviews: [Review] @hasInverse(field: about)
  }
  
  type Customer {
      custID: ID!
      name: String @search(by: [hash, regexp])
      reviews: [Review] @hasInverse(field: by)
  }
  
  type Review {
      id: ID!
      about: Product! @hasInverse(field: reviews)
      by: Customer! @hasInverse(field: reviews)
      comment: String @search(by: [fulltext])
      rating: Int @search
  }
  </code></pre>
  
  <p>Now I would like to import millions of entries and therefore would like to use the bulk loader. My dataset is a bug folder full of <code>.json</code> files.</p>
  
  <p>To what I've seen, I should be able to run a command like
  <code>dgraph bulk -f folderOfJsonFiles -s goldendata.schema --map_shards=4 --reduce_shards=2 --http localhost:8000 --zero=localhost:5080</code></p>
  
  <p>But to run my server, I am using the <code>dgraph/standalone:graphql</code> image  ran <code>docker run -v $(pwd):/dgraph -p 9000:9000 -it dgraph/standalone:graphql</code></p>
  
  <p>Now how to start the bulk import ?</p>
  
  <p><strong>1:</strong>
  Should I run the command within the docker container itself (and share the volume (folder) containing all my <code>.json</code> files ) or install dgraph on my host and run the <code>dgraph bulk</code> command from the host ?</p>
  
  <p><strong>2:</strong> What should be the format of the <code>.json</code> files ?</p>
  
  <p><strong>3:</strong> Would the bulk loader support blank nodes (id which are not <code>_:0x1234</code>) ?</p>
  
  <p>[edit]</p>
  
  <ul>
  <li>bulk loader seems not to support graphql schema, the schema should be converted to rdf first. To achieve this, I exported the schema and data right after importing the graphql schema <code>curl 'localhost:8080/admin/export?format=json'</code></li>
  </ul>