General Category > BeerXML Standard Document

BeerXML 2.0 Definition

(1/14) > >>

BeerSmith:

OK, I'm slowly coming around to the idea that BeerXML 2.0 should probably be based on a well defined schema and may not be 100% backward compatible with the 1.0 standard.

I propose that we start small with defining BeerXML 2.0.  Lets start with the first section of BeerXML - the part that defines the basic rules, naming conventions, etc...

What I propose is that you edit the attached document (which I just lifted from the beginning of BeerXML 1.0), edit it using Microsoft Word track changes, and then repost your files here so we can all track the changes and discuss them.

Once we have the basic framework in place, we can move on to define some simple data types like hops (for example).

Cheers!
Brad

AntonW:
Sorry I haven't had much time to dedicate to advancing the standard lately...

Regarding units, should we force a normalization to SI units?  Would it be of any value to store the unit type along with the value as long as the set of unit types is static and well defined?

For instance, define a set of mass units such as
kilogram (kg), pound (lb), ounce (oz)

volume units such as:
liter(l), gallon(gal), fluid ounces (ozfl)

temperature units such as:
Celcius (C), Farenheit (F)

time units such as
hour (h), minute (m), second (s)


So a hop addition that looks like this now:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- BeerXML Format - Generated by BeerSmith  - see www.beersmith.com -->
<RECIPES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="recipes.xsd">
   <RECIPE>
      <NAME>Burton Ale</NAME>
      <VERSION>1</VERSION>
      <TYPE>All Grain</TYPE>
      <BREWER>Brad Smith</BREWER>
      <ASST_BREWER/>
      <BATCH_SIZE>18.92716800</BATCH_SIZE>
      <BOIL_SIZE>20.81988500</BOIL_SIZE>
      <BOIL_TIME>60</BOIL_TIME>
      <EFFICIENCY>72.0</EFFICIENCY>
      <HOPS>
         <HOP>
            <NAME>Goldings, East Kent</NAME>
            <VERSION>1</VERSION>
            <ORIGIN>United Kingdom</ORIGIN>
            <ALPHA>5.50</ALPHA>
            <AMOUNT>0.0283500</AMOUNT>
            <USE>Boil</USE>
            <TIME>60.000</TIME>
            <NOTES>Used For: General purpose hops for bittering/finishing all British Ales
Aroma: Floral, aromatic, earthy, slightly sweet spicy flavor
Substitutes: Fuggles, BC Goldings
Examples: Bass Pale Ale, Fullers ESB, Samual Smith&apos;s Pale Ale
</NOTES>
            <TYPE>Aroma</TYPE>
            <FORM>Pellet</FORM>
            <BETA>3.50</BETA>
            <HSI>35.0</HSI>
            <DISPLAY_AMOUNT>1.00 oz</DISPLAY_AMOUNT>
            <INVENTORY>1.00 oz</INVENTORY>
            <DISPLAY_TIME>60 min</DISPLAY_TIME>
         </HOP>

Would be more like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- BeerXML Format - Generated by BeerSmith  - see www.beersmith.com -->
<recipes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="recipes.xsd">
   <recipe>
      <name>Burton Ale</name>
      <version>2.01</version>
      <type>All Grain</type>
      <brewer>Brad Smith</brewer>
      <batch_size volume="gal">5.0</batch_size>
      <boil_size volume="gal">5.5</boil_size>
      <boil_time duration="min">60.0</boil_time>
      <efficiency>72.0</efficiency>
      <hop_additions>
         <hop>
            <name>Goldings, East Kent</name>
            <origin>United Kingdom</origin>
            <alpha_acid_units>5.50</alpha_acid_units>
            <form>Pellet</form>
            <amount mass="oz">1.0</amount>
            <use>Boil</use>
            <time duration="min">60.0</time>
         </hop>


That way those crazy folks that want to measure and display their units in either American or SI units will be happy and won't have to worry about the inaccuracies of floating point conversions when they're entering data.  It will add a small amount of complexity to the interpreting program, but I think it's a good tradeoff for the increased visibility.

Any thoughts, concerns?

-Anton

AntonW:
Also, why are we requiring use of only xml 1.0 with latin-1 encoding type?  As specified here:

<?xml version="1.0" encoding="ISO-8859-1"?>
<RECIPES>
   

BeerSmith:
Anton,
  - Regarding the ISO encoding - I just lifted that straight from the old standard.  I would propose we change it to something more generic like UTF-8.

  - Regarding units - early in the standard we had it defined just the way you describe - with units for each item.  Personally I have no problem with this as long as we are very complete in defining the units.  BeerSmith (for example) supports 13 different volume units and 4 different weight units. Different measures often require different units - for example most people don't measure yeast in gallons, or hops in pounds unless they are building a commercial brew.   Similarly mash-ins are often measured in quarts.

  - The only other point to consider is that each program would have to implement ALL of the units - to be fully compliant.  Not a big deal, but it is something to consider.

Cheers!
Brad

AntonW:
Excellent!  For the encoding I think UTF-8 would be the ideal.

For the units would you agree the following represents a subset of the required units used to describe properties measured in a beer-making recipe:

SI Volume: (not *really* SI, according to NIST: http://physics.nist.gov/cuu/Units/outside.html)
   Liter (L)
   milliLiter (mL)

SI Mass
   kilogram (kg)
   gram (gm)
   milligram (mg)

SI Temperature: (not *really* SI either, but does anybody use Kelvin outside of cryogenics?)
   Celcius (C)

SI Pressure
   kilopascal (kPa)


US Volume:
   fluid ounce (ozfl)
   pint (pt)
   quart (qt)
   gallon (gal)
   teaspoon (tsp)
   tablespoon (tbsp)
   cup (cup)

US Mass:
   pound (lb)
   ounce (oz)

US Temperature:
   Farenheit (F)

US Pressure:
   pounds per square inch (psi)

Time:
   Minute (min)
   Hour (hr)
   Days (d)
   Weeks (w)

If anybody needs a default implementation in C/C++ I could post one.  It's moderately trivial to create a matrix of conversion factors to transform from one unit to another unit (which works for everything except for temperature).

-Anton

Navigation

[0] Message Index

[#] Next page

Go to full version