This repository is based on Grady Ward's The Moby Lexicon Project
You can re-structure the data by synonyms.php file, or you can implement own logic.
It aims to create a mysql query structure (it also includes in "structured" directory) for having a synonyms database.
30,000 root words, 2.5 million synonyms and related words