Hi
We have just been testing the new GeoJSON output format for our complex app-schema services, which is really great and will allow us to plug in our data directly to web apps.
However we have noticed what is possibly a strange bug where if there are multiple gml:ReferenceTypes in a complex type and one of them is an unbounded reference. A snippet from our mapping file:
<AttributeMapping>
<targetAttribute>gsmlbh:indexData/gsmlbh:BoreholeDetails/gsmlbh:purpose</targetAttribute>
<ClientProperty>
<name>xlink:href</name>
<value>purpose_href</value>
</ClientProperty>
<ClientProperty>
<name>xlink:title</name>
<value>purpose_title</value>
</ClientProperty>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>gsmlbh:indexData/gsmlbh:BoreholeDetails/gsmlbh:startPoint</targetAttribute>
<ClientProperty>
<name>xlink:href</name>
<value>startpoint_href</value>
</ClientProperty>
<ClientProperty>
<name>xlink:title</name>
<value>startpoint_title</value>
</ClientProperty>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>gsmlbh:indexData/gsmlbh:BoreholeDetails/gsmlbh:inclinationType</targetAttribute>
<targetAttributeNode>gml:ReferenceType</targetAttributeNode>
<ClientProperty>
<name>xlink:href</name>
<value>inclinationtype_href</value>
</ClientProperty>
<ClientProperty>
<name>xlink:title</name>
<value>inclinationtype_title</value>
</ClientProperty>
</AttributeMapping>
This produces the following GeoJSON output:
-
purpose:
[
-
{
-
{
- title: “stratigraphic investigation”
},
- title: “stratigraphic investigation”
-
{
-
{
- title: “onshore”
},
- title: “onshore”
-
{
-
{
- title: “vertical”
}
]
- title: “vertical”
-
We don’t get inclinationType or startPoint, these are instead populated into an array of purpose.
I suspect the reason is that the gsmlbh:purpose element is an unbounded reference type, while the other two don’t. So the GeoJSON encoder picks up the attribute mappings and populates gsmlbh:purpose with any gml:ReferenceType it finds in the mapping file
Relevant code in the XSD:
<element name="startPoint" type="gml:ReferenceType" nillable="true" minOccurs="0">
<annotation>
<documentation>The property startPoint:BoreholeStartPointCode provides a term from a controlled vocabulary indicating the named position relative to ground surface where the borehole commenced. (e.g., natural ground surface, open pit floor, underground, offshore)</documentation>
<appinfo>
<targetElement xmlns="http://www.opengis.net/gml/3.2">gsmlbh:BoreholeStartPointCode</targetElement>
<targetCodeList xmlns="http://www.opengis.net/gml/3.3/exr">BoreholeStartPointCode</targetCodeList>
</appinfo>
</annotation>
</element>
<element name="inclinationType" type="gml:ReferenceType" nillable="true" minOccurs="0">
<annotation>
<documentation>The property inclinationType:BoreholeInclinationCode contains a term from a controlled vocabulary indicating the inclination type of the borehole. Appropriate terms would include vertical; inclined up; inclined down, horizontal.</documentation>
<appinfo>
<targetElement xmlns="http://www.opengis.net/gml/3.2">gsmlbh:BoreholeInclinationCode</targetElement>
<targetCodeList xmlns="http://www.opengis.net/gml/3.3/exr">BoreholeInclinationCode</targetCodeList>
</appinfo>
</annotation>
</element>
<element name="boreholeMaterialCustodian" type="cit:CI_Responsibility_PropertyType" nillable="true" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>The property boreholeMaterialCustodian is an association between BoreholeDetails and a CIT:CI_ResponsibleParty describing the organisation that is custodian of the drilled material recovered from the borehole.</documentation>
</annotation>
</element>
<element name="purpose" type="gml:ReferenceType" nillable="true" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>The property purpose:BoreholePurposeCode contains a term from a controlled vocabulary describing the purpose for which the borehole was drilled. e.g., site investigation, mineral exploration, hydrocarbon exploration, water resources.</documentation>
<appinfo>
<targetElement xmlns="http://www.opengis.net/gml/3.2">gsmlbh:BoreholePurposeCode</targetElement>
<targetCodeList xmlns="http://www.opengis.net/gml/3.3/exr">BoreholePurposeCode</targetCodeList>
</appinfo>
</annotation>
</element>
http://schemas.opengis.net/gsml/4.1/borehole.xsd
schemas.opengis.net
schemas.opengis.net
The GeoSciML Borehole package contains an information model for boreholes and related artefacts. This is primarily through re-use of standard components from the Observations and Measurements (ISO19156).
|
- |
If I remove the maxOccurs=“unbounded” from gsmlbh:purpose, I don’t get the duplication.
Thanks
Geoscience Australia Disclaimer: This e-mail (and files transmitted with it) is intended only for the person or entity to which it is addressed. If you are not the intended recipient, then you have received this e-mail by mistake and any use, dissemination, forwarding, printing or copying of this e-mail and its file attachments is prohibited. The security of emails transmitted cannot be guaranteed; by forwarding or replying to this email, you acknowledge and accept these risks.
···
Michael Sexton
Resources Division Information Services | Resources Division
t +61 2 6249 9262 www.ga.gov.au