Code Monkey home page Code Monkey logo

udunits2rdf's Introduction

MMI udunits2rdf tool

Conversion of UDUnits XML files to RDF.

Running the conversion

You will need the sbt tool.

The original XML files are included in this repository. If there is a new version of any of these files:

For example:

$ XML="https://raw.githubusercontent.com/Unidata/UDUNITS-2/master/lib/udunits2-accepted.xml"
$ curl $XML -o src/main/resources/udunits2-accepted.xml

Script scripts/download.sh helps do all downloads with a single command.

Then run the udunits2rdf program to generate the RDF version of the XML files:

$ sbt run

This program reads in configuration parameters from src/main/resources/application.conf.

Noteworthy changes

  • 2014-08-22

    • for each vocab, include only relevant base definitions #9
  • 2014-08-04

    • general code adjustments to simplify execution
    • include metadata
  • 2014-07-30

    • capture base definitions separately
    • more complete conversion, but still needs adjustments
  • 2014-07-13

    • first "new" version based on old "watchdog" code.

udunits2rdf's People

Contributors

carueda avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

graybealski

udunits2rdf's Issues

prefixes are missing

We want the vocabulary for prefixes as well. They aren't units, they are prefixes. I captured them (shown here in n3 form) as

@prefix :        <http://mmisw.org/ont/mmitest/udunits2-prefixes/> .
@prefix u2:      <http://mmisw.org/ont/mmitest/udunits2/> .

:_782a1369 
  a           u2:prefix  ;
  u2:hasValue:    1e24   ;  // they are all numbers, do I need quotes?
  u2:hasName:     :micro  ;
  u2:hasSymbol:  "&#xB5"  ;  // can n3/RDF add an annotation 'MICRO SIGN' (for the comment) ?
  u2:hasSymbol:  "&#x3BC" ;  // can n3/RDF add an annotation 'Greek small letter "mu"' ?
  u2:hasSymbol:  "u"   .

assorted display concerns for udunits vocabularies

Not sure if these minor points can be managed via udunits2rdf, but maybe some can:

  • Can the order of columns be name, type, namesUnit, hasName, hasAlias (then the rest)?
  • Can the right side of the table have a border?

udunits base vocabulary in ORR is empty

http://mmisw.org/orr/#http://mmisw.org/ont/mmitest/udunits2-base only has the classes, none of the actual units

am guessing that's because the unit tags are under <unit-system> tag.

Note also there is a tag, indicating this is a base unit. This is a valuable attribute to capture, IMHO. (Don't know what the property type should be. Perhaps

unit hasBasis "base"

Then, later we could make the units in the other files

unit hasBasis "common" / "derived" / "accepted"

nit: unneeded classes

udunits2-base has unneeded Prefix class, udunits2-prefixes has unneeded Unit and UnitName classes. (Won't bother me if you choose to wontfix this.)

unit names are also presented as aliases

In the presented vocabularies, unit names are also shown in the hasAlias column. This doesn't match the n3 example in the model, in which the name is not an alias.

dimensionless

udunits2-derived.xml contains:

    <unit>
        <dimensionless/>
        <name><singular>radian</singular></name>
        <symbol>rad</symbol>
    </unit>

How should the <dimensionless/> part be translated?

issues from Steering Committee

The Steering Committee raised the following issues, which I will discuss with Julie and split out as needed:

  • There's something odd about mixing both opaque units and transparent names; not what users would expect/understand
  • Unit descriptions are entirely missing (because they are in comments)
  • Table has lots of blanks (because it is showing two types of concept, unit and alias)
  • What's the expectation for usability of these unit URIs in external system? document the answer
  • What is up with the coupling of units to names?

capture difference between symbols and alias symbols

It's doubtful that the difference between symbols and alias symbols carries much importance in UDUNITS. Mostly this seems to reflect whether the symbol is for an alias or for a name; but in at least one place it looks like the alias symbol is just less important. (Or, maybe the alias originally existed but was deprecated, and the symbol remains.)

A fully faithful rendition of the vocabulary should capture this distinction (e.g., by giving the alias symbols a hasRole "alias" property).

I'd call this pretty low priority.

verify uniqueness of names

Steve Emmerson remarked, in the context of an issue with dram:

  1. Each name should unambiguously identify a unit;
  2. Each symbol should unambiguously identify a unit;
  3. Long names (e.g., "avoirdupois_dram") should be supported.

I think there's at least one case where the same name is used in two different places, one of them in the derived vocabulary and one elsewhere. I'm not sure how we dealt with it; this is a reminder to me to find out and confirm it makes sense.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.