INCF/nineml-spec

Refer to units using Reference elements

tclose opened this issue · 0 comments

In the current spec, units and dimensions are implicitly treated as references to elements in the current Document. I think it would be better if they were instead treated as first-class "document-level" types and referred to using a Reference elements (or potentially defined inline) within Quantity elements e.g.

Quantity:
    value:
        SingleValue: 1.5
    units:
        Reference: {name: mV, url: http://nineml.net/catalog/1.1/units.yml}

Not only would this avoid avoid having to write specific code to handle units and dimensions, as general reference handling code can be reused, but it would also avoid having to check that the correct units and dimensions are present in the document as most common ones could be referenced from the catalog (something that is annoying when editing documents by hand).