This is an example repository that shows how you can use CueBlox to validate and build a JSON file from your dispirate data files; validated with referential integrity.
brew tap cueblox/tap
brew install bloxBuild, with no flags, will ensure that the data within the data directory conforms with the schemata.
blox buildCueBlox discovers any field that ends with _id and can validate that the IDs referenced exist on the DataSet. In this example, albums must provide an artist_id, which must exist as an ID(slug) within the artists directory.
You can add --referential-integrity (or -i) to your blox build command to enforce this.