I'm trying to use the Wikipedia academic fields as a JSON object in one of my projects. I couldn't find it in a useable or convertible format so I am looking into the best approach to obtain it.
I came up with 3 approaches:
- Get the data from DBPedia (https://dbpedia.org/data/Outline_of_academic_disciplines.json) but it returns a non-ordered list with no hierarchical level
- Copy-paste the markdown from the Wikipedia page and proceed with a regex/find/replace trickery but it is not as easy as it seemed at first (inconsistencies in the page to deal with across 5900 lines once prettified)
- Go the programmatic way: I import the markdown file and parse it. It feels like I'm doing a computer science exercise (a fun little recursive function) and I would gladly spend time on it if I had some to spare. The part where I go through trial-error to correct all the inconsistencies in the file doesn't look too appealing tho. :-)
I probably will go for the third option if I don't find an easier way. However, as all 3 options would require a good amount of work and I would gladly welcome a better/simpler approach.
Any ideas? Any other source to find wikimedia related data in a suitable format in general and this page in particular?
Thanks