@prefix unit:    <http://qudt.org/vocab/unit#>.
@prefix qudt:    <http://qudt.org/schema/qudt#> .
@prefix qudt-quantity:  <http://qudt.org/vocab/quantity#> .
@prefix qudt-dimension:  <http://qudt.org/vocab/dimension#> .
@prefix unity:          <http://bitbucket.org/nxg/unity/ns/schema#>.
@prefix unity-unit:     <http://bitbucket.org/nxg/unity/ns/unit#>.
@prefix unity-quantity: <http://bitbucket/org/nxg/unity/ns/quantity#>.
@prefix unity-dimension: <http://bitbucket/org/nxg/unity/ns/dimension#>.
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

unit:Meter
    unity:preferredLabel "Metre".

unit:Gram
    unity:preferredLabel "Gramme".

# In most (all?) cases, the type of the following classes (eg
# unity-unit:JulianYear a qudt:TimeUnit) is deducible from the quantityKind
# (qudt-quantity:Time in this case), but since we don't have a
# built-in reasoner, and Norman doesn't want to include a
# pre-coordinating reasoner as part of the build (becuase people
# shouldn't be obliged to install one just in order to edit this
# file), we make this explicit by hand.

unity-unit:ADU
    a qudt:CountingUnit;
    qudt:quantityKind qudt-quantity:Dimensionless;
    qudt:description "Same as channel???";
    rdfs:label "ADU".

unity-unit:Beam
    a qudt:CountingUnit;
    qudt:quantityKind qudt-quantity:Dimensionless;
    qudt:description "as in Jy/beam";
    rdfs:label "beam".

unity-unit:Crab
    a qudt:RadiometryUnit;
    qudt:quantityKind unity-quantity:SpecificIntensity;
    qudt:description """The flux density, relative to that of the Crab.
Mentioned in the OGIP standard, but strongly disrecommended.
The OGIP standard permits only 'm' as a prefix.""";
    rdfs:label "Crab".

unity-unit:DetectorChannel
    a qudt:CountingUnit;
    qudt:quantityKind qudt-quantity:Dimensionless;
    qudt:description "One channel in a detector of some type";
    rdfs:label "chan".

unity-unit:DistributionBin
    a qudt:CountingUnit;        # is this correct?
    qudt:quantityKind qudt-quantity:Dimensionless;
    qudt:description "One division within a distribution";
    rdfs:label "bin".

unity-unit:Jansky
    a qudt:RadiometryUnit;
    qudt:quantityKind unity-quantity:SpecificIntensity;
    qudt:description "10^-26 W m-2 Hz-1";
    rdfs:label "Jy".

unity-unit:JulianYear
    qudt:quantityKind qudt-quantity:Time;
    a qudt:TimeUnit;
    qudt:description "31 557 600s (365.25d), peta a (Pa) forbidden";
    rdfs:label "Julian year".

unity-unit:JulianCentury
    qudt:quantityKind qudt-quantity:Time;
    a qudt:TimeUnit;
    qudt:description "One hundred Julian Years";
    rdfs:label "Julian Century".

unity-unit:BesselianYear
    qudt:quantityKind qudt-quantity:Time;
    a qudt:TimeUnit;
    qudt:description """The Besselian Year.
See the discussion in FITS WCS paper IV (section 4.2), and FITS v4.0 (section 9.3)
for important caveats concerning the use of the Besselian and Tropical years.""";
    rdfs:label "Bessellian Year".

qudt:YearTropical
    qudt:description """The Tropical Year.
See the discussion in FITS WCS paper IV (section 4.2), and FITS v4.0 (section 9.3)
for important caveats concerning the use of the Besselian and Tropical years.""".

unity-unit:MilliArcSecond
    qudt:quantityKind qudt-quantity:PlaneAngle;
    a qudt:AngleUnit;
    qudt:description "1/1000 of an arc-second, for use in those syntaxes which do not allow SI prefixes of arcsec";
    rdfs:label "mas".

unity-unit:Photon
    a qudt:CountingUnit;
    qudt:quantityKind qudt-quantity:Dimensionless;
    qudt:description "as in ev/photon";
    rdfs:label "ph".

unity-unit:Pixel                # it's rather surprising this isn't in the QUDT set
    a qudt:CountingUnit;
    qudt:quantityKind qudt-quantity:Dimensionless;
    qudt:description "an element of a 2-D image";
    rdfs:label "pixel".

