openLCA is throwing an error creating some flows during import. Some examples from error logs:
2959111 | ModalContext | WARN | org.openlca.io.ecospold1.importer.FlowImport | Could not create valid flow ba02e104-f648-3fc2-93b3-20543686b825
2959111 | ModalContext | ERROR | org.openlca.io.ecospold1.importer.EcoSpold01Parser | Could not import flow ES1Exchange [category=Emissions to agricultural soil, name=Copper (+II), subCategory=Heavy metals to agricultural soil, unit=kg]
In this case, this flow appears to already exist in the database under the flow list, but does not get added to the processes where it is listed an an input or output.
Does the flow have a different unit in the database than in the EcoSpold 01 file?
I can reproduce the error message when I do the following:
1) import a process data set with flowX given in kg
2) modify flowX in openLCA to have the flow property volume as reference flow property and remove the flow property mass from flowX in openLCA
3) import a second process data set with flowX in kg
No, we have this problem when even the unit of flowX in the ecospold1 file has the same unit as the flow already in the database.
I attached screenshots of the flow in openLCA and in the MySQL database prior to the import.
I attempt to import an ecospold1 file with the following exchange (edited to remove brackets)
exchange number="4" category="Emissions to agricultural soil" subCategory="Heavy metals to agricultural soil" infrastructureProcess="false" name="Copper (+II)" unit="kg" meanValue="1.4601" uncertaintyType="0" generalComment="Based on averages of E11 style tests (neglects the E20). Source: . DQI: 5,0,0,0,4,0" outputGroup 4 /outputGroup /exchange
but then get the error message listed above, and the flow does not appear in the imported process.
Last edit: Wes Ingwersen 2013-02-15
I may have been partially incorrect in my last statement that the units were the same. The units appear to be the same, but apparently we have more than 1 flow property in this database called 'Mass' (see the attachment).
One is in a folder called 'Technical flow properties' and another is in the folder 'Technical quantities'. The former is created as part of the reference data in openLCA. The latter is probably associated with the import of GaBi data in ILCD format in the database.
Do you think this likely explains the problem with flow creation?
Hi Wes,
Many thanks for the detailed description. Yes, I think this issue is related to the two ‘Mass’ properties. The EcoSpold 01 import first searches for the used unit names in the data sets and tries to find a unit with the same unit or synonym in openLCA for each of these EcoSpold units (it takes the first unit found). It then creates a mapping of the EcoSpold 01 unit name to the internal unit, unit group, and flow property (the default flow property in the unit group editor) in openLCA.
When the import comes to an EcoSpold exchange it first generates a hash based UUID from the exchange attributes and checks if there is such a flow in the database. If there is such a flow (and I assume that this is the case you described), it loads this flow and tries to assign the flow property and unit from the mapping. But if the flow property and unit are not defined for that flow, which is checked via the internal UUIDs, it throws the error message from your bug-description. So I assume in your case the mapping uses the first ‘Mass’ property but the flow is linked to the other (you could check this by renaming one property ‘Mass (GaBi)’ or so and check which one is taken in the unit assignment dialog of the import).
There are quite some other cases the import has to solve, e.g. create a new flow, search for a flow with the same attributes in the database, apply a flow mapping, do the same for impact assessment factors etc. So there is no quick solution to this problem. I will try to find a solution. Input how this unit mapping and the dialog can be improved in a user friendly way is very welcome.
Best,
Michael
An update to this bug in 1.3.0. I have found that duplicate flows are still being created when importing ecospold 1 unit processes, when the exchanges for the same item are reported in variations of the unit abbreviation ... "m3" and "L". I will attach two ecospold files with the following exchanges
ES_Bucked and debarked log, hardwood, green, at veneer mill, E.xml
contains exchange:
exchange number="6" infrastructureProcess="false" name="Natural gas, combusted in industrial equipment" location="US" unit="m3" meanValue="0.000180023904" generalComment="Amount of natural gas consumed during conditioning. Represents 14.3% of mill use of natural gas; proxy for propane"
ES_Roundwood, hardwood, green, at logyard, SE.xml
contains exchange:
exchange number="5" infrastructureProcess="false" name="Natural gas, combusted in industrial equipment" location="US" unit="L" meanValue="0.0057" generalComment="40% of mill transporation on-site; proxy for propane"
FYI. "m3" is defined as a reference unit in the 'Units of volume' units group. "L" has to be defined during the import operation.
These files should create the same flow.
Second attachment (refer to previous post)
Just to clarify these files were imported into a database with reference data and nothing else in the 1.3.0 beta.
Upon closer inspection, openLCA appears to be including two flow properties with units of volume in the reference data:
Normal Volume
Volume
I would recommend removing 'Normal Volume' to prevent the above error.
FYI, the removal of Normal Volume did not solve the import problem.