The source file (example) for reading in Benson rules for carbon atoms from Table A1 are:
The input file is the standard Benson rule format of JThermodynamics, for example, a block definition is:
1 1 1 c-(h)/3-(c) 0 0.0 3.0 1 1.0j73
1 1 2 1 -10.010 1 30.290 1 7.74 9.24 10.62 12.84 14.59 14.77 17.58 0 j73
1 1 3 0 0 0 1 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0j7
The units of this file are the 'standard' from TherGas and JThermodynamics:
Enthalpy: kilocalories/mole
Entropy: calories/(mole K)
Heat Capacity: calories/(mole K)
General Procedure to read in
Reading in the files is done in three (standard) transactions:
InitialReadInOfRepositoryFile: This reads in the file to the repository. Example input is found: readTableA1CarbonBensonRules.json
PartiionSetWithinRepositoryFile: This parses the blocks of ines for each definition. This uses the same algorithm as JThermodynamics 1.0 to determine the block (the block could have, for example, 3 or 4 lines). Example input is found: parseTableA1CarbonBensonRules.json .
TransactionInterpretTextBlock: For each block (a database item for each), The lines are interpreted and the ThermodynamicBensonRuleDefinition object is created. The sample input object is createTableA1CarbonBensonRules.json.
The three steps of creating these benson rules can be done with three test cases that have been set up. Each one runs the transaction associated with each step, using the input from each step:
Thus the three commands to perform these 'tests' are:
mvn clean compile test -Dtest=TestReadCarbonBensonRulesA1
mvn clean compile test -Dtest=TestParseBensonRuleRepositoryFile
mvn clean compile test -Dtest=TestInterpretCarbonBensonRules
All three can be run at one time with:
/DatasetBackgroundServices/src/test/java/info/esblurock/background/services/set/bensonrule/TestFullReadParseCreateCarbonBensonRules.javaor running the test:
mvn clean compile test -Dtest=TestFullReadParseCreateCarbonBensonRules