Processing Data Files Sequentially

By now your lib/parse-rdf.js is a robust module that can reliably convert RDF content into JSON documents. All that remains is to walk through the Project Gutenberg catalog directory and collect all the JSON documents.

More concretely, we need to do the following:

  1. Traverse down the data/cache/epub directory looking for files ending in rdf.
  2. Read each RDF file.
  3. Run the RDF content through parseRDF.
  4. Collect the JSON serialized objects into a single, bulk file for insertion.

The NoSQL database we’ll be using is Elasticsearch, a document datastore that indexes JSON objects. Soon, in Chapter 6, ​Commanding Databases​, we’ll dive deep into Elasticsearch and how to effectively use it with Node.js. You’ll learn ...

Get Node.js 8 the Right Way now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.