cstb / citygml-energy

CityGML Energy ADE
40 stars 9 forks source link

missing <gml:reverseProperty> element for binary association #117

Closed yaozhihang closed 7 years ago

yaozhihang commented 8 years ago

Hi,

after checking the Energy-ADE XSD schema file I've noticed the following issue: According to the ISO 19136;2009(E), an annotation tag with gml:reverseProperty element is needed to represent the assocation which is navigable in both directions. For example, the following XML code should be embedded into the XML code of the EnergyConversionSystem class:

<element name="provides" minOccurs="0" maxOccurs="unbounded" type="energy:EnergyDemandPropertyType" />
    <annotation>
        <appinfo><gml:reverseProperty>energy:isProvidedBy</gml:reverseProperty></appinfo> 
    </annotation>
</element>

Zhihang

JoachimBenner commented 8 years ago

The statement "According to the ISO 19136;2009(E), an annotation tag with gml:reverseProperty element is needed" is not totally correct. Clause 7.2.3.9 of the GML specification says:

If the value of an object property is another object and that object contains also a property for the association between the two objects, then this name of the reverse property may be encoded in a gml:reversePropertyName element (...)

The term "may be" clearly indicates that the appinfo is optional. The information on the backward relation is available in the derived schema, and as Zhihang already indicated in another comment, many applications simply ignore appinfo tags.

However, I think it is easily possible to generate the reversePropertyName tags, but this might slightly delay the schema generation

JoachimBenner commented 8 years ago

The statement "According to the ISO 19136;2009(E), an annotation tag with gml:reverseProperty element is needed" is not totally correct. Clause 7.2.3.9 of the GML specification says:

If the value of an object property is another object and that object contains also a property for the association between the two objects, then this name of the reverse property may be encoded in a gml:reversePropertyName element (...)

The term "may be" clearly indicates that the appinfo is optional. The information on the backward relation is available in the derived schema, and as Zhihang already indicated in another comment, many applications simply ignore appinfo tags.

However, I think it is easily possible to generate the reversePropertyName tags, but this might slightly delay the schema generation

yaozhihang commented 8 years ago

Hi,

thanks very much for the answer. But, if we try to make a simple reverse engineering based on the current XSD schema which has no reverseProperty info, the generated UML diagram of the classes EnergyConversionSystem and EnergySource should look like the image below. We can see that this UML diagram is not equivalent to the actual UML diagram of the Energy ADE. energy_ade_association_example1

JoachimBenner commented 7 years ago

This issue has alreday been solved in version 0.8.0. I therefore propose to close the issue

eRolland commented 7 years ago

ok for me

yaozhihang commented 7 years ago

me too:)