Skip to main content

Unit converter for Whyis

Project description

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.converter 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:

    • URI to unit mapping file. Used to map measurement types to their preferred units, if sio:hasPreferredUnit is not used in your knowledge graph.
    #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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whyis-unit-converter-0.0.1b0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

whyis_unit_converter-0.0.1b0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file whyis-unit-converter-0.0.1b0.tar.gz.

File metadata

  • Download URL: whyis-unit-converter-0.0.1b0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.7.7

File hashes

Hashes for whyis-unit-converter-0.0.1b0.tar.gz
Algorithm Hash digest
SHA256 809f09e7f248aefad70e5ab52f76c3f47cab956aac4f1ba72180874d28c68665
MD5 5ca49e0d0be5b71289afe20a3b747498
BLAKE2b-256 342b31fc0897fbe2162ca0820482a7e049195c16d74011a935c9f1cde59da10a

See more details on using hashes here.

File details

Details for the file whyis_unit_converter-0.0.1b0-py3-none-any.whl.

File metadata

  • Download URL: whyis_unit_converter-0.0.1b0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.7.7

File hashes

Hashes for whyis_unit_converter-0.0.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 26955ac24364b00c1ff705f384106adbad3a3288b585a84d857c7659dccfafa5
MD5 2841a32a9f184610ea77e15ce559d9f7
BLAKE2b-256 8c0d2df7c6306368cd902d412a4c925443733a3c8eed947785237bf9e4d5eb78

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page