biosemantics / charaparser

enumerateCompoundOrgan
6 stars 2 forks source link

Transformation issue #11

Closed hongcui closed 10 years ago

hongcui commented 10 years ago

edu.arizona.biosemantics.semanticmarkup.markupelement.description.io.lib.MOXyBinderDescriptionWriter.java

When given a 'description' <?xml version="1.0" encoding="UTF-8"?> <relations name="with" from="o9" id="r1" negation="false" to="o11"/><relations name="with" from="o10" id="r2" negation="false" to="o11"/><structures name="nflorescence" id="o8"/><structures name="raceme" id="o9"> <character name="architecture" value="leafy" modifier="very"/> <character name="architecture" value="corymbiform"/> </structures><structures name="panicle" id="o10"> <character name="architecture" value="leafy" modifier="very"/> <character name="architecture" value="corymbiform"/> <character name="architecture" value="open"/> </structures><structures name="branch" id="o11"> <character name="shape" value="forking" modifier="mostly"/> <character name="orientation" value="ascending"/> </structures><structures name="axis" id="o12"> <character name="architecture" value="armed" constraint="with setae" constraintid="o15"/> </structures><structures name="branch" id="o13"> <character name="architecture" value="armed" constraint="with setae" constraintid="o15"/> </structures><structures name="pedicel" id="o14"> <character name="architecture" value="armed" constraint="with setae" constraintid="o15"/> </structures><structures name="seta" id="o15"> <character name="internal_texture" value="firm"/> </structures>

It outputs

<statement id="d0_s2"> <text>nflorescence a very leafy corymbiform raceme or open panicle , with mostly forking ascending branches , the axis and branches or pedicels armed with firm setae ;</text> <structure id="o8" name="nflorescence"/> <structure id="o9" name="raceme"> <character modifier="very" name="architecture" value="leafy"/> <character name="architecture" value="corymbiform"/> </structure> <structure id="o10" name="panicle"> <character modifier="very" name="architecture" value="leafy"/> <character name="architecture" value="corymbiform"/> <character name="architecture" value="open"/> </structure> <structure id="o11" name="branch"> <character modifier="mostly" name="shape" value="forking"/> <character name="orientation" value="ascending"/> </structure> <structure id="o12" name="axis"/> <structure id="o13" name="branch"/> <structure id="o14" name="pedicel"> <character constraint="with setae" constraintid="o15" name="architecture" value="armed"/> </structure> <structure id="o15" name="seta"> <character name="internal_texture" value="firm"/> </structure> <relation from="o9" id="r1" name="with" negation="false" to="o11"/> <relation from="o10" id="r2" name="with" negation="false" to="o11"/> </statement>

Notice in the original <character name="architecture" value="armed" constraint="with setae" constraintid="o15"/> is associated with three structures: axis, branch, and pedicel, but after transformation to the output, the character is only associated with the last structure 'pedicel'. [additional info: the program seems to be able to associate the same character without a constraint to multiple structures, e.g. 'leafy']

The input source file:

<?xml version="1.0" encoding="UTF-8"?> <treatment> <meta> <source> <author>Hong Cui</author> <date>2014</date> </source> </meta> <taxon_identification status="ACCEPTED"> <genus_name>Synthesised</genus_name> <genus_authority>Example</genus_authority> </taxon_identification> <description type="morphology"> nflorescence a very leafy corymbiform raceme or open panicle , with mostly forking ascending branches , the axis and branches or pedicels armed with firm setae ; </description> </treatment>