├── AUTHORS ├── .gitignore ├── COPYRIGHT ├── CITATION.cff ├── src ├── main │ ├── java │ │ └── com │ │ │ └── github │ │ │ └── jqudt │ │ │ ├── onto │ │ │ ├── units │ │ │ │ ├── EnergyUnit.java │ │ │ │ ├── CountingUnit.java │ │ │ │ ├── LengthUnit.java │ │ │ │ ├── AreaUnit.java │ │ │ │ ├── VolumeUnit.java │ │ │ │ ├── TemperatureUnit.java │ │ │ │ ├── MassUnit.java │ │ │ │ └── ConcentrationUnit.java │ │ │ ├── OntoReader.java │ │ │ ├── QUDT.java │ │ │ └── UnitFactory.java │ │ │ ├── Multiplier.java │ │ │ ├── Unit.java │ │ │ ├── Quantity.java │ │ │ └── uo │ │ │ └── UnitOntologyFactory.java │ └── resources │ │ └── onto │ │ ├── ops.ttl │ │ ├── dimension │ │ ├── dtype │ │ └── ops └── test │ └── java │ └── com │ └── github │ └── jqudt │ ├── MultiplierTest.java │ ├── units │ ├── LengthTests.java │ ├── EnergyTests.java │ ├── area │ │ └── SquareAreaTest.java │ ├── concentration │ │ ├── MolarTest.java │ │ ├── MassPerVolumeUnitTest.java │ │ ├── TimeUnitTest.java │ │ └── NanomolarTest.java │ └── temperature │ │ ├── CelsiusTest.java │ │ └── FahrenheitTest.java │ ├── onto │ ├── QUDTTest.java │ ├── OntoReaderTest.java │ └── UnitFactoryTest.java │ ├── QuantityTest.java │ ├── uo │ └── UnitOntologyFactoryTest.java │ └── UnitTest.java ├── .project ├── .github └── workflows │ └── maven.yml ├── lib ├── LICENSE.openrdf-sesame └── LICENSE.slf4j ├── README.md └── pom.xml /AUTHORS: -------------------------------------------------------------------------------- 1 | Peter Ansell 2 | Egon Willighagen 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | pom.xml.versionsBackup 2 | bin/ 3 | target/ 4 | .settings/ 5 | .classpath 6 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | QUDT is a CC-SA-BY project by NASA Ames Research Center and TopQuadrant, Inc. 2 | 3 | License of this Java library: new BSD 4 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: "If you use this software, please cite it as below." 3 | authors: 4 | - family-names: Willighagen 5 | given-names: Egon 6 | orcid: https://orcid.org/0000-0001-7542-0286 7 | - family-names: Ansell 8 | given-names: Peter 9 | title: jQUDT 10 | version: 1.5.1 11 | date-released: 2025-08-15 12 | doi: 10.5281/zenodo.3883587 13 | url: "https://github.com/egonw/jqudt" 14 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/units/EnergyUnit.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto.units; 6 | 7 | import com.github.jqudt.Unit; 8 | import com.github.jqudt.onto.UnitFactory; 9 | 10 | public class EnergyUnit { 11 | 12 | private EnergyUnit() {}; 13 | 14 | public static Unit EV = UnitFactory.getInstance().getUnit("http://qudt.org/vocab/unit#ElectronVolt"); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/units/CountingUnit.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto.units; 6 | 7 | import com.github.jqudt.Unit; 8 | import com.github.jqudt.onto.UnitFactory; 9 | 10 | public class CountingUnit { 11 | 12 | private CountingUnit() {}; 13 | 14 | public static Unit PERCENT = UnitFactory.getInstance().getUnit("http://qudt.org/vocab/unit#Percent"); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/units/LengthUnit.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto.units; 6 | 7 | import com.github.jqudt.Unit; 8 | import com.github.jqudt.onto.UnitFactory; 9 | 10 | public class LengthUnit { 11 | 12 | private LengthUnit() {}; 13 | 14 | public static Unit NM = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Nanometer"); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/MultiplierTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | public class MultiplierTest { 11 | 12 | @Test 13 | public void testConstructorNullUnit() { 14 | Multiplier multiplier = new Multiplier(0.1, 0.2); 15 | Assert.assertEquals(0.1, multiplier.getOffset(), 0.01); 16 | Assert.assertEquals(0.2, multiplier.getMultiplier(), 0.01); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/units/AreaUnit.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto.units; 6 | 7 | import com.github.jqudt.Unit; 8 | import com.github.jqudt.onto.UnitFactory; 9 | 10 | public class AreaUnit { 11 | 12 | private AreaUnit() {}; 13 | 14 | public static Unit SQUARE_METER = UnitFactory.getInstance().getUnit("http://qudt.org/vocab/unit#SquareMeter"); 15 | public static Unit SQUARE_ANGSTROM = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/SquareAngstrom"); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/units/LengthTests.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.units; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.github.jqudt.Quantity; 11 | import com.github.jqudt.onto.units.LengthUnit; 12 | 13 | public class LengthTests { 14 | 15 | @Test 16 | public void testNanometer() throws IllegalArgumentException, IllegalAccessException { 17 | Quantity temp = new Quantity(23.5, LengthUnit.NM); 18 | Assert.assertEquals("nm", temp.getUnit().getAbbreviation()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/units/EnergyTests.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.units; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.github.jqudt.Quantity; 11 | import com.github.jqudt.onto.units.EnergyUnit; 12 | 13 | public class EnergyTests { 14 | 15 | @Test 16 | public void testElectronVolt() throws IllegalArgumentException, IllegalAccessException { 17 | Quantity temp = new Quantity(-23.5, EnergyUnit.EV); 18 | Assert.assertEquals("eV", temp.getUnit().getAbbreviation()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.github.jqudt 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.m2e.core.maven2Nature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/onto/QUDTTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto; 6 | 7 | import java.io.IOException; 8 | 9 | import org.eclipse.rdf4j.model.IRI; 10 | import org.eclipse.rdf4j.rio.RDFParseException; 11 | import org.junit.Assert; 12 | import org.junit.Test; 13 | 14 | public class QUDTTest { 15 | 16 | @Test 17 | public void testUnitOntology() throws RDFParseException, IOException { 18 | IRI symbol = QUDT.SYMBOL; 19 | Assert.assertEquals(QUDT.namespace, symbol.getNamespace()); 20 | Assert.assertEquals("symbol", symbol.getLocalName()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | strategy: 13 | matrix: 14 | java: [ 11, 14, 17 ] 15 | name: Java ${{ matrix.java }} 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Set up Java 20 | uses: actions/setup-java@v1 21 | with: 22 | java-version: ${{ matrix.java }} 23 | - name: Build with Maven 24 | run: mvn clean install -Dgpg.skip -Dmaven.javadoc.skip=true 25 | - name: push JaCoCo stats to codecov.io 26 | run: bash <(curl -s https://codecov.io/bash) 27 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/units/VolumeUnit.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto.units; 6 | 7 | import com.github.jqudt.Unit; 8 | import com.github.jqudt.onto.UnitFactory; 9 | 10 | public class VolumeUnit { 11 | 12 | private VolumeUnit() {}; 13 | 14 | public static Unit LITER = UnitFactory.getInstance().getUnit("http://qudt.org/vocab/unit#Liter"); 15 | public static Unit MICROLITER = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Microliter"); 16 | public static Unit MILLILITER = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Milliliter"); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/onto/OntoReaderTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto; 6 | 7 | import java.io.IOException; 8 | 9 | import org.junit.Assert; 10 | import org.junit.Test; 11 | import org.eclipse.rdf4j.model.Model; 12 | import org.eclipse.rdf4j.model.impl.LinkedHashModel; 13 | import org.eclipse.rdf4j.rio.RDFParseException; 14 | 15 | public class OntoReaderTest { 16 | 17 | @Test 18 | public void testUnitOntology() throws RDFParseException, IOException { 19 | Model repos = new LinkedHashModel(); 20 | OntoReader.read(repos, "unit"); 21 | Assert.assertNotNull(repos); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/units/TemperatureUnit.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto.units; 6 | 7 | import com.github.jqudt.Unit; 8 | import com.github.jqudt.onto.UnitFactory; 9 | 10 | public class TemperatureUnit { 11 | 12 | private TemperatureUnit() {}; 13 | 14 | public static Unit KELVIN = UnitFactory.getInstance().getUnit("http://qudt.org/vocab/unit#Kelvin"); 15 | public static Unit CELSIUS = UnitFactory.getInstance().getUnit("http://qudt.org/vocab/unit#DegreeCelsius"); 16 | public static Unit FAHRENHEIT = UnitFactory.getInstance().getUnit("http://qudt.org/vocab/unit#DegreeFahrenheit"); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/units/area/SquareAreaTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.units.area; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.github.jqudt.Quantity; 11 | import com.github.jqudt.onto.units.AreaUnit; 12 | 13 | public class SquareAreaTest { 14 | 15 | @Test 16 | public void testMinusTwenty() throws IllegalArgumentException, IllegalAccessException { 17 | Quantity area = new Quantity(5, AreaUnit.SQUARE_ANGSTROM); 18 | Quantity area2 = area.convertTo(AreaUnit.SQUARE_METER); 19 | Assert.assertEquals(0.00000000000000000005, area2.getValue(), 0.01); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/Multiplier.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt; 6 | 7 | public class Multiplier { 8 | 9 | private double offset; 10 | private double multiplier; 11 | 12 | public Multiplier(double offset, double multiplier) { 13 | this.offset = offset; 14 | this.multiplier = multiplier; 15 | } 16 | 17 | public Multiplier() {} 18 | 19 | public double getOffset() { 20 | return offset; 21 | } 22 | public void setOffset(double offset) { 23 | this.offset = offset; 24 | } 25 | public double getMultiplier() { 26 | return multiplier; 27 | } 28 | public void setMultiplier(double multiplier) { 29 | this.multiplier = multiplier; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/units/concentration/MolarTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.units.concentration; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.github.jqudt.Quantity; 11 | import com.github.jqudt.onto.units.ConcentrationUnit; 12 | 13 | public class MolarTest { 14 | 15 | @Test 16 | public void testMolarConversion() throws IllegalArgumentException, IllegalAccessException { 17 | Quantity obs = new Quantity(0.000001, ConcentrationUnit.MOLAR); 18 | Quantity obs2 = obs.convertTo(ConcentrationUnit.NANOMOLAR); 19 | Assert.assertEquals(ConcentrationUnit.NANOMOLAR, obs2.getUnit()); 20 | Assert.assertEquals(1000, obs2.getValue(), 1); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/QuantityTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.github.jqudt.onto.units.TemperatureUnit; 11 | 12 | public class QuantityTest { 13 | 14 | @Test 15 | public void testConstructorNullUnit() { 16 | Quantity quantity = new Quantity(0.1, null); 17 | Assert.assertEquals(0.1, quantity.getValue(), 0.01); 18 | Assert.assertNull(quantity.getUnit()); 19 | } 20 | 21 | @Test 22 | public void testConstructor() { 23 | Quantity quantity = new Quantity(0.1, TemperatureUnit.CELSIUS); 24 | Assert.assertEquals(0.1, quantity.getValue(), 0.01); 25 | Assert.assertEquals(TemperatureUnit.CELSIUS, quantity.getUnit()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/units/concentration/MassPerVolumeUnitTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.units.concentration; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.github.jqudt.Quantity; 11 | import com.github.jqudt.onto.units.ConcentrationUnit; 12 | 13 | public class MassPerVolumeUnitTest { 14 | 15 | @Test 16 | public void test() throws IllegalArgumentException, IllegalAccessException { 17 | Quantity obs = new Quantity(0.1, ConcentrationUnit.MICROGRAM_PER_MILLILITER); 18 | Quantity obs2 = obs.convertTo(ConcentrationUnit.PICOGRAM_PER_MILLILITER); 19 | Assert.assertEquals(ConcentrationUnit.PICOGRAM_PER_MILLILITER, obs2.getUnit()); 20 | Assert.assertEquals(100000, obs2.getValue(), 1); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/OntoReader.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto; 6 | 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | 10 | import org.eclipse.rdf4j.model.Model; 11 | import org.eclipse.rdf4j.rio.RDFFormat; 12 | import org.eclipse.rdf4j.rio.RDFParseException; 13 | import org.eclipse.rdf4j.rio.Rio; 14 | 15 | public class OntoReader { 16 | 17 | protected static void read(Model repos, String ontology) 18 | throws RDFParseException, IOException { 19 | String filename = "onto/" + ontology; 20 | InputStream ins = OntoReader.class.getClassLoader() 21 | .getResourceAsStream(filename); 22 | if (ontology.endsWith(".ttl")) { 23 | repos.addAll(Rio.parse(ins, "", RDFFormat.TURTLE)); 24 | } else { 25 | repos.addAll(Rio.parse(ins, "", RDFFormat.RDFXML)); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/units/concentration/TimeUnitTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.units.concentration; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.github.jqudt.Quantity; 11 | import com.github.jqudt.Unit; 12 | import com.github.jqudt.onto.UnitFactory; 13 | 14 | public class TimeUnitTest { 15 | 16 | @Test 17 | public void test() throws IllegalArgumentException, IllegalAccessException { 18 | UnitFactory factory = UnitFactory.getInstance(); 19 | Unit hour = factory.getUnit("http://qudt.org/vocab/unit#Hour"); 20 | Unit second = factory.getUnit("http://qudt.org/vocab/unit#SecondTime"); 21 | Quantity obs = new Quantity(1, hour); 22 | Quantity obs2 = obs.convertTo(second); 23 | Assert.assertEquals(second, obs2.getUnit()); 24 | Assert.assertEquals(3600, obs2.getValue(), 1); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/units/MassUnit.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto.units; 6 | 7 | import com.github.jqudt.Unit; 8 | import com.github.jqudt.onto.UnitFactory; 9 | 10 | public class MassUnit { 11 | 12 | private MassUnit() {}; 13 | 14 | public static Unit KILOGRAM = UnitFactory.getInstance().getUnit("http://qudt.org/vocab/unit#Kilogram"); 15 | public static Unit GRAM = UnitFactory.getInstance().getUnit("http://qudt.org/vocab/unit#Gram"); 16 | public static Unit MILLIGRAM = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Milligram"); 17 | public static Unit MICROGRAM = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Microgram"); 18 | public static Unit NANOGRAM = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Nanogram"); 19 | public static Unit PICOGRAM = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Picogram"); 20 | public static Unit FEMTOGRAM = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Femtogram"); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/units/temperature/CelsiusTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.units.temperature; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.github.jqudt.Quantity; 11 | import com.github.jqudt.onto.units.TemperatureUnit; 12 | 13 | public class CelsiusTest { 14 | 15 | @Test 16 | public void testAbsoluteZero() throws IllegalArgumentException, IllegalAccessException { 17 | Quantity temp = new Quantity(-273.15, TemperatureUnit.CELSIUS); 18 | Quantity temp2 = temp.convertTo(TemperatureUnit.KELVIN); 19 | Assert.assertEquals(TemperatureUnit.KELVIN, temp2.getUnit()); 20 | Assert.assertEquals(0.0, temp2.getValue(), 0.01); 21 | } 22 | 23 | @Test 24 | public void testRoomTemperature() throws IllegalArgumentException, IllegalAccessException { 25 | Quantity temp = new Quantity(20, TemperatureUnit.CELSIUS); 26 | Quantity temp2 = temp.convertTo(TemperatureUnit.KELVIN); 27 | Assert.assertEquals(TemperatureUnit.KELVIN, temp2.getUnit()); 28 | Assert.assertEquals(293.15, temp2.getValue(), 0.01); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/units/temperature/FahrenheitTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.units.temperature; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.github.jqudt.Quantity; 11 | import com.github.jqudt.onto.units.TemperatureUnit; 12 | 13 | public class FahrenheitTest { 14 | 15 | @Test 16 | public void testTwentyDegrees() throws IllegalArgumentException, IllegalAccessException { 17 | Quantity temp = new Quantity(20, TemperatureUnit.CELSIUS); 18 | Quantity temp2 = temp.convertTo(TemperatureUnit.FAHRENHEIT); 19 | Assert.assertEquals(TemperatureUnit.FAHRENHEIT, temp2.getUnit()); 20 | Assert.assertEquals(68., temp2.getValue(), 0.1); 21 | } 22 | 23 | @Test 24 | public void testMinusTwenty() throws IllegalArgumentException, IllegalAccessException { 25 | Quantity temp = new Quantity(-20, TemperatureUnit.CELSIUS); 26 | Quantity temp2 = temp.convertTo(TemperatureUnit.FAHRENHEIT); 27 | Assert.assertEquals(TemperatureUnit.FAHRENHEIT, temp2.getUnit()); 28 | Assert.assertEquals(-4, temp2.getValue(), 0.01); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/units/concentration/NanomolarTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.units.concentration; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.github.jqudt.Quantity; 11 | import com.github.jqudt.onto.units.ConcentrationUnit; 12 | 13 | public class NanomolarTest { 14 | 15 | @Test 16 | public void testMolarConversion() throws IllegalArgumentException, IllegalAccessException { 17 | Quantity obs = new Quantity(0.1, ConcentrationUnit.MICROMOLAR); 18 | Quantity obs2 = obs.convertTo(ConcentrationUnit.NANOMOLAR); 19 | Assert.assertEquals(ConcentrationUnit.NANOMOLAR, obs2.getUnit()); 20 | Assert.assertEquals(100, obs2.getValue(), 1); 21 | } 22 | 23 | @Test 24 | public void testCompareToMolePerCubicMeter() throws Exception { 25 | Quantity obs = new Quantity(1.0, ConcentrationUnit.NANOMOLAR); 26 | Quantity obs2 = obs.convertTo(ConcentrationUnit.MOLE_PER_CUBIC_METER); 27 | Assert.assertEquals(ConcentrationUnit.MOLE_PER_CUBIC_METER, obs2.getUnit()); 28 | Assert.assertEquals(1.0e-6, obs2.getValue(), 1.0e-8); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/QUDT.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012,2023 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto; 6 | 7 | import org.eclipse.rdf4j.model.IRI; 8 | import org.eclipse.rdf4j.model.ValueFactory; 9 | import org.eclipse.rdf4j.model.impl.ValidatingValueFactory; 10 | 11 | public class QUDT { 12 | 13 | private static ValueFactory factory = new ValidatingValueFactory(); 14 | 15 | public final static String namespace = "http://qudt.org/schema/qudt#"; 16 | 17 | private static final IRI getURI(String localPart) { 18 | return factory.createIRI(namespace, localPart); 19 | } 20 | 21 | public final static IRI SYMBOL = getURI("symbol"); 22 | public final static IRI ABBREVIATION = getURI("abbreviation"); 23 | public final static IRI CONVERSION_OFFSET = getURI("conversionOffset"); 24 | public final static IRI CONVERSION_MULTIPLIER = getURI("conversionMultiplier"); 25 | 26 | public final static IRI SI_UNIT = getURI("SIUnit"); 27 | public final static IRI SI_BASE_UNIT = getURI("SIBaseUnit"); 28 | public final static IRI SI_DERIVED_UNIT = getURI("SIDerivedUnit"); 29 | public final static IRI DERIVED_UNIT = getURI("DerivedUnit"); 30 | public final static IRI NOT_USED_WITH_SI_UNIT = getURI("NotUsedWithSIUnit"); 31 | public final static IRI USED_WITH_SI_UNIT = getURI("UsedWithSIUnit"); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/units/ConcentrationUnit.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto.units; 6 | 7 | import com.github.jqudt.Unit; 8 | import com.github.jqudt.onto.UnitFactory; 9 | 10 | public class ConcentrationUnit { 11 | 12 | private ConcentrationUnit() {}; 13 | 14 | public static Unit MOLE_PER_CUBIC_METER = UnitFactory.getInstance().getUnit("http://qudt.org/vocab/unit#MolePerCubicMeter"); 15 | 16 | public static Unit MOLAR = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Molar"); 17 | public static Unit MILLIMOLAR = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Millimolar"); 18 | public static Unit NANOMOLAR = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Nanomolar"); 19 | public static Unit MICROMOLAR = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/Micromolar"); 20 | 21 | public static Unit GRAM_PER_LITER = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/GramPerLiter"); 22 | public static Unit MICROGRAM_PER_MILLILITER = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/MicrogramPerMilliliter"); 23 | public static Unit PICOGRAM_PER_MILLILITER = UnitFactory.getInstance().getUnit("http://www.openphacts.org/units/PicogramPerMilliliter"); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /lib/LICENSE.openrdf-sesame: -------------------------------------------------------------------------------- 1 | Copyright Aduna (http://www.aduna-software.com/) © 2001-2011 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 | -------------------------------------------------------------------------------- /lib/LICENSE.slf4j: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2007 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, and/or sell copies of the Software, and to permit persons 9 | to whom the Software is furnished to do so, provided that the above 10 | copyright notice(s) and this permission notice appear in all copies of 11 | the Software and that both the above copyright notice(s) and this 12 | permission notice appear in supporting documentation. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 17 | OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 18 | HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY 19 | SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER 20 | RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF 21 | CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 22 | CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 23 | 24 | Except as contained in this notice, the name of a copyright holder 25 | shall not be used in advertising or otherwise to promote the sale, use 26 | or other dealings in this Software without prior written authorization 27 | of the copyright holder. 28 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/Unit.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt; 6 | 7 | import java.net.URI; 8 | 9 | public class Unit { 10 | 11 | private URI resource; 12 | private String label; 13 | private String abbreviation; 14 | private String symbol; 15 | private URI type; 16 | 17 | private Multiplier multiplier; 18 | 19 | public URI getResource() { 20 | return resource; 21 | } 22 | 23 | public void setResource(URI resource) { 24 | this.resource = resource; 25 | } 26 | 27 | public String getLabel() { 28 | return label; 29 | } 30 | 31 | public void setLabel(String label) { 32 | this.label = label; 33 | } 34 | 35 | public String getAbbreviation() { 36 | return abbreviation; 37 | } 38 | 39 | public void setAbbreviation(String abbreviation) { 40 | this.abbreviation = abbreviation; 41 | } 42 | 43 | public String getSymbol() { 44 | return symbol; 45 | } 46 | 47 | public void setSymbol(String symbol) { 48 | this.symbol = symbol; 49 | } 50 | 51 | public Multiplier getMultiplier() { 52 | return multiplier; 53 | } 54 | 55 | public void setMultiplier(Multiplier multiplier) { 56 | this.multiplier = multiplier; 57 | } 58 | 59 | public URI getType() { 60 | return type; 61 | } 62 | 63 | public void setType(URI type) { 64 | this.type = type; 65 | } 66 | 67 | public String toString() { 68 | return (this.getAbbreviation() == null ? "" : this.getAbbreviation()); 69 | } 70 | 71 | public boolean equals(Object obj) { 72 | if (!(obj instanceof Unit)) return false; 73 | 74 | return (obj.hashCode() == this.hashCode()); 75 | } 76 | 77 | public int hashCode() { 78 | return resource == null ? "".hashCode() : resource.toString().hashCode(); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/uo/UnitOntologyFactoryTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012-2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.uo; 6 | 7 | import java.net.URI; 8 | import java.util.List; 9 | 10 | import org.junit.Assert; 11 | import org.junit.Test; 12 | 13 | import com.github.jqudt.Unit; 14 | import com.github.jqudt.uo.UnitOntologyFactory; 15 | 16 | /** 17 | * Tests that mappings from the Unit Ontology (UO) to QUDT are working, and 18 | * that units can be instantiated using the UO. 19 | */ 20 | public class UnitOntologyFactoryTest { 21 | 22 | @Test 23 | public void testGetInstance() throws Exception { 24 | UnitOntologyFactory factory = UnitOntologyFactory.getInstance(); 25 | Assert.assertNotNull(factory); 26 | } 27 | 28 | @Test 29 | public void testGetUnit() throws Exception { 30 | UnitOntologyFactory factory = UnitOntologyFactory.getInstance(); 31 | Unit unit = factory.getUnit("http://purl.obolibrary.org/obo/UO_0000065"); 32 | Assert.assertNotNull(unit); 33 | Assert.assertEquals("Nanomolar", unit.getLabel()); 34 | Assert.assertEquals("nmol/dm^3", unit.getSymbol()); 35 | Assert.assertEquals("nM", unit.getAbbreviation()); 36 | Assert.assertEquals(0.000001, unit.getMultiplier().getMultiplier(), 0.0000001); 37 | Assert.assertEquals(0, unit.getMultiplier().getOffset(), 0.01); 38 | Assert.assertEquals("http://qudt.org/schema/qudt#MolarConcentrationUnit", unit.getType().toString()); 39 | } 40 | 41 | @Test 42 | public void testGetUOUnitsByQUDTType() throws Exception { 43 | UnitOntologyFactory factory = UnitOntologyFactory.getInstance(); 44 | List units = factory.getURIs(new URI("http://qudt.org/schema/qudt#MolarConcentrationUnit")); 45 | Assert.assertNotNull(units); 46 | Assert.assertNotSame(0, units.size()); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3883587.svg)](https://doi.org/10.5281/zenodo.3883587) 2 | [![build](https://github.com/egonw/jqudt/actions/workflows/maven.yml/badge.svg)](https://github.com/egonw/jqudt/actions/workflows/maven.yml) 3 | [![Maven Central](https://img.shields.io/maven-central/v/com.github.egonw/jqudt.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.egonw%22%20AND%20a:%22jqudt%22) 4 | 5 | Introduction 6 | ============ 7 | 8 | Java Library to deal with QUDT units and conversions between them. 9 | 10 | QUDT is "Quantities, Units, Dimensions and Data Types in OWL and XML" 11 | 12 | http://www.qudt.org/ 13 | 14 | QUDT is a CC-SA-BY project by NASA Ames Research Center and TopQuadrant, Inc. 15 | 16 | License of this Java library: new BSD 17 | 18 | Installation 19 | ============ 20 | 21 | Maven: 22 | 23 | ```xml 24 | 25 | com.github.egonw 26 | jqudt 27 | 1.5.1 28 | 29 | ``` 30 | 31 | Groovy: 32 | 33 | ```groovy 34 | @Grab(group='com.github.egonw', module='jqudt', version='1.5.1') 35 | ``` 36 | 37 | Quick demo 38 | ========== 39 | 40 | Keep in mind, that the below conversions are purely derived from the information 41 | defined in the QUDT ontology, taking advantage from the fact that the have the 42 | same unit type, qudt:MolarConcentrationUnit and qudt:TemperatureUnit respectively. 43 | 44 | Source: 45 | 46 | ```java 47 | Quantity obs = new Quantity(0.1, ConcentrationUnit.MICROMOLAR); 48 | System.out.println(obs + " = " + obs.convertTo(ConcentrationUnit.NANOMOLAR)); 49 | 50 | Quantity temp = new Quantity(20, TemperatureUnit.CELSIUS); 51 | System.out.println(temp + " = " + temp.convertTo(TemperatureUnit.KELVIN)); 52 | ``` 53 | 54 | Output 55 | 56 | ``` 57 | 0.1 μM = 100.00000000000001 nM 58 | 20.0 C = 293.0 K 59 | ``` 60 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/Quantity.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt; 6 | 7 | public class Quantity { 8 | 9 | private double value; 10 | private Unit unit; 11 | 12 | private Quantity() {} 13 | 14 | public Quantity(double value, Unit unit) { 15 | this.value = value; 16 | this.unit = unit; 17 | } 18 | 19 | public double getValue() { 20 | return value; 21 | } 22 | private void setValue(double value) { 23 | this.value = value; 24 | } 25 | public Unit getUnit() { 26 | return unit; 27 | } 28 | private void setUnit(Unit unit) { 29 | this.unit = unit; 30 | } 31 | 32 | public Quantity convertTo(Unit newUnit) throws IllegalArgumentException, IllegalAccessException { 33 | if (newUnit == null) 34 | throw new IllegalArgumentException( 35 | "Target unit cannot be null" 36 | ); 37 | 38 | if (unit == null) 39 | throw new IllegalAccessException( 40 | "This measurement does not have units defined" 41 | ); 42 | 43 | if (unit.getResource().equals(newUnit.getResource())) return this; // nothing to be done 44 | 45 | if (!unit.getType().equals(newUnit.getType())) 46 | throw new IllegalAccessException( 47 | "The new unit does not have the same parent type " + 48 | "(source: " + unit.getType() + "; target: " + newUnit.getType() + ")" 49 | ); 50 | 51 | Quantity newMeasurement = new Quantity(); 52 | newMeasurement.setUnit(newUnit); 53 | newMeasurement.setValue( 54 | ((value 55 | // convert to the base unit 56 | * unit.getMultiplier().getMultiplier() + unit.getMultiplier().getOffset()) 57 | // convert the base unit to the new unit 58 | - newUnit.getMultiplier().getOffset()) / newUnit.getMultiplier().getMultiplier() 59 | ); 60 | 61 | return newMeasurement; 62 | } 63 | 64 | public String toString() { 65 | return "" + getValue() + " " + getUnit().toString(); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/UnitTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt; 6 | 7 | import java.net.URI; 8 | 9 | import org.junit.Assert; 10 | import org.junit.Test; 11 | 12 | public class UnitTest { 13 | 14 | @Test 15 | public void testResource() throws Exception { 16 | Unit unit = new Unit(); 17 | URI resource = new URI("http://qudt.org/vocab/unit#Kelvin"); 18 | Assert.assertNull(unit.getResource()); 19 | unit.setResource(resource); 20 | Assert.assertNotNull(unit.getResource()); 21 | Assert.assertEquals(resource, unit.getResource()); 22 | } 23 | 24 | @Test 25 | public void testEquals() throws Exception { 26 | Unit unit1 = new Unit(); 27 | URI resource1 = new URI("http://qudt.org/vocab/unit#Kelvin"); 28 | unit1.setResource(resource1); 29 | Unit unit2 = new Unit(); 30 | URI resource2 = new URI("http://qudt.org/vocab/unit#Kelvin"); 31 | unit2.setResource(resource2); 32 | Assert.assertEquals(unit1, unit2); 33 | } 34 | 35 | @Test 36 | public void testType() throws Exception { 37 | Unit unit = new Unit(); 38 | URI resource = new URI("http://qudt.org/vocab/unit#Kelvin"); 39 | Assert.assertNull(unit.getType()); 40 | unit.setType(resource); 41 | Assert.assertNotNull(unit.getType()); 42 | Assert.assertEquals(resource, unit.getType()); 43 | } 44 | 45 | @Test 46 | public void testLabel() throws Exception { 47 | Unit unit = new Unit(); 48 | Assert.assertNull(unit.getLabel()); 49 | unit.setLabel("nanomolar"); 50 | Assert.assertNotNull(unit.getLabel()); 51 | Assert.assertEquals("nanomolar", unit.getLabel()); 52 | } 53 | 54 | @Test 55 | public void testAbbreviation() throws Exception { 56 | Unit unit = new Unit(); 57 | Assert.assertNull(unit.getAbbreviation()); 58 | unit.setAbbreviation("nM"); 59 | Assert.assertNotNull(unit.getAbbreviation()); 60 | Assert.assertEquals("nM", unit.getAbbreviation()); 61 | } 62 | 63 | @Test 64 | public void testSymbol() throws Exception { 65 | Unit unit = new Unit(); 66 | Assert.assertNull(unit.getSymbol()); 67 | unit.setSymbol("K"); 68 | Assert.assertNotNull(unit.getSymbol()); 69 | Assert.assertEquals("K", unit.getSymbol()); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/test/java/com/github/jqudt/onto/UnitFactoryTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto; 6 | 7 | import java.util.List; 8 | 9 | import org.junit.Assert; 10 | import org.junit.Test; 11 | 12 | import com.github.jqudt.Unit; 13 | 14 | public class UnitFactoryTest { 15 | 16 | @Test 17 | public void testGetInstance() throws Exception { 18 | UnitFactory factory = UnitFactory.getInstance(); 19 | Assert.assertNotNull(factory); 20 | } 21 | 22 | @Test 23 | public void testGetUnit() throws Exception { 24 | UnitFactory factory = UnitFactory.getInstance(); 25 | Unit unit = factory.getUnit("http://qudt.org/vocab/unit#Kelvin"); 26 | Assert.assertNotNull(unit); 27 | Assert.assertEquals("Kelvin", unit.getLabel()); 28 | Assert.assertEquals("K", unit.getSymbol()); 29 | Assert.assertEquals("K", unit.getAbbreviation()); 30 | Assert.assertEquals(1, unit.getMultiplier().getMultiplier(), 0.01); 31 | Assert.assertEquals(0, unit.getMultiplier().getOffset(), 0.01); 32 | Assert.assertEquals("http://qudt.org/schema/qudt#TemperatureUnit", unit.getType().toString()); 33 | } 34 | 35 | @Test 36 | public void testGetURIs() throws Exception { 37 | UnitFactory factory = UnitFactory.getInstance(); 38 | List units = factory.getURIs("http://qudt.org/schema/qudt#TemperatureUnit"); 39 | Assert.assertNotNull(units); 40 | Assert.assertNotSame(0, units.size()); 41 | } 42 | 43 | @Test 44 | public void testGetOpenPHACTSUnit() throws Exception { 45 | UnitFactory factory = UnitFactory.getInstance(); 46 | Unit unit = factory.getUnit("http://www.openphacts.org/units/Nanomolar"); 47 | Assert.assertNotNull(unit); 48 | Assert.assertEquals("Nanomolar", unit.getLabel()); 49 | Assert.assertEquals("nmol/dm^3", unit.getSymbol()); 50 | Assert.assertEquals("nM", unit.getAbbreviation()); 51 | Assert.assertEquals(0.000001, unit.getMultiplier().getMultiplier(), 0.0000001); 52 | Assert.assertEquals(0, unit.getMultiplier().getOffset(), 0.01); 53 | Assert.assertEquals("http://qudt.org/schema/qudt#MolarConcentrationUnit", unit.getType().toString()); 54 | } 55 | 56 | @Test 57 | public void testGetOpenPHACTSUnit_Newer() throws Exception { 58 | UnitFactory factory = UnitFactory.getInstance(); 59 | Unit unit = factory.getUnit("http://www.openphacts.org/units/NanogramPerMilliliter"); 60 | Assert.assertNotNull(unit); 61 | Assert.assertEquals("http://qudt.org/schema/qudt#MassPerVolumeUnit", unit.getType().toString()); 62 | } 63 | 64 | @Test 65 | public void testFindUnits() throws Exception { 66 | UnitFactory factory = UnitFactory.getInstance(); 67 | List units = factory.findUnits("nM"); 68 | Assert.assertNotNull(units); 69 | Assert.assertNotSame(0, units.size()); 70 | Assert.assertEquals("http://www.openphacts.org/units/Nanomolar", units.get(0).getResource().toString()); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/uo/UnitOntologyFactory.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2013 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.uo; 6 | 7 | import java.net.URI; 8 | import java.net.URISyntaxException; 9 | import java.util.ArrayList; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | import com.github.jqudt.Unit; 15 | import com.github.jqudt.onto.UnitFactory; 16 | 17 | public class UnitOntologyFactory { 18 | 19 | private static UnitOntologyFactory factory = null; 20 | 21 | @SuppressWarnings("serial") 22 | private Map uo2qudt = new HashMap() { 23 | // a helper method 24 | String longURI(String shortened) { 25 | if (shortened.startsWith("uo:")) return "http://purl.obolibrary.org/obo/" + shortened.substring(3); 26 | if (shortened.startsWith("ops:")) return "http://www.openphacts.org/units/" + shortened.substring(4); 27 | return null; 28 | } 29 | // the next defines all mappings from the Unit Ontology to the QUDT 30 | { 31 | put(longURI("uo:EFO_0004374"), longURI("ops:MilligramPerDeciliter")); 32 | put(longURI("uo:EFO_0004385"), longURI("ops:PicogramPerMilliliter")); 33 | put(longURI("uo:UO_0000009"), longURI("qudt:Kilogram")); 34 | put(longURI("uo:UO_0000010"), longURI("qudt:SecondTime")); 35 | put(longURI("uo:UO_0000015"), longURI("qudt:Centimeter")); 36 | put(longURI("uo:UO_0000016"), longURI("qudt:Millimeter")); 37 | put(longURI("uo:UO_0000017"), longURI("qudt:Micrometer")); 38 | put(longURI("uo:UO_0000018"), longURI("ops:Nanometer")); 39 | put(longURI("uo:UO_0000021"), longURI("qudt:Gram")); 40 | put(longURI("uo:UO_0000022"), longURI("ops:Milligram")); 41 | put(longURI("uo:UO_0000023"), longURI("ops:Microgram")); 42 | put(longURI("uo:UO_0000024"), longURI("ops:Nanogram")); 43 | put(longURI("uo:UO_0000025"), longURI("ops:Picogram")); 44 | put(longURI("uo:UO_0000026"), longURI("ops:Femtogram")); 45 | put(longURI("uo:UO_0000027"), longURI("qudt:DegreeCelsius")); 46 | put(longURI("uo:UO_0000028"), longURI("qudt:Millisecond")); 47 | put(longURI("uo:UO_0000031"), longURI("qudt:MinuteTime")); 48 | put(longURI("uo:UO_0000032"), longURI("qudt:Hour")); 49 | put(longURI("uo:UO_0000033"), longURI("qudt:Day")); 50 | put(longURI("uo:UO_0000039"), longURI("qudt:Micromole")); 51 | put(longURI("uo:UO_0000040"), longURI("qudt:Millimole")); 52 | put(longURI("uo:UO_0000041"), longURI("qudt:Nanomole")); 53 | put(longURI("uo:UO_0000042"), longURI("qudt:Picomole")); 54 | put(longURI("uo:UO_0000043"), longURI("qudt:Femtomole")); 55 | put(longURI("uo:UO_0000062"), longURI("ops:Molar")); 56 | put(longURI("uo:UO_0000063"), longURI("ops:Millimolar")); 57 | put(longURI("uo:UO_0000064"), longURI("ops:Micromolar")); 58 | put(longURI("uo:UO_0000065"), longURI("ops:Nanomolar")); 59 | put(longURI("uo:UO_0000066"), longURI("ops:Picomolar")); 60 | put(longURI("uo:UO_0000073"), longURI("ops:Femtomolar")); 61 | put(longURI("uo:UO_0000098"), longURI("ops:Milliliter")); 62 | put(longURI("uo:UO_0000099"), longURI("qudt:Liter")); 63 | put(longURI("uo:UO_0000101"), longURI("ops:Microliter")); 64 | put(longURI("uo:UO_0000169"), longURI("ops:PartsPerMillion")); 65 | put(longURI("uo:UO_0000173"), longURI("ops:GramPerMilliliter")); 66 | put(longURI("uo:UO_0000175"), longURI("ops:GramPerLiter")); 67 | put(longURI("uo:UO_0000176"), longURI("ops:MilligramPerMilliliter")); 68 | put(longURI("uo:UO_0000187"), longURI("qudt:Percent")); 69 | put(longURI("uo:UO_0000197"), longURI("ops:LiterPerKilogram")); 70 | put(longURI("uo:UO_0000198"), longURI("ops:MilliliterPerKilogram")); 71 | put(longURI("uo:UO_0000271"), longURI("ops:MicroliterPerMinute")); 72 | put(longURI("uo:UO_0000272"), longURI("qudt:MillimeterOfMercury")); 73 | put(longURI("uo:UO_0000274"), longURI("ops:MicrogramPerMilliliter")); 74 | put(longURI("uo:UO_0000275"), longURI("ops:NanogramPerMilliliter")); 75 | put(longURI("uo:UO_0000308"), longURI("ops:MilligramPerKilogram")); 76 | // put(longURI("uo:UO_0000311"), longURI("")); 77 | } 78 | }; 79 | private Map qudt2uo = null; 80 | 81 | private UnitOntologyFactory() { 82 | // not backed up by a formal ontology (at this moment; see UnitFactory's constructor) 83 | // instead, it uses defined mappings in uo2qudt 84 | 85 | // also make the reverse mapping table 86 | qudt2uo = new HashMap(); 87 | for (String keyURI : uo2qudt.keySet()) qudt2uo.put(uo2qudt.get(keyURI), keyURI); 88 | } 89 | 90 | public static UnitOntologyFactory getInstance() { 91 | if (factory == null) factory = new UnitOntologyFactory(); 92 | return factory; 93 | } 94 | 95 | private static URI asURI(String resource) { 96 | try { 97 | return new URI(resource); 98 | } catch (URISyntaxException exception) { 99 | return null; 100 | } 101 | } 102 | 103 | public Unit getUnit(String resource) { 104 | System.out.println("resource:" + resource); 105 | return getUnit(asURI(resource)); 106 | } 107 | 108 | public Unit getUnit(URI resource) { 109 | if (resource == null) throw new IllegalArgumentException("The URI cannot be null"); 110 | 111 | URI mappedURI = asURI(uo2qudt.get(resource.toString())); 112 | if (mappedURI != null) { 113 | return UnitFactory.getInstance().getUnit(mappedURI); 114 | } else { 115 | return null; 116 | } 117 | } 118 | 119 | public List getURIs(String type) { 120 | URI uri; 121 | try { 122 | uri = new URI(type); 123 | } catch (URISyntaxException exception) { 124 | throw new IllegalStateException("Invalid URI: " + type, exception); 125 | } 126 | return getURIs(uri); 127 | } 128 | 129 | public List getURIs(URI type) { 130 | List uris = new ArrayList(); 131 | 132 | List qudtURIs = UnitFactory.getInstance().getURIs(type); 133 | for (String qudtString : qudtURIs) { 134 | String uoURI = qudt2uo.get(qudtString); 135 | if (uoURI != null) uris.add(uoURI); 136 | } 137 | return uris; 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /src/main/java/com/github/jqudt/onto/UnitFactory.java: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2012,2019,2023 Egon Willighagen 2 | * 3 | * License: new BSD 4 | */ 5 | package com.github.jqudt.onto; 6 | 7 | import java.net.URI; 8 | import java.net.URISyntaxException; 9 | import java.util.ArrayList; 10 | import java.util.Collections; 11 | import java.util.List; 12 | 13 | import org.eclipse.rdf4j.model.IRI; 14 | import org.eclipse.rdf4j.model.Model; 15 | import org.eclipse.rdf4j.model.Statement; 16 | import org.eclipse.rdf4j.model.ValueFactory; 17 | import org.eclipse.rdf4j.model.impl.LinkedHashModel; 18 | import org.eclipse.rdf4j.model.impl.ValidatingValueFactory; 19 | import org.eclipse.rdf4j.model.vocabulary.RDF; 20 | import org.eclipse.rdf4j.model.vocabulary.RDFS; 21 | import org.eclipse.rdf4j.model.vocabulary.XSD; 22 | 23 | import com.github.jqudt.Multiplier; 24 | import com.github.jqudt.Unit; 25 | 26 | public class UnitFactory { 27 | 28 | private Model repos; 29 | 30 | private static UnitFactory factory = null; 31 | private ValueFactory f = null; 32 | 33 | private UnitFactory() { 34 | this.f = new ValidatingValueFactory(); 35 | repos = new LinkedHashModel(); 36 | String[] ontologies = { 37 | "unit", "qudt", "quantity", "ops" 38 | }; 39 | for (String ontology : ontologies) { 40 | try { 41 | OntoReader.read(repos, ontology); 42 | } catch (Exception exception) { 43 | throw new IllegalStateException( 44 | "Could not load the QUDT ontology '" + ontology + "': " + exception.getMessage(), exception 45 | ); 46 | } 47 | } 48 | } 49 | 50 | public static UnitFactory getInstance() { 51 | if (factory == null) factory = new UnitFactory(); 52 | return factory; 53 | } 54 | 55 | public Unit getUnit(String resource) { 56 | URI uri; 57 | try { 58 | uri = new URI(resource); 59 | } catch (URISyntaxException exception) { 60 | throw new IllegalStateException("Invalid URI: " + resource, exception); 61 | } 62 | return getUnit(uri); 63 | } 64 | 65 | public Unit getUnit(URI resource) { 66 | if (resource == null) throw new IllegalArgumentException("The URI cannot be null"); 67 | 68 | IRI uri = f.createIRI(resource.toString()); 69 | 70 | Unit unit = new Unit(); 71 | unit.setResource(resource); 72 | Multiplier multiplier = new Multiplier(); 73 | 74 | try { 75 | Model statements = repos.filter(uri, null, null); 76 | if (statements.isEmpty()) 77 | throw new IllegalStateException("No ontology entry found for: " + resource.toString()); 78 | 79 | for (Statement statement : statements) { 80 | if (statement.getPredicate().equals(QUDT.SYMBOL)) { 81 | unit.setSymbol(statement.getObject().stringValue()); 82 | } else if (statement.getPredicate().equals(QUDT.ABBREVIATION)) { 83 | unit.setAbbreviation(statement.getObject().stringValue()); 84 | } else if (statement.getPredicate().equals(QUDT.CONVERSION_OFFSET)) { 85 | multiplier.setOffset(Double.parseDouble(statement.getObject().stringValue())); 86 | } else if (statement.getPredicate().equals(QUDT.CONVERSION_MULTIPLIER)) { 87 | multiplier.setMultiplier(Double.parseDouble(statement.getObject().stringValue())); 88 | } else if (statement.getPredicate().equals(RDFS.LABEL)) { 89 | unit.setLabel(statement.getObject().stringValue()); 90 | } else if (statement.getPredicate().equals(RDF.TYPE)) { 91 | Object type = statement.getObject(); 92 | if (type instanceof IRI) { 93 | IRI typeURI = (IRI)type; 94 | if (!shouldBeIgnored(typeURI)) { 95 | unit.setType(new URI(typeURI.stringValue())); 96 | } 97 | } 98 | } else { 99 | // System.out.println("Ignoring: " + statement); 100 | } 101 | } 102 | unit.setMultiplier(multiplier); 103 | } catch (Exception exception) { 104 | throw new IllegalStateException("Could not create the unit: " + exception.getMessage(), exception); 105 | } 106 | 107 | return unit; 108 | } 109 | 110 | public List findUnits(String symbol) { 111 | if (symbol == null) throw new IllegalArgumentException("The symbol cannot be null"); 112 | 113 | Model statements = repos.filter(null, QUDT.ABBREVIATION, f.createLiteral(symbol, XSD.STRING)); 114 | if (statements.isEmpty()) return Collections.emptyList(); 115 | List foundUnits = new ArrayList(); 116 | for (Statement statement : statements) { 117 | Object type = statement.getSubject(); 118 | try { 119 | if (type instanceof IRI) { 120 | IRI typeURI = (IRI)type; 121 | foundUnits.add(getUnit(typeURI.toString())); 122 | } 123 | } catch (Exception exception) { 124 | // ignore 125 | } 126 | } 127 | return foundUnits; 128 | } 129 | 130 | public List getURIs(String type) { 131 | URI uri; 132 | try { 133 | uri = new URI(type); 134 | } catch (URISyntaxException exception) { 135 | throw new IllegalStateException("Invalid URI: " + type, exception); 136 | } 137 | return getURIs(uri); 138 | } 139 | 140 | public List getURIs(URI type) { 141 | if (type == null) throw new IllegalArgumentException("The type cannot be null"); 142 | 143 | IRI uri = f.createIRI(type.toString()); 144 | 145 | try { 146 | Model statements = repos.filter(null, null, uri); 147 | if (statements.isEmpty()) 148 | return Collections.emptyList(); 149 | 150 | List units = new ArrayList(); 151 | for (Statement statement : statements) { 152 | units.add(statement.getSubject().toString()); 153 | } 154 | return units; 155 | } catch (Exception exception) { 156 | throw new IllegalStateException("Error while getting the units: " + exception.getMessage(), exception); 157 | } 158 | } 159 | 160 | private boolean shouldBeIgnored(IRI typeURI) { 161 | // accept anything outside the QUDT namespace 162 | if (!typeURI.getNamespace().equals(QUDT.namespace)) return false; 163 | 164 | if (typeURI.equals(QUDT.SI_DERIVED_UNIT)) return true; 165 | if (typeURI.equals(QUDT.SI_BASE_UNIT)) return true; 166 | if (typeURI.equals(QUDT.SI_UNIT)) return true; 167 | if (typeURI.equals(QUDT.DERIVED_UNIT)) return true; 168 | if (typeURI.equals(QUDT.NOT_USED_WITH_SI_UNIT)) return true; 169 | if (typeURI.equals(QUDT.USED_WITH_SI_UNIT)) return true; 170 | 171 | // everything else is fine too 172 | return false; 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.github.egonw 5 | jqudt 6 | 1.5.1 7 | jar 8 | jQUDT 9 | Java library for the QUDT ontology 10 | https://github.com/egonw/jqudt 11 | 12 | 13 | 14 | BSD New 15 | https://opensource.org/licenses/BSD-3-Clause 16 | 17 | 18 | 19 | 20 | 21 | Egon Willighagen 22 | egon.willighagen@maastrichtuniversity.nl 23 | Maastricht University 24 | http://egonw.github.com/ 25 | 26 | 27 | Peter Ansell 28 | p_ansell@yahoo.com 29 | 30 | 31 | 32 | 33 | UTF-8 34 | 4.13.2 35 | 5.1.4 36 | 37 | 38 | 39 | scm:git:https://github.com/egonw/jqudt.git 40 | scm:git:ssh://git@github.com/egonw/jqudt.git 41 | https://github.com/egonw/jqudt 42 | HEAD 43 | 44 | 45 | 46 | 47 | org.eclipse.rdf4j 48 | rdf4j-model 49 | ${rdf4j.version} 50 | 51 | 52 | org.eclipse.rdf4j 53 | rdf4j-rio-api 54 | ${rdf4j.version} 55 | 56 | 57 | org.eclipse.rdf4j 58 | rdf4j-rio-rdfxml 59 | ${rdf4j.version} 60 | 61 | 62 | org.eclipse.rdf4j 63 | rdf4j-rio-turtle 64 | ${rdf4j.version} 65 | 66 | 67 | junit 68 | junit 69 | ${junit.version} 70 | test 71 | 72 | 73 | 74 | 75 | 76 | 77 | org.apache.maven.plugins 78 | maven-enforcer-plugin 79 | 3.6.1 80 | 81 | 82 | enforce-maven 83 | 84 | enforce 85 | 86 | 87 | 88 | 89 | 3.6.3 90 | 91 | 92 | 11 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | org.apache.maven.plugins 101 | maven-compiler-plugin 102 | 3.14.0 103 | 104 | 11 105 | 11 106 | true 107 | true 108 | true 109 | 110 | 111 | 112 | maven-assembly-plugin 113 | 3.7.1 114 | 115 | 116 | jar-with-dependencies 117 | 118 | 119 | 120 | 121 | make-assembly 122 | package 123 | 124 | single 125 | 126 | 127 | 128 | 129 | 130 | org.apache.maven.plugins 131 | maven-source-plugin 132 | 3.3.1 133 | 134 | 135 | attach-sources 136 | 137 | jar-no-fork 138 | 139 | 140 | 141 | 142 | 143 | org.apache.maven.plugins 144 | maven-javadoc-plugin 145 | 3.11.2 146 | 147 | 8 148 | 149 | 150 | 151 | attach-javadocs 152 | 153 | jar 154 | 155 | 156 | 157 | 158 | 159 | org.sonatype.central 160 | central-publishing-maven-plugin 161 | 0.8.0 162 | true 163 | 164 | central 165 | true 166 | published 167 | 168 | 169 | 170 | org.apache.maven.plugins 171 | maven-gpg-plugin 172 | 3.2.8 173 | 174 | 175 | sign-artifacts 176 | verify 177 | 178 | sign 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | central 189 | https://central.sonatype.com/repository/maven-snapshots/ 190 | 191 | 192 | central 193 | https://central.sonatype.com/repository/maven-snapshots/ 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /src/main/resources/onto/ops.ttl: -------------------------------------------------------------------------------- 1 | @prefix dc: . 2 | @prefix owl: . 3 | @prefix qudt: . 4 | @prefix rdf: . 5 | @prefix rdfs: . 6 | @prefix skos: . 7 | @prefix xsd: . 8 | @prefix ops: . 9 | @prefix quantity: . 10 | 11 | ops:Molar 12 | rdf:type qudt:MolarConcentrationUnit , qudt:SIDerivedUnit ; 13 | rdfs:label "Molar"^^xsd:string ; 14 | qudt:abbreviation "M"^^xsd:string ; 15 | qudt:conversionMultiplier 16 | 1000 ; 17 | qudt:conversionOffset 18 | "0.0"^^xsd:double ; 19 | qudt:symbol "mol/dm^3"^^xsd:string ; 20 | skos:exactMatch . 21 | 22 | ops:Millimolar 23 | rdf:type qudt:MolarConcentrationUnit , qudt:SIDerivedUnit ; 24 | rdfs:label "Millimolar"^^xsd:string ; 25 | qudt:abbreviation "mM"^^xsd:string ; 26 | qudt:conversionMultiplier 27 | 1 ; 28 | qudt:conversionOffset 29 | "0.0"^^xsd:double ; 30 | qudt:symbol "mmol/dm^3"^^xsd:string . 31 | 32 | ops:Micromolar 33 | rdf:type qudt:MolarConcentrationUnit , qudt:SIDerivedUnit ; 34 | rdfs:label "Micromolar"^^xsd:string ; 35 | qudt:abbreviation "μM"^^xsd:string ; 36 | qudt:conversionMultiplier 37 | 0.001 ; 38 | qudt:conversionOffset 39 | "0.0"^^xsd:double ; 40 | qudt:symbol "μmol/dm^3"^^xsd:string . 41 | 42 | ops:Nanomolar 43 | rdf:type qudt:MolarConcentrationUnit , qudt:SIDerivedUnit ; 44 | rdfs:label "Nanomolar"^^xsd:string ; 45 | qudt:abbreviation "nM"^^xsd:string ; 46 | qudt:conversionMultiplier 47 | 0.000001 ; 48 | qudt:conversionOffset 49 | "0.0"^^xsd:double ; 50 | qudt:symbol "nmol/dm^3"^^xsd:string . 51 | 52 | ops:Picomolar 53 | rdf:type qudt:MolarConcentrationUnit , qudt:SIDerivedUnit ; 54 | rdfs:label "Picomolar"^^xsd:string ; 55 | qudt:abbreviation "pM"^^xsd:string ; 56 | qudt:conversionMultiplier 57 | 0.000000001 ; 58 | qudt:conversionOffset 59 | "0.0"^^xsd:double ; 60 | qudt:symbol "pmol/dm^3"^^xsd:string . 61 | 62 | ops:Femtomolar 63 | rdf:type qudt:MolarConcentrationUnit , qudt:SIDerivedUnit ; 64 | rdfs:label "Femtomolar"^^xsd:string ; 65 | qudt:abbreviation "fM"^^xsd:string ; 66 | qudt:conversionMultiplier 67 | 0.000000000001 ; 68 | qudt:conversionOffset 69 | "0.0"^^xsd:double ; 70 | qudt:symbol "fmol/dm^3"^^xsd:string . 71 | 72 | ops:GramPerLiter 73 | rdf:type qudt:MassPerVolumeUnit, qudt:SIDerivedUnit, qudt:DerivedUnit ; 74 | rdfs:label "Gram per Liter"^^xsd:string ; 75 | qudt:abbreviation "g/L"^^xsd:string ; 76 | qudt:conversionMultiplier 1.0 ; 77 | qudt:conversionOffset 0.0 ; 78 | qudt:symbol "g/dm^3"^^xsd:string . 79 | 80 | ops:GramPerMilliliter 81 | rdf:type qudt:MassPerVolumeUnit, qudt:SIDerivedUnit, qudt:DerivedUnit ; 82 | rdfs:label "Gram per Milliliter"^^xsd:string ; 83 | qudt:abbreviation "g/mL"^^xsd:string ; 84 | qudt:conversionMultiplier 1000000.0 ; 85 | qudt:conversionOffset 0.0 ; 86 | qudt:symbol "g/cm^3"^^xsd:string . 87 | 88 | ops:MilligramPerMilliliter 89 | rdf:type qudt:MassPerVolumeUnit, qudt:SIDerivedUnit, qudt:DerivedUnit ; 90 | rdfs:label "Milligram per Milliliter"^^xsd:string ; 91 | qudt:abbreviation "mg/mL"^^xsd:string ; 92 | qudt:conversionMultiplier 1000.0 ; 93 | qudt:conversionOffset 0.0 ; 94 | qudt:symbol "mg/cm^3"^^xsd:string . 95 | 96 | ops:MicrogramPerMilliliter 97 | rdf:type qudt:MassPerVolumeUnit, qudt:SIDerivedUnit, qudt:DerivedUnit ; 98 | rdfs:label "Microgram per Milliliter"^^xsd:string ; 99 | qudt:abbreviation "μg/mL"^^xsd:string ; 100 | qudt:conversionMultiplier 1.0 ; 101 | qudt:conversionOffset 0.0 ; 102 | qudt:symbol "μg/cm^3"^^xsd:string . 103 | 104 | ops:NanogramPerMilliliter 105 | rdf:type qudt:MassPerVolumeUnit, qudt:SIDerivedUnit, qudt:DerivedUnit ; 106 | rdfs:label "Nanogram per Milliliter"^^xsd:string ; 107 | qudt:abbreviation "ng/mL"^^xsd:string ; 108 | qudt:conversionMultiplier 0.001 ; 109 | qudt:conversionOffset 0.0 ; 110 | qudt:symbol "ng/cm^3"^^xsd:string . 111 | 112 | ops:PicogramPerMilliliter 113 | rdf:type qudt:MassPerVolumeUnit, qudt:SIDerivedUnit, qudt:DerivedUnit ; 114 | rdfs:label "Picogram per Milliliter"^^xsd:string ; 115 | qudt:abbreviation "pg/mL"^^xsd:string ; 116 | qudt:conversionMultiplier 0.000001 ; 117 | qudt:conversionOffset 0.0 ; 118 | qudt:symbol "pg/cm^3"^^xsd:string . 119 | 120 | ops:MilligramPerDeciliter 121 | rdf:type qudt:MassPerVolumeUnit, qudt:SIDerivedUnit, qudt:DerivedUnit ; 122 | rdfs:label "Milligram per Deciliter"^^xsd:string ; 123 | qudt:abbreviation "mg/dL"^^xsd:string ; 124 | qudt:conversionMultiplier 100.0 ; 125 | qudt:conversionOffset 0.0 . 126 | 127 | ops:Nanometer 128 | rdf:type qudt:LengthUnit, qudt:SIDerivedUnit, qudt:DerivedUnit ; 129 | rdfs:label "Nanometer"^^xsd:string ; 130 | qudt:abbreviation "nm"^^xsd:string ; 131 | qudt:conversionMultiplier 0.00000001 ; 132 | qudt:conversionOffset 0.0 . 133 | 134 | ops:SquareAngstrom 135 | rdf:type qudt:AreaUnit, qudt:SIDerivedUnit ; 136 | rdfs:label "Square Ångström"^^xsd:string ; 137 | qudt:abbreviation "Å^2"^^xsd:string ; 138 | qudt:conversionMultiplier 139 | 0.00000000000000000001 ; 140 | qudt:conversionOffset 141 | "0.0"^^xsd:double ; 142 | qudt:symbol "Å^2"^^xsd:string . 143 | 144 | ops:Milligram 145 | rdf:type qudt:MassUnit, qudt:SIDerivedUnit ; 146 | rdfs:label "Milligram"^^xsd:string ; 147 | qudt:abbreviation "mg"^^xsd:string ; 148 | qudt:conversionMultiplier 149 | 0.000001 ; 150 | qudt:conversionOffset 151 | "0.0"^^xsd:double ; 152 | qudt:symbol "mg"^^xsd:string . 153 | 154 | ops:Microgram 155 | rdf:type qudt:MassUnit, qudt:SIDerivedUnit ; 156 | rdfs:label "Microgram"^^xsd:string ; 157 | qudt:abbreviation "μg"^^xsd:string ; 158 | qudt:conversionMultiplier 159 | 0.000000001 ; 160 | qudt:conversionOffset 161 | "0.0"^^xsd:double ; 162 | qudt:symbol "μg"^^xsd:string . 163 | 164 | ops:Nanogram 165 | rdf:type qudt:MassUnit, qudt:SIDerivedUnit ; 166 | rdfs:label "Nanogram"^^xsd:string ; 167 | qudt:abbreviation "ng"^^xsd:string ; 168 | qudt:conversionMultiplier 169 | 0.000000000001 ; 170 | qudt:conversionOffset 171 | "0.0"^^xsd:double ; 172 | qudt:symbol "μg"^^xsd:string . 173 | 174 | ops:Picogram 175 | rdf:type qudt:MassUnit, qudt:SIDerivedUnit ; 176 | rdfs:label "Picogram"^^xsd:string ; 177 | qudt:abbreviation "pg"^^xsd:string ; 178 | qudt:conversionMultiplier 179 | 0.000000000000001 ; 180 | qudt:conversionOffset 181 | "0.0"^^xsd:double ; 182 | qudt:symbol "pg"^^xsd:string . 183 | 184 | ops:Femtogram 185 | rdf:type qudt:MassUnit, qudt:SIDerivedUnit ; 186 | rdfs:label "Femtogram"^^xsd:string ; 187 | qudt:abbreviation "fg"^^xsd:string ; 188 | qudt:conversionMultiplier 189 | 0.000000000000000001 ; 190 | qudt:conversionOffset 191 | "0.0"^^xsd:double ; 192 | qudt:symbol "fg"^^xsd:string . 193 | 194 | ops:MilligramPerKilogram 195 | rdf:type qudt:SIDerivedUnit ; 196 | rdfs:label "Milligram per Kilogram"^^xsd:string ; 197 | qudt:abbreviation "mg/kg"^^xsd:string ; 198 | qudt:symbol "mg/kg"^^xsd:string . 199 | 200 | ops:Millimole 201 | rdf:type qudt:AmountOfSubstanceUnit, qudt:SIDerivedUnit ; 202 | rdfs:label "Millimole"^^xsd:string ; 203 | qudt:abbreviation "mmol"^^xsd:string ; 204 | qudt:conversionMultiplier 205 | 0.001 ; 206 | qudt:conversionOffset 207 | "0.0"^^xsd:double ; 208 | qudt:symbol "mmol"^^xsd:string . 209 | 210 | ops:Micromole 211 | rdf:type qudt:AmountOfSubstanceUnit, qudt:SIDerivedUnit ; 212 | rdfs:label "Micromole"^^xsd:string ; 213 | qudt:abbreviation "μmol"^^xsd:string ; 214 | qudt:conversionMultiplier 215 | 0.000001 ; 216 | qudt:conversionOffset 217 | "0.0"^^xsd:double ; 218 | qudt:symbol "μmol"^^xsd:string . 219 | 220 | ops:Nanomole 221 | rdf:type qudt:AmountOfSubstanceUnit, qudt:SIDerivedUnit ; 222 | rdfs:label "Nanomole"^^xsd:string ; 223 | qudt:abbreviation "nmol"^^xsd:string ; 224 | qudt:conversionMultiplier 225 | 0.000000001 ; 226 | qudt:conversionOffset 227 | "0.0"^^xsd:double ; 228 | qudt:symbol "nmol"^^xsd:string . 229 | 230 | ops:Picomole 231 | rdf:type qudt:AmountOfSubstanceUnit, qudt:SIDerivedUnit ; 232 | rdfs:label "Picomole"^^xsd:string ; 233 | qudt:abbreviation "pmol"^^xsd:string ; 234 | qudt:conversionMultiplier 235 | 0.000000000001 ; 236 | qudt:conversionOffset 237 | "0.0"^^xsd:double ; 238 | qudt:symbol "pmol"^^xsd:string . 239 | 240 | ops:Femtomole 241 | rdf:type qudt:AmountOfSubstanceUnit, qudt:SIDerivedUnit ; 242 | rdfs:label "Femtomole"^^xsd:string ; 243 | qudt:abbreviation "fmol"^^xsd:string ; 244 | qudt:conversionMultiplier 245 | 0.000000000000001 ; 246 | qudt:conversionOffset 247 | "0.0"^^xsd:double ; 248 | qudt:symbol "fmol"^^xsd:string . 249 | 250 | ops:Milliliter 251 | rdf:type qudt:VolumeUnit, qudt:SIDerivedUnit ; 252 | rdfs:label "Milliliter"^^xsd:string ; 253 | qudt:abbreviation "mL"^^xsd:string ; 254 | qudt:conversionMultiplier 255 | 0.001 ; 256 | qudt:conversionOffset 257 | "0.0"^^xsd:double ; 258 | qudt:symbol "mL"^^xsd:string . 259 | 260 | ops:Microliter 261 | rdf:type qudt:VolumeUnit, qudt:SIDerivedUnit ; 262 | rdfs:label "Microliter"^^xsd:string ; 263 | qudt:abbreviation "μL"^^xsd:string ; 264 | qudt:conversionMultiplier 265 | 0.000001 ; 266 | qudt:conversionOffset 267 | "0.0"^^xsd:double ; 268 | qudt:symbol "μL"^^xsd:string . 269 | 270 | ops:PartsPerMillion 271 | rdf:type qudt:QuantityKind ; 272 | qudt:quantityKind quantity:DimensionlessRatio ; 273 | rdfs:label "Parts per Million"^^xsd:string ; 274 | qudt:symbol "ppm"^^xsd:string . 275 | 276 | ops:LiterPerKilogram 277 | rdf:type qudt:VolumePerMassUnit, qudt:SIDerivedUnit ; 278 | rdfs:label "liter per kilogram"^^xsd:string ; 279 | qudt:abbreviation "l/kg"^^xsd:string ; 280 | qudt:conversionMultiplier 281 | 0.001 ; 282 | qudt:conversionOffset 283 | "0.0"^^xsd:double ; 284 | qudt:symbol "l/kg"^^xsd:string . 285 | 286 | ops:MilliliterPerKilogram 287 | rdf:type qudt:VolumePerMassUnit, qudt:SIDerivedUnit ; 288 | rdfs:label "milliliter per kilogram"^^xsd:string ; 289 | qudt:abbreviation "ml/kg"^^xsd:string ; 290 | qudt:conversionMultiplier 291 | 0.000001 ; 292 | qudt:conversionOffset 293 | "0.0"^^xsd:double ; 294 | qudt:symbol "ml/kg"^^xsd:string . 295 | 296 | ops:LiterPerSecond 297 | rdf:type qudt:VolumePerTimeUnit, qudt:SIDerivedUnit ; 298 | rdfs:label "liter per second"^^xsd:string ; 299 | qudt:abbreviation "L/s"^^xsd:string ; 300 | qudt:conversionMultiplier 301 | 0.001 ; 302 | qudt:conversionOffset 303 | "0.0"^^xsd:double ; 304 | qudt:symbol "L/s"^^xsd:string . 305 | 306 | ops:LiterPerMinute 307 | rdf:type qudt:VolumePerTimeUnit, qudt:SIDerivedUnit ; 308 | rdfs:label "liter per minute"^^xsd:string ; 309 | qudt:abbreviation "L/min"^^xsd:string ; 310 | qudt:conversionMultiplier 311 | 0.06 ; 312 | qudt:conversionOffset 313 | "0.0"^^xsd:double ; 314 | qudt:symbol "L/min"^^xsd:string . 315 | 316 | ops:MicroliterPerMinute 317 | rdf:type qudt:VolumePerTimeUnit, qudt:SIDerivedUnit ; 318 | rdfs:label "microliter per minute"^^xsd:string ; 319 | qudt:abbreviation "μL/min"^^xsd:string ; 320 | qudt:conversionMultiplier 321 | 0.00000006 ; 322 | qudt:conversionOffset 323 | "0.0"^^xsd:double ; 324 | qudt:symbol "μL/min"^^xsd:string . 325 | 326 | -------------------------------------------------------------------------------- /src/main/resources/onto/dimension: -------------------------------------------------------------------------------- 1 | 2 | 59 | 60 | 61 | 1 62 | 63 | 64 | 65 | 66 | reference quantity 67 | 68 | 69 | 70 | 71 | dimension inverse 72 | 73 | 74 | 75 | 76 | 77 | 78 | A dimension vector is an association between a quantity kind and a rational number. The quantity kind serves as the basis vector in an abstract vector space, and the rational number is the vector magnitude. The abstract vector space is determined by the chosen set of base quantity kinds for a quantity system. 79 | 80 | 81 | 82 | 83 | Dimension Vector 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 1 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 1 104 | 105 | 106 | 107 | 1.1 108 | QUDT, or the 'Quantity, Unit, Dimension and Types' ontology defines the base classes properties, and restrictions used for modeling physical quantities, units of measure, and their dimensions in various measurement systems. In physics and science, dimensional analysis is a tool to find or check relations among physical quantities by using their dimensions. The dimension of a physical quantity is the combination of the basic physical dimensions (usually mass, length, time, electric charge, and temperature) which describe it; for example, speed has the dimension length / time, and may be measured in meters per second, miles per hour, or other units. 109 | 110 | QUDT Dimension Ontology 111 | 112 | 1 113 | 114 | QUDT 115 | Ralph Hodgson 116 | 117 | All disciplines 118 | 119 | James E. Masters 120 | 121 | David Price 122 | dimension 123 | Science, Medicine and Engineering 124 | $Id: OSG_dimension-(v1.1).ttl 4988 2011-06-01 20:34:19Z RalphHodgson $ 125 | 126 | The QUDT Ontologies are issued under a Creative Commons Attribution Share Alike 3.0 United States License. Attribution should be made to NASA Ames Research Center and TopQuadrant, Inc. 127 | Irene Polikoff 128 | 129 | Quantities, Units, and Dimensions 130 | 131 | 132 | $LastChangedDate: 2011-06-01 13:34:19 -0700 (Wed, 01 Jun 2011) $ 133 | 2010-12-30T11:17:52 134 | 135 | 136 | QUDT Dimension Ontology Version 1.1 137 | Basic treatment of quantities and units. No dimensional treatment in this graph. 138 | 139 | 140 | 141 | 142 | 143 | http://qudt.org/schema/dimension 144 | 145 | The intent of the QUDT Dimensions Ontology is to provide an OWL Schema for dimensional specificaiton and analysis of units of measure. 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | dimension vector 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | A dimension is a relationship between a quantity system, a quantity kind of that system, and one or more dimension vectors. There is one dimension vector for each of the system's base quantity kinds. The vector's magnitude determines the exponent of the base dimension for the referenced quantity kind. 166 | 167 | 168 | 169 | 170 | 171 | Dimension 172 | 173 | 174 | 175 | 176 | 1 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /src/main/resources/onto/dtype: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 1 32 | 33 | 34 | 35 | The property 'dtype:value' is a general property that in some cases could have scalar values and in other cases may refer to a first class concept that is a 'value object'. For this reason, the type of this property is set as 'rdf:Property' and the property is rangeless. 36 | value 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 1 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | code 57 | 58 | 59 | 60 | A codelist is a controlled vocabulary of terms that are used to represent permissible values of a variable in information systems. The representaiton of codes in 'dtype' has been influenced by CCTS and UBL. 61 | 62 | Enumeration 63 | 64 | 65 | 66 | 67 | 1 68 | 69 | 70 | 71 | A type that serves as a container for the enumerated values of an enumeration. This enables the enumeration itself to be referenceable. One need for this is in determing the default value of an enumeration , another need is in the management of sub-enumerations and composite enumerations. 72 | 73 | 74 | 75 | 76 | VAEM Enumeration 77 | 78 | 79 | 80 | The base class for datatypes that have values that are restriced to a set of literals or tokens. The members of the restriction may themselve be restriced by facets that apply to scalar data types. 81 | 82 | 83 | Metadata Enumerated value 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1 96 | 97 | 98 | 99 | 100 | 101 | A derived codelist is a sublist of another codelist. The members that it has must be members of the source list. 102 | 103 | 104 | 105 | 106 | Derived Code List 107 | 108 | 109 | 110 | A property for specifying how member elements make up a data structure. 111 | has member 112 | 113 | 114 | 115 | 116 | 1 117 | 118 | 119 | 120 | A property for expressing an encoded value. The range has been set to 'xsd:anySimpleType' to allow for a variety of scalar datatypes. 121 | 122 | code 123 | 124 | 125 | 126 | 127 | 1 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | A value reference is a pointer to an Enumerated Value. The original position of the value can be overridden by the position attribute. 137 | 138 | 139 | 140 | 141 | Value Reference 142 | 143 | 144 | 145 | 146 | 147 | A composite codelist is a codelist made up of other codelists. It does not introduce any new codes. 148 | 149 | 150 | Composite code list 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 1 161 | 162 | 163 | 164 | 165 | 166 | A simple codelist is one made up only of enumerated values. 167 | 168 | 169 | Simple code list 170 | 171 | 172 | 173 | An indirection pointer for relating a slot in am occurrence data structure, such as 'dtype:ValueReference' with another resource. 174 | refers to 175 | 176 | 177 | 178 | A property for specifying a derivation relationship. 179 | derived from 180 | 181 | 182 | 183 | The property 'dtype:orderIndex' is an annotation property to specify a position that some value or structure will have. One use is to specify the place that a resource has in a sequence. One use is on property occurrences in class axioms. Here 'vaem:orderIndex' is placed on a restriction to specify how that property may be transformed into a representation where ordering has some importance, for example, in XML Schema sequences. 184 | 185 | order index 186 | 187 | 188 | 189 | 190 | 1 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | Datatype Ontology 207 | http://www.linkedmodel.org/schema/dtype 208 | 209 | The ontology 'dtype' provides a specification of simple data types such as enumerations. These are needed in support of the conversion of XML Schemas and UML Models to OWL. Codelists are also defined in 'dtype'. 210 | 2011-29-05 211 | 212 | 213 | 214 | To provide a foundation for data types. 215 | Datatypes 216 | 217 | Created with TopBraid Composer 218 | 1 219 | 220 | Datatype Ontology 221 | dtype 222 | 223 | 224 | DTYPE 225 | 1.0 226 | The LinkedModel DTYPE Ontology is issued under a Creative Commons Attribution Share Alike 3.0 United States License. Attribution should be made to <a href="http://www.topquadrant.com">TopQuadrant, Inc.</a>. 227 | 228 | 229 | 230 | 231 | The property 'dtype:defaultValue' is a general property for specifying a value in situations where none is specified, or can be determined. In some cases of use, this property could have a scalar value and in other cases may need to refer to a first class concept that holds a 'value object'. For this reason, the type of this property is set as 'rdf:Property' and the property is rangeless. 232 | default value 233 | 234 | 235 | 236 | 237 | 1 238 | 239 | 240 | 241 | 242 | 1 243 | 244 | 245 | 246 | The property 'dtype:order' provides a means to specify a precedence. One use of order is in specifying ordered enumerations such as 'voag:ConfidentialityLevel'. A similar property, but with an important type difference, is 'vaem:orderIndex'. This is for use on property occurrences in class axioms where it can be placed on a restriction to specify how that property may be transformed into other representations where ordering has some importance, for example, in XML Schema sequences. Whereas 'vaem:order' is a datatype property, 'vaem:orderIndex' is an annotation property. 247 | 248 | 249 | order 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | Aproperty for constructing composite data structures 259 | composite of 260 | 261 | 262 | 263 | 264 | 1 265 | 266 | 267 | 268 | A general purpose property for holding string literals. 269 | 270 | literal 271 | 272 | 273 | 274 | 275 | 0 276 | 277 | 278 | 279 | 280 | 281 | -------------------------------------------------------------------------------- /src/main/resources/onto/ops: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Molar 11 | 12 | 13 | M 14 | 15 | 16 | 1000 17 | 18 | 19 | 0.0 20 | 21 | 22 | mol/dm^3 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Millimolar 35 | 36 | 37 | mM 38 | 39 | 40 | 1 41 | 42 | 43 | 0.0 44 | 45 | 46 | mmol/dm^3 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Micromolar 56 | 57 | 58 | μM 59 | 60 | 61 | 0.001 62 | 63 | 64 | 0.0 65 | 66 | 67 | μmol/dm^3 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | Nanomolar 77 | 78 | 79 | nM 80 | 81 | 82 | 0.000001 83 | 84 | 85 | 0.0 86 | 87 | 88 | nmol/dm^3 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | Picomolar 98 | 99 | 100 | pM 101 | 102 | 103 | 0.000000001 104 | 105 | 106 | 0.0 107 | 108 | 109 | pmol/dm^3 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | Femtomolar 119 | 120 | 121 | fM 122 | 123 | 124 | 0.000000000001 125 | 126 | 127 | 0.0 128 | 129 | 130 | fmol/dm^3 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | Gram per Liter 143 | 144 | 145 | g/L 146 | 147 | 148 | 1.0 149 | 150 | 151 | 0.0 152 | 153 | 154 | g/dm^3 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | Gram per Milliliter 167 | 168 | 169 | g/mL 170 | 171 | 172 | 1000000.0 173 | 174 | 175 | 0.0 176 | 177 | 178 | g/cm^3 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | Milligram per Milliliter 191 | 192 | 193 | mg/mL 194 | 195 | 196 | 1000.0 197 | 198 | 199 | 0.0 200 | 201 | 202 | mg/cm^3 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | Microgram per Milliliter 215 | 216 | 217 | μg/mL 218 | 219 | 220 | 1.0 221 | 222 | 223 | 0.0 224 | 225 | 226 | μg/cm^3 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | Nanogram per Milliliter 239 | 240 | 241 | ng/mL 242 | 243 | 244 | 0.001 245 | 246 | 247 | 0.0 248 | 249 | 250 | ng/cm^3 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | Picogram per Milliliter 263 | 264 | 265 | pg/mL 266 | 267 | 268 | 0.000001 269 | 270 | 271 | 0.0 272 | 273 | 274 | pg/cm^3 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | Milligram per Deciliter 287 | 288 | 289 | mg/dL 290 | 291 | 292 | 100.0 293 | 294 | 295 | 0.0 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | Nanometer 308 | 309 | 310 | nm 311 | 312 | 313 | 0.00000001 314 | 315 | 316 | 0.0 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | Square Ångström 326 | 327 | 328 | Å^2 329 | 330 | 331 | 0.00000000000000000001 332 | 333 | 334 | 0.0 335 | 336 | 337 | Å^2 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | Milligram 347 | 348 | 349 | mg 350 | 351 | 352 | 0.000001 353 | 354 | 355 | 0.0 356 | 357 | 358 | mg 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | Microgram 368 | 369 | 370 | μg 371 | 372 | 373 | 0.000000001 374 | 375 | 376 | 0.0 377 | 378 | 379 | μg 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | Nanogram 389 | 390 | 391 | ng 392 | 393 | 394 | 0.000000000001 395 | 396 | 397 | 0.0 398 | 399 | 400 | μg 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | Picogram 410 | 411 | 412 | pg 413 | 414 | 415 | 0.000000000000001 416 | 417 | 418 | 0.0 419 | 420 | 421 | pg 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | Femtogram 431 | 432 | 433 | fg 434 | 435 | 436 | 0.000000000000000001 437 | 438 | 439 | 0.0 440 | 441 | 442 | fg 443 | 444 | 445 | 446 | 447 | 448 | Milligram per Kilogram 449 | 450 | 451 | mg/kg 452 | 453 | 454 | mg/kg 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | Millimole 464 | 465 | 466 | mmol 467 | 468 | 469 | 0.001 470 | 471 | 472 | 0.0 473 | 474 | 475 | mmol 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | Micromole 485 | 486 | 487 | μmol 488 | 489 | 490 | 0.000001 491 | 492 | 493 | 0.0 494 | 495 | 496 | μmol 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | Nanomole 506 | 507 | 508 | nmol 509 | 510 | 511 | 0.000000001 512 | 513 | 514 | 0.0 515 | 516 | 517 | nmol 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | Picomole 527 | 528 | 529 | pmol 530 | 531 | 532 | 0.000000000001 533 | 534 | 535 | 0.0 536 | 537 | 538 | pmol 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | Femtomole 548 | 549 | 550 | fmol 551 | 552 | 553 | 0.000000000000001 554 | 555 | 556 | 0.0 557 | 558 | 559 | fmol 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | Milliliter 569 | 570 | 571 | mL 572 | 573 | 574 | 0.001 575 | 576 | 577 | 0.0 578 | 579 | 580 | mL 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | Microliter 590 | 591 | 592 | μL 593 | 594 | 595 | 0.000001 596 | 597 | 598 | 0.0 599 | 600 | 601 | μL 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | Parts per Million 611 | 612 | 613 | ppm 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | liter per kilogram 623 | 624 | 625 | l/kg 626 | 627 | 628 | 0.001 629 | 630 | 631 | 0.0 632 | 633 | 634 | l/kg 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | milliliter per kilogram 644 | 645 | 646 | ml/kg 647 | 648 | 649 | 0.000001 650 | 651 | 652 | 0.0 653 | 654 | 655 | ml/kg 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | liter per second 665 | 666 | 667 | L/s 668 | 669 | 670 | 0.001 671 | 672 | 673 | 0.0 674 | 675 | 676 | L/s 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | liter per minute 686 | 687 | 688 | L/min 689 | 690 | 691 | 0.06 692 | 693 | 694 | 0.0 695 | 696 | 697 | L/min 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | microliter per minute 707 | 708 | 709 | μL/min 710 | 711 | 712 | 0.00000006 713 | 714 | 715 | 0.0 716 | 717 | 718 | μL/min 719 | 720 | 721 | --------------------------------------------------------------------------------