unity-unit:Rayleigh
    a qudt:RadiometryUnit;
    qudt:quantityKind unity-unit:PhotonFlux;
    qudt:description """Unit of photon flux density: Wikipedia has units of 10^10 photons/m2/column/s.
The FITS spec has units of 1e10/(4PI) photons m-2 s-2 sr-1.
See http://en.wikipedia.org/wiki/Rayleigh_(unit).
No, I don't know how to express its dimensions in the QUDT system!
We go with the FITS definition here.""";
    rdfs:label "R".

unity-unit:Rydberg
    a qudt:EnergyAndWorkUnit, qudt:AtomicPhysicsUnit;
    qudt:quantityKind qudt-quantity:EnergyAndWork;
    qudt:description "Half of the Hartree energy, defined as 13.605692 eV.  See http://en.wikipedia.org/wiki/Hartree";
    rdfs:label "Ry".

unity-unit:SolarLuminosity
    a qudt:PowerUnit;
    qudt:quantityKind qudt-quantity:Power;
    qudt:description "3.8268e26 W";
    unity:latexform "L\\solar";
    rdfs:label "solLum".

unity-unit:SolarMass
    a qudt:MassUnit;
    qudt:quantityKind qudt-quantity:Mass;
    rdfs:label "Solar mass";
    qudt:description "The mass of the sun is 1.9891e30 kg";
    qudt:symbol "solMass";
    unity:latexform "M\\solar";
    rdfs:label "solMass".

unity-unit:SolarRadius
    a qudt:LengthUnit;
    qudt:quantityKind qudt-quantity:Length;
    qudt:description "6.9599e8 m";
    unity:latexform "R\\solar";
    rdfs:label "solRad".

unity-unit:StellarMagnitude
    a qudt:RadiantIntensityUnit, qudt:LogarithmicUnit, qudt:DimensionlessUnit;
    #qudt:quantityKind qudt-quantity:Dimensionless; # this seems vague....
    qudt:quantityKind unity-quantity:StellarMagnitudeQuantityKind; # ???
    qudt:description "Log of a ratio of intensities.  See http://en.wikipedia.org/wiki/Magnitude_(astronomy)";
    rdfs:label "mag".

unity-unit:Voxel
    a qudt:CountingUnit;
    qudt:quantityKind qudt-quantity:Dimensionless;
    qudt:description "The 3-D analogue of a pixel";
    rdfs:label "voxel".

# There's also mention of a unit Sun, for abundances, etc (which is weird, \odot)

unity-quantity:SpecificIntensity
    a qudt:RadiometryQuantityKind;
    qudt:description "Specific intensity is power per unit area per Hertz". # XXX check this!

# I _think_ this is a separate QuantityKind (in QUDT terms), because
# magnitudes are comparable only with other magnitudes.
# Or should this be simply http://qudt.org/vocab/quantity#Dimensionless ?
unity-quantity:StellarMagnitudeQuantityKind
    a qudt:RadiometryQuantityKind;
    rdfs:label "Stellar Magnitudes"^^xsd:label;
    qudt:description "Log of a ratio of intensities.  See http://en.wikipedia.org/wiki/Magnitude_(astronomy)";
    qudt:generalization qudt-quantity:DimensionlessRatio.

qudt-dimension:Dimension_SI_MT-2 # W m-2 Hz-1 = (kg m2 s-2) s-1 m-2 s = kg s-2
    qudt:referenceQuantity unity-quantity:SpecificIntensity.

unity-dimension:Dimension_SI_L-2T-2  # XXX what namespace should this be in?
    a qudt:Dimension;
    rdfs:label "SI_L-2T-2";
    qudt:dimensionVector
        qudt-dimension:Vector_T-2,
        qudt-dimension:Vector_J0,
        qudt-dimension:Vector_M0,
        qudt-dimension:Vector_Θ0,
        qudt-dimension:Vector_I0,
        qudt-dimension:Vector_U0, # photons^1 sr^-1 => U0
        qudt-dimension:Vector_N0,
        qudt-dimension:Vector_L-2;
    qudt:referenceQuantity unity-unit:PhotonFlux;
    qudt:symbol "L^-2 T-2" .
unity-quantity:PhotonFlux             # XXX what namespace should this be in
    a qudt:MechanicsQuantityKind; # best match?
    rdfs:label "Photon flux".



# Misc
unit:Angstrom
    unity:latexform "\\angstrom".
unit:Ohm
    unity:latexform "\\ohm".
unit:Byte
    unity:latexform "\\byte".
unit:Bit
    unity:latexform "\\bit".
unit:Decibel
    unity:latexform "\\decibel".

# Lacunae
unit:Parsec   # 3.0857e16 m
    qudt:quantityKind qudt-quantity:Length.

qudt-quantity:InformationEntropy
    qudt:generalization qudt-quantity:Dimensionless.

unit:Percent
    unity:latexform "\\%".
