Hi I am currently trying to implement EarthResourceML 2.0 er:MineralOccurrence and facing a problem with one of the relationships in the schema. For reference:
http://www.earthresourceml.net/earthresourceml/2.0/doc/ERML_HTML_Documentation/ A er:MineralOccurrence has many er:oreAmounts, which map to a concrete class of the abstract er:OreMeasure (in my model, either er:Reserve or er:Resource). The er:oreAmount is mandatory but nillable. Here is the snippet from my er_MineralOccurrence.xml mapping file, which maps the table ER_MINERALOCCURRENCE <AttributeMapping> <targetAttribute>er:oreAmount</targetAttribute> <sourceExpression> <OCQL>ENO</OCQL> <linkElement>er:Resource</linkElement> <linkField>FEATURE_LINK[2]</linkField> </sourceExpression> </AttributeMapping> <AttributeMapping> <targetAttribute>er:oreAmount</targetAttribute> <sourceExpression> <OCQL>ENO</OCQL> <linkElement>er:Reserve</linkElement> <linkField>FEATURE_LINK[3]</linkField> </sourceExpression> </AttributeMapping> These map to the files er_Reserve.xml and er_Resource.xml, which themselves map to table ER_RESERVE and ER_RESOURCE. The problem is when there are no Resources or Reserves for a given MineralOccurrence. I thought I could cheat by adding another AttributeMapping that inserts a ClientProperty with name and value of xsi:nil='true'. But all this does is add the ClientProperty to the last er:Reserve attribute and makes it invlaid. What are the solutions for this problem? As I see it there are three: 1. An as yet unknown solution (to me) in the mapping config that allows an nil artefact to populate even when it isn't necessary, that requires to change to the physical data model. 2. A change to the physical data model in our RDBMS that populates ER_MINERALOCCURRENCE with a 'oremeasure' field that determines whether a feature chain is used via an if_then_else in the mapping file. This seems fairly suboptimal. 3. A change to the boneheaded requirement of everything being mandatory in the ERML standard, especially when the real world objects it is supposed to model cannot meet that mandatory requirement (since when do small mineral occurrence outcrops have an oreAmount????) Any help would be greatly appreciated, this is driving me up the wall. Thanks Michael -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Mapping-mandatory-but-nillable-attributes-that-are-feature-chained-in-the-case-where-the-data-doesn-t-tp5319334.html Sent from the GeoServer - User mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users