Generating a JSON-LD context from an RDF vocabulary
Some time ago I wrote a very simple Python script which takes an RDF vocabulary as input and prints out a JSON-LD context skeleton (compartmentalized, and with some parts like prefixes missing for now). It was nigh necessary for me to do this to keep in sync with a growing vocabulary (especially after the removal @vocab, but it proved generally helpful starter for making compact contexts).
It may be beneficial to document this formally in some way, either in a separate note or as part of the algorithms.
I've put the script as a Gist here: https://gist.github.com/2770154
13 years later...and now we have this: https://github.com/w3c-ccg/vocabulary-template 🎉 😜
It uses @iherman's https://github.com/w3c/yml2vocab to generate vocabulary files (in Turtle, JSON-LD, etc.) as well as a JSON-LD context file which uses @protected and is intended to be used with JSON-LD's upcoming Safe Mode (currently supported in https://github.com/digitalbazaar/jsonld.js
Not quite what you described, but potentially a way toward what you wanted...13 years ago. 😖
More context related tooling is (still) clearly needed.