Skip to content

Script for extracting units from http://vocab.nerc.ac.uk/collection/P06/current/ to easily add units to the database (This should only be temporarily to demonstrate how units can work)

License

Notifications You must be signed in to change notification settings

shmdoc/unit-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unit parser

This repo contains a small script that extracts units from the units.html file (found on http://vocab.nerc.ac.uk/collection/P06/current/) and converts a selected few (defined at the top of main.py) into a sparql query. This query has been added to the app-shmdoc-osoc-poc repo, which is read into the database using the migrations service.

More units?

When you want more units, you can add the ones you want to the supported_units list in main.py. Be carefull, because sparql queries have a maximum length, which you can reach quite easily. It is also possible to generate a query to add all the units from the units.html file, but this query is of course way too long.

Adding to shmdoc

Once you've created a query for units, you can add it to app-shmdoc-osoc-poc/config/migrations, so the migration service can add them. Here again a warning: Be sure to check your query is not to long.

About

Script for extracting units from http://vocab.nerc.ac.uk/collection/P06/current/ to easily add units to the database (This should only be temporarily to demonstrate how units can work)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published