Skip to content

roryschadler/whyis_unit_converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Whyis-unit-converter

Installation

  • install whyis using this command

    WHYIS_BRANCH=master bash < <(curl -skL https://raw.githubusercontent.com/tetherless-world/whyis/master/install.sh)
    
  • whyis will be installed in /apps/whyis

  • In your knowledge graph directory, add the unit converter agent to the list of inferencers in your config.py file:

    • Add the following import line: import whyis_unit_converter.unit_converter_agent as converter
    • Add the following line to the inferencers item in the Config dictionary constructor: "UnitConverter": converter.UnitConverter()
  • Reload your knowledge graph to run the inferencer over it

Loading unit definition and translation files

  • To load your own unit definition and translation files, run importconverterdict FILES

  • Your translation files can be in one of the following forms:

    #mapping_file
    http://nanomine.org/ns/CharpyImpactEnergy=http://www.ontology-of-units-of-measure.org/resource/om-2/joulePerSquareMetre
    http://nanomine.org/ns/CrystalizationTemperature=http://www.ontology-of-units-of-measure.org/resource/om-2/kelvin
    
    • Translation file. Used to translate URIs into understandable units. Translations to understandable units are written as below. See defining pint units for more specific information about formatting.
    #translation_file
    http://www.ontology-of-units-of-measure.org/resource/om-2/degreeFahrenheit=5 / 9 * kelvin; offset: 233.15 + 200 / 9
    http://www.ontology-of-units-of-measure.org/resource/om-2/amperePerSquareMetre=ampere / meter ** 2
    http://nanomine.org/ns/unit/kpa=kilopascal
    

Testing

  • To test the unit converter, run unitconvertertest from a pip enabled endpoint.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published