Converting Ontologies to CSV

From OSF Wiki
Jump to: navigation, search

Sometimes it is useful to be able to manage many ontology specifications in a spreadsheet. CSV is generally acknowledged as the most flexible format for using with spreadsheets. Unfortunately, Protégé does not support saving ontologies in CSV format, and most other tools do not as well.

As one workaround, here are a series of steps that can be followed to create CSV output starting with Protege.

  1. In Protege, save the candidate ontology in RDF/XML format
  2. Open the file in an editor and remove all Named Individuals specifications (generally is found at the bottom of the file)
  3. Post the file to a Web-accessible location; note its URL
  4. Using the EasyRDF converter, load the URL into the online converter and specify RDF/JSON as the output format; save as a file with the *.json extension
  5. Upload the JSON file to the online converter site and convert
  6. Download the resulting file to your local computer
  7. Clean up and make the modifications as appropriate.

There are in fact many online converters and other combinations than what is listed could conceivably work. However, in testing many of them, they were unable to process other formats or had other errors. Starting with RDF in XML format appears to be the most widely supported (even though some options allow going more directly to JSON).