adamnagel / qudt-for-domain-tools

Establishing consistent unit identities in a world of whirling chaos
GNU Lesser General Public License v2.1
2 stars 1 forks source link

Use improved script for extracting Modelica units #10

Closed adamnagel closed 10 years ago

adamnagel commented 10 years ago

Tasks

  1. Replace the function ExtractUnitsFromMSL in MSL2OWL.py with code that reads the JSON output of export_modelica_units.py. ExtractUnitsFromMSL must accept the JSON file path as a parameter.
  2. build_ontologies.py should check if this JSON file exists. If not, it should run export_modelica_units.py to generate it.

    Background

Zsolt has provided a Python script, export_modelica_units.py, for extracting units from the Modelica Standard Library by using the Modelica compiler. This will result in higher-quality extraction of the Modelica units by taking into account the inheritance and equality relations between the units.

The function ExtractUnitsFromMSL in MSL2OWL.py should be replaced with code that reads the JSON output of export_modelica_units.py. This code will return a dictionary in the same format that ExtractUnitsFromMSL returns. GenerateOWLIndividualFileContent should be able to be re-used without modifications.

We do not want to re-generate the JSON file every time, because it is very slow, so we will assume that it exists. ExtractUnitsFromMSL must accept the path to the JSON file as a parameter. This parameter replaces the current parameter p_SIUnits, which points to the file SIUnits.mo. We will not be reading SIUnits.mo any more.

adamnagel commented 10 years ago

When this TODO list is complete, we will close and merge the issue.

TODO: