VarML

This is the home page for VarML.

CF metadata

This is the home page for work related to CF metadata, especially that connected with "standard names".

Standard Name grammar in Prolog

This is the home page for a grammar for CF-metadata "standard names" in Prolog.

Prolog source for CF-metadata Standard Names grammar

This page contains the actual Prolog grammar rules for CF-metadata "standard names".  

This is actually the master copy, which can be accessed by Prolog programs using an http library.    Therefore, if you have edit permissions for this page, please change the content below the horizontal line only of you know what you are doing!


standard_names --> standard_name1.
standard_names --> standard_name1, standard_names.

standard_name1  --> surface, component, standard_name, at_surface, in_medium,
                    due_to_process, where_type, assuming_condition.

standard_name  --> basename.

standard_name  --> [change,over,time,in], standard_name.
standard_name  --> [convergence], [of], standard_name.

standard_name  --> [horizontal], [convergence], [of], standard_name.
standard_name  --> [correlation,of], standard_name, [and], standard_name.
standard_name  --> [correlation,of], standard_name, [and], standard_name, [over], standard_name.
standard_name  --> [covariance,of], standard_name, [and], standard_name.
standard_name  --> [covariance,of], standard_name, [and], standard_name, [over], standard_name.
standard_name  --> direction, [derivative,of], standard_name.
standard_name  --> [derivative,of], standard_name, [wrt], standard_name.
standard_name  --> [direction,of], standard_name.
standard_name  --> [divergence,of], standard_name.
standard_name  --> [horizontal,divergence_of], standard_name.
standard_name  --> [histogram,of], standard_name.
standard_name  --> [histogram,of], standard_name, [over], standard_name.
standard_name  --> [integral,of], standard_name, [wrt], standard_name.


basename -->  [amount].
basename -->  [area].
basename -->  [area,fraction].
basename -->  [density].
basename -->  [energy].
basename -->  [energy,content].
basename -->  [energy,density].
basename -->  [frequency].
basename -->  [frequency,of,occurence].
basename -->  [heat,flux].
basename -->  [heat,transport].
basename -->  [horizontal,streamfunction].
basename -->  [horizontal,velocity,potential].
basename -->  [mass].
basename -->  [mass,flux].
basename -->  [mass,fraction].
basename -->  [mass,mixing,ratio].
basename -->  [mass,transport].
basename -->  [mole,fraction].
basename -->  [mole,flux].
basename -->  [momentum,flux].
basename -->  [partial,pressure].
basename -->  [period].
basename -->  [power].
basename -->  [pressure].
basename -->  [probability].
basename -->  [radiative,flux].
basename -->  [specific,eddy,kinetic,energy].
basename -->  [speed].
basename -->  [stress].
basename -->  [temperature].
basename -->  [thickness].
basename -->  [velocity].
basename -->  [volume].
basename -->  [volume,flux].
basename -->  [volume,fraction].
basename -->  [volume,transport].
basename -->  [vorticity].


assuming_condition --> [assuming], condition.
assuming_condition --> [].

condition --> [clear,sky].
condition --> [deep,snow].
condition --> [no,snow].


component --> direction, direction.
component --> direction.
component --> [].


direction --> [upward].
direction --> [downward].
direction --> [northward].
direction --> [southward].
direction --> [eastward].
direction --> [westward].
direction --> [x].
direction --> [y].
direction --> [].


in_medium --> [in], medium.
in_medium --> [].

medium -->    [air].
medium -->    [atmosphere,boundary,layer].
medium -->    [mesosphere].
medium -->    [sea,ice].
medium -->    [sea,water].
medium -->    [soil].
medium -->    [soil,water].
medium -->    [stratosphere].
medium -->    [thermosphere].
medium -->    [troposphere].


at_surface --> [at], surface.
at_surface --> [].

surface -->   [toa].
surface -->   [tropopause].
surface -->   [surface].
surface -->   [adiabatic,condensation,level].
surface -->   [cloud,top].
surface -->   [convective,cloud,top].
surface -->   [cloud,base].
surface -->   [convective,cloud,base].
surface -->   [freezing,level].
surface -->   [ground,level].
surface -->   [maximum,wind,speed,level].
surface -->   [sea,floor].
surface -->   [sea,ice,base].
surface -->   [sea,level].
surface -->   [top,of,atmosphere,boundary,layer].
surface -->   [top,of,atmosphere,model].
surface -->   [top,of,dry,convection].
surface -->   [].


due_to_process --> [due,to], process.
due_to_process --> [].

process -->   [advection].
process -->   [convection].
process -->   [deep,convection].
process -->   [diabatic,processes].
process -->   [diffusion].
process -->   [dry,convection].
process -->   [gravity,wave,drag].
process -->   [gyre].
process -->   [isostatic,adjustment].
process -->   [large,scale,precipitation].
process -->   [longwave,heating].
process -->   [moist,convection].
process -->   [overturning].
process -->   [shallow,convection].
process -->   [shortwave,heating].
process -->   [thermodynamics].


where_type --> [where], wheretype.
where_type --> [].

wheretype --> [cloud].
wheretype --> [land].
wheretype --> [open,sea].
wheretype --> [sea].
wheretype --> [sea,ice].
wheretype --> [vegetation].
wheretype --> [].

XSugar stylesheet for CF-metadata "standard names"

This page contains the XSugar stylesheet for inter-converting between CF-metadata's plain-text format for standard names and a corresponding XML format.   This stylesheet may be used for parsing standard names (i.e. check that they conform to rules specifying how such names may be constructed), as well as for conversion in either direction.

Note that everything below the horizontal line is that actual XSugar stylesheet - this is the master copy.  So only edit it if you know what you are doing!


/* Robert Muetzelfeldt
   16 Oct 2008
   This is a direct re-casting of the rules given in http://cf-pcmdi.llnl.gov/documents/cf-standard-names/guidelines for
   CF-metadata Standard Names in XSugar.  */



/* Notes:
'Substance' needs to be further analysed in terms of its constituent parts 
*/


BaseName           = amount|area|area_fraction|density|energy|energy_content|energy_density|frequency|frequency_of_occurence|heat_flux|heat_transport|horizontal_streamfunction|horizontal_velocity_potential|mass|mass_flux|mass_fraction|mass_mixing_ratio|mass_transport|mole_fraction|mole_flux|momentum_flux|partial_pressure|period|power|pressure|probability|radiative_flux|specific_eddy_kinetic_energy|speed|stress|temperature|thickness|velocity|volume|volume_flux|volume_fraction|volume_transport|vorticity
Condition          = clear_sky|deep_snow|no_snow
Direction          = upward|downward|northward|southward|eastward|westward|x|y
Medium             = air|atmosphere_boundary_layer|mesosphere|sea_ice|sea_water|soil|soil_water|stratosphere|thermosphere|troposphere
Substance          = condensed_water|oxygen|sulfate_aerosol|ammonium_dry_aerosol|black_carbon_dry_aerosol|cloud_condensed_water|cloud_ice|cloud_liquid_water|convective_cloud_condensed_water|convective_cloud_ice|convective_cloud_liquid_water|dimethyl_sulfide|dust_dry_aerosol|frozen_water|graupel|mercury_dry_aerosol|nitrate_dry_aerosol|ozone|particulate_organic_matter_dry_aerosol|pm1_aerosol|pm10_aerosol|pm2p5_aerosol|precipitation|primary_particulate_organic_matter_dry_aerosol|rain|seasalt_dry_aerosol|secondary_particulate_organic_matter_dry_aerosol|snow|stratiform_cloud_ice|stratiform_cloud_liquid_water|sulfate_dry_aerosol|sulfur_dioxide|unfrozen_water|water
Surface            = toa|tropopause|surface|adiabatic_condensation_level|cloud_top|convective_cloud_top|cloud_base|convective_cloud_base|freezing_level|ground_level|maximum_wind_speed_level|sea_floor|sea_ice_base|sea_level|top_of_atmosphere_boundary_layer|top_of_atmosphere_model|top_of_dry_convection
Process            = advection|convection|deep_convection|diabatic_processes|diffusion|dry_convection|gravity_wave_drag|gyre|isostatic_adjustment|large_scale_precipitation|longwave_heating|moist_convection|overturning|shallow_convection|shortwave_heating|thermodynamics
WhereType          = cloud|land|open_sea|sea|sea_ice|vegetation
NL                 = \r\n|\r|\n
Text               = [a-z]+(_[a-z0-9]+)*





file               : [standard_names Ss]
                   =  [standard_names Ss] >


standard_names     : [standard_name1 S] [NL] [standard_names Ss]
                   =  [standard_name1 S] > [standard_names Ss]


standard_names     >: [Text T] [NL] [standard_names Ss]
                   =  [Text T] > [standard_names Ss]


standard_names     : =



/* The following is actually the "direction of the spatial component", so "component" is a bad name (but kept
   here for consistency with the original terminology).
   Note that the rules allow for two direction terms to be used for a tensor quantity.   Clearly, only
   certain pairings are possible, but I have not built this restriction in as yet. */





standard_name1      : [surface S] [component C] [standard_name N] [at_surface AS] [in_medium M]
                     [due_to_process P] [where_type T] [assuming_condition AC]
                   = [surface S] [component C] [standard_name N] [at_surface AS] [in_medium M]
                     [due_to_process P] [where_type T] [assuming_condition AC]


surface            : [Surface S] "_"
                   =  [Surface S] >

surface            : =





component          : [Direction D1] "_" [Direction D2] "_"
                   =  [Direction D1] >  [Direction D2] >

component          : [Direction D] "_"
                   =  [Direction D] >

component          : =



at_surface         : "_at_" [Surface S]
                   =  [Surface S] >

at_surface         : =





in_medium          : "_in_" [Medium M]
                   =  [Medium M] >

in_medium          : =




due_to_process     : "_due_to_" [Process P]
                   =  [Process P] >

due_to_process     : =




where_type         : "_where_" [WhereType W]
                   =  [WhereType W] >

where_type         : =



assuming_condition : "_assuming_" [Condition C]
                   =  [Condition C] >

                   : =



substance          : [Substance S]
                   =  [Substance S] >




standard_name      : "change_over_time_in_" [standard_name X]
                   =  [standard_name X] >



standard_name      : "convergence_of_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "horizontal_convergence_of_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "correlation_of_" [standard_name X] "_and_" [standard_name Y]
                   =  [standard_name X] [standard_name Y] >

standard_name      : "correlation_of_" [standard_name X] "_and_" [standard_name Y] "_over_" [standard_name Z]
                   =  [standard_name X] [standard_name Y] [standard_name Z] >

standard_name      : "covariance_of_" [standard_name X] "_and_" [standard_name Y]
                   =  [standard_name X] [standard_name Y] >

standard_name      : "covariance_of_" [standard_name X] "_and_" [standard_name Y] "_over_" [standard_name Z]
                   =  [standard_name X] [standard_name Y] [standard_name Z] >

standard_name      : [Direction D] "_derivative_of_" [standard_name X]
                   =  [Direction D] [standard_name X] >

standard_name      : "derivative_of_" [standard_name X] "_wrt_" [standard_name Y]
                   =  [standard_name X] [standard_name Y] >

standard_name      : "direction_of_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "divergence_of_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "horizontal_divergence_of_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "histogram_of_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "histogram_of_" [standard_name X] "_over_" [standard_name Y]
                   =  [standard_name X] [standard_name Y]>

standard_name      : "integral_of_" [standard_name X] "_wrt_" [standard_name Y]
                   =  [standard_name X] [standard_name Y]>


/* I'm really uncomfortable handling standard functions (integral, ln, log10) like this.
   Given that we are now moving into MathML territory,  why not just include MathML?
*/


standard_name      : "ln_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "log10_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "magnitude_of_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "probability_distribution_of_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "probability_distribution_of_" [standard_name X] "_over_" [standard_name Z]
                   =  [standard_name X] [standard_name Z] >

standard_name      : "probability_distribution_function_of_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "probability_distribution_function_of_" [standard_name X] "_over_" [standard_name Z]
                   =  [standard_name X] [standard_name Z] >

standard_name      : "product_of_" [standard_name X] "_and_" [standard_name Y]
                   =  [standard_name X] [standard_name Y] >

standard_name      : "ratio_of_" [standard_name X] "_to_" [standard_name Y]
                   =  [standard_name X] [standard_name Y] >

standard_name      : "square_of_" [standard_name X]
                   =  [standard_name X] >

standard_name      : "tendency_of_" [standard_name X]
                   =  [standard_name X] >

/* Hand-crafted rules */
standard_name      : "mass_concentration_of_" [substance S] [in_medium M]
                   =  [substance S] [in_medium M] >

standard_name      : "mass_fraction_of_" [substance S] [in_medium M]
                   =  [substance S] [in_medium M] >


/* This is a quick fix to get things up and running! */

standard_name      : [BaseName BN]
                   =  [BaseName BN] >

Simple grammars

This page is for reporting on experiments with simple grammars for variable names.

Prolog for simple grammar

var_name     --> [amount,of], substance, in_plant.
var_name     --> [amount,of], substance, in_physical.
var_name     --> [rate,of], plant_process, in_plant.
var_name     --> [rate,of], physical_process, in_physical.

in_plant    --> [in], plant, plant_part.
in_plant    --> [].

 

in_physical  --> [in], physical.
in_physical  --> [].

 

substance    --> [biomass].
substance    --> [water].
substance    --> [carbon].
substance    --> [nitrogen].
substance    --> [phosphorus].

 

plant_process      --> [photosynthesis].
plant_process      --> [assimilation].
plant_process      --> [net,assimilation].
plant_process      --> [gross,assimilation].
plant_process      --> [respiration].
plant_process      --> [growth].

 

physical_process      --> [precipitation].
physical_process      --> [transpiration].
physical_process      --> [evaporation].
physical_process      --> [evapotranspiration].
physical_process      --> [drainage].
physical_process      --> [overlandflow].

 

 

plant        --> [plant].
plant        --> [tree].
plant        --> [crop].
plant        --> [weed].

 

physical        --> [soil].
physical        --> [soil,layer].
physical        --> [lake].
physical        --> [river].

 

plant_part   --> [leaf].
plant_part   --> [branch].
plant_part   --> [stem].
plant_part   --> [root].
plant_part   --> [seed].
plant_part   --> [].
 

Sample set of generated variable names (1)

Here is my first set of generated names (11 Nov 2008)

 

amount of biomass in plant leaf
amount of biomass in plant branch
amount of biomass in plant stem
amount of biomass in plant root
amount of biomass in plant seed
amount of biomass in plant
amount of biomass in tree leaf
amount of biomass in tree branch
amount of biomass in tree stem
amount of biomass in tree root
amount of biomass in tree seed
amount of biomass in tree
amount of biomass in crop leaf
amount of biomass in crop branch
amount of biomass in crop stem
amount of biomass in crop root
amount of biomass in crop seed
amount of biomass in crop
amount of biomass in weed leaf
amount of biomass in weed branch
amount of biomass in weed stem
amount of biomass in weed root
amount of biomass in weed seed
amount of biomass in weed
amount of biomass
amount of water in plant leaf
amount of water in plant branch
amount of water in plant stem
amount of water in plant root
amount of water in plant seed
amount of water in plant
amount of water in tree leaf
amount of water in tree branch
amount of water in tree stem
amount of water in tree root
amount of water in tree seed
amount of water in tree
amount of water in crop leaf
amount of water in crop branch
amount of water in crop stem
amount of water in crop root
amount of water in crop seed
amount of water in crop
amount of water in weed leaf
amount of water in weed branch
amount of water in weed stem
amount of water in weed root
amount of water in weed seed
amount of water in weed
amount of water
amount of carbon in plant leaf
amount of carbon in plant branch
amount of carbon in plant stem
amount of carbon in plant root
amount of carbon in plant seed
amount of carbon in plant
amount of carbon in tree leaf
amount of carbon in tree branch
amount of carbon in tree stem
amount of carbon in tree root
amount of carbon in tree seed
amount of carbon in tree
amount of carbon in crop leaf
amount of carbon in crop branch
amount of carbon in crop stem
amount of carbon in crop root
amount of carbon in crop seed
amount of carbon in crop
amount of carbon in weed leaf
amount of carbon in weed branch
amount of carbon in weed stem
amount of carbon in weed root
amount of carbon in weed seed
amount of carbon in weed
amount of carbon
amount of nitrogen in plant leaf
amount of nitrogen in plant branch
amount of nitrogen in plant stem
amount of nitrogen in plant root
amount of nitrogen in plant seed
amount of nitrogen in plant
amount of nitrogen in tree leaf
amount of nitrogen in tree branch
amount of nitrogen in tree stem
amount of nitrogen in tree root
amount of nitrogen in tree seed
amount of nitrogen in tree
amount of nitrogen in crop leaf
amount of nitrogen in crop branch
amount of nitrogen in crop stem
amount of nitrogen in crop root
amount of nitrogen in crop seed
amount of nitrogen in crop
amount of nitrogen in weed leaf
amount of nitrogen in weed branch
amount of nitrogen in weed stem
amount of nitrogen in weed root
amount of nitrogen in weed seed
amount of nitrogen in weed
amount of nitrogen
amount of phosphorus in plant leaf
amount of phosphorus in plant branch
amount of phosphorus in plant stem
amount of phosphorus in plant root
amount of phosphorus in plant seed
amount of phosphorus in plant
amount of phosphorus in tree leaf
amount of phosphorus in tree branch
amount of phosphorus in tree stem
amount of phosphorus in tree root
amount of phosphorus in tree seed
amount of phosphorus in tree
amount of phosphorus in crop leaf
amount of phosphorus in crop branch
amount of phosphorus in crop stem
amount of phosphorus in crop root
amount of phosphorus in crop seed
amount of phosphorus in crop
amount of phosphorus in weed leaf
amount of phosphorus in weed branch
amount of phosphorus in weed stem
amount of phosphorus in weed root
amount of phosphorus in weed seed
amount of phosphorus in weed
amount of phosphorus
amount of biomass in soil
amount of biomass in soil layer
amount of biomass in lake
amount of biomass in river
amount of biomass
amount of water in soil
amount of water in soil layer
amount of water in lake
amount of water in river
amount of water
amount of carbon in soil
amount of carbon in soil layer
amount of carbon in lake
amount of carbon in river
amount of carbon
amount of nitrogen in soil
amount of nitrogen in soil layer
amount of nitrogen in lake
amount of nitrogen in river
amount of nitrogen
amount of phosphorus in soil
amount of phosphorus in soil layer
amount of phosphorus in lake
amount of phosphorus in river
amount of phosphorus
rate of photosynthesis in plant leaf
rate of photosynthesis in plant branch
rate of photosynthesis in plant stem
rate of photosynthesis in plant root
rate of photosynthesis in plant seed
rate of photosynthesis in plant
rate of photosynthesis in tree leaf
rate of photosynthesis in tree branch
rate of photosynthesis in tree stem
rate of photosynthesis in tree root
rate of photosynthesis in tree seed
rate of photosynthesis in tree
rate of photosynthesis in crop leaf
rate of photosynthesis in crop branch
rate of photosynthesis in crop stem
rate of photosynthesis in crop root
rate of photosynthesis in crop seed
rate of photosynthesis in crop
rate of photosynthesis in weed leaf
rate of photosynthesis in weed branch
rate of photosynthesis in weed stem
rate of photosynthesis in weed root
rate of photosynthesis in weed seed
rate of photosynthesis in weed
rate of photosynthesis
rate of assimilation in plant leaf
rate of assimilation in plant branch
rate of assimilation in plant stem
rate of assimilation in plant root
rate of assimilation in plant seed
rate of assimilation in plant
rate of assimilation in tree leaf
rate of assimilation in tree branch
rate of assimilation in tree stem
rate of assimilation in tree root
rate of assimilation in tree seed
rate of assimilation in tree
rate of assimilation in crop leaf
rate of assimilation in crop branch
rate of assimilation in crop stem
rate of assimilation in crop root
rate of assimilation in crop seed
rate of assimilation in crop
rate of assimilation in weed leaf
rate of assimilation in weed branch
rate of assimilation in weed stem
rate of assimilation in weed root
rate of assimilation in weed seed
rate of assimilation in weed
rate of assimilation
rate of net assimilation in plant leaf
rate of net assimilation in plant branch
rate of net assimilation in plant stem
rate of net assimilation in plant root
rate of net assimilation in plant seed
rate of net assimilation in plant
rate of net assimilation in tree leaf
rate of net assimilation in tree branch
rate of net assimilation in tree stem
rate of net assimilation in tree root
rate of net assimilation in tree seed
rate of net assimilation in tree
rate of net assimilation in crop leaf
rate of net assimilation in crop branch
rate of net assimilation in crop stem
rate of net assimilation in crop root
rate of net assimilation in crop seed
rate of net assimilation in crop
rate of net assimilation in weed leaf
rate of net assimilation in weed branch
rate of net assimilation in weed stem
rate of net assimilation in weed root
rate of net assimilation in weed seed
rate of net assimilation in weed
rate of net assimilation
rate of gross assimilation in plant leaf
rate of gross assimilation in plant branch
rate of gross assimilation in plant stem
rate of gross assimilation in plant root
rate of gross assimilation in plant seed
rate of gross assimilation in plant
rate of gross assimilation in tree leaf
rate of gross assimilation in tree branch
rate of gross assimilation in tree stem
rate of gross assimilation in tree root
rate of gross assimilation in tree seed
rate of gross assimilation in tree
rate of gross assimilation in crop leaf
rate of gross assimilation in crop branch
rate of gross assimilation in crop stem
rate of gross assimilation in crop root
rate of gross assimilation in crop seed
rate of gross assimilation in crop
rate of gross assimilation in weed leaf
rate of gross assimilation in weed branch
rate of gross assimilation in weed stem
rate of gross assimilation in weed root
rate of gross assimilation in weed seed
rate of gross assimilation in weed
rate of gross assimilation
rate of respiration in plant leaf
rate of respiration in plant branch
rate of respiration in plant stem
rate of respiration in plant root
rate of respiration in plant seed
rate of respiration in plant
rate of respiration in tree leaf
rate of respiration in tree branch
rate of respiration in tree stem
rate of respiration in tree root
rate of respiration in tree seed
rate of respiration in tree
rate of respiration in crop leaf
rate of respiration in crop branch
rate of respiration in crop stem
rate of respiration in crop root
rate of respiration in crop seed
rate of respiration in crop
rate of respiration in weed leaf
rate of respiration in weed branch
rate of respiration in weed stem
rate of respiration in weed root
rate of respiration in weed seed
rate of respiration in weed
rate of respiration
rate of growth in plant leaf
rate of growth in plant branch
rate of growth in plant stem
rate of growth in plant root
rate of growth in plant seed
rate of growth in plant
rate of growth in tree leaf
rate of growth in tree branch
rate of growth in tree stem
rate of growth in tree root
rate of growth in tree seed
rate of growth in tree
rate of growth in crop leaf
rate of growth in crop branch
rate of growth in crop stem
rate of growth in crop root
rate of growth in crop seed
rate of growth in crop
rate of growth in weed leaf
rate of growth in weed branch
rate of growth in weed stem
rate of growth in weed root
rate of growth in weed seed
rate of growth in weed
rate of growth
rate of precipitation in soil
rate of precipitation in soil layer
rate of precipitation in lake
rate of precipitation in river
rate of precipitation
rate of transpiration in soil
rate of transpiration in soil layer
rate of transpiration in lake
rate of transpiration in river
rate of transpiration
rate of evaporation in soil
rate of evaporation in soil layer
rate of evaporation in lake
rate of evaporation in river
rate of evaporation
rate of evapotranspiration in soil
rate of evapotranspiration in soil layer
rate of evapotranspiration in lake
rate of evapotranspiration in river
rate of evapotranspiration
rate of drainage in soil
rate of drainage in soil layer
rate of drainage in lake
rate of drainage in river
rate of drainage
rate of overlandflow in soil
rate of overlandflow in soil layer
rate of overlandflow in lake
rate of overlandflow in river
rate of overlandflow

XML aspects

This page is concerned with XML-related aspects of VarML.

Possible use of MathML

 

It is reasonably common for variable names to include a reference to mathematical functions.  For example:

  • - maximum temperature
  • - ratio leaf carbon to root carbon.