<?xml version="1.0" encoding="UTF-8"?>

<gml:FeatureCollection gml:id="feduni.example.geology-log"
 xmlns:gml="http://www.opengis.net/gml/3.2"
 xmlns:sam="http://www.opengis.net/sampling/2.0"
 xmlns:gwml2w="http://www.opengis.net/gwml-well/2.2"  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:swe="http://www.opengis.net/swe/2.0"
xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:cv="http://www.opengis.net/cv/0.2/gml32"
xmlns:om="http://www.opengis.net/om/2.0" xmlns:spec="http://www.opengis.net/samplingSpecimen/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/gwml/2.2 http://schemas.opengis.net/gwml/2.2/gwml2.xsd
http://www.opengis.net/samplingSpecimen/2.0 http://schemas.opengis.net/samplingSpecimen/2.0/specimen.xsd">
<!--
 xmlns:sams="http://www.opengis.net/samplingSpatial/2.0"
 xmlns:gwml2="http://www.opengis.net/gwml-main/2.2"
 xmlns:gwml2f="http://www.opengis.net/gwml-flow/2.2"
xmlns:gwml2c="http://www.opengis.net/gwml-constituent/2.2"
 xmlns:gwml2wc="http://www.opengis.net/gwml-wellconstruction/2.2"
xmlns:gsmlb="http://xmlns.geosciml.org/GeoSciML-Basic/4.0" xmlns:gsmlx="http://xmlns.geosciml.org/GeoSciML-Extension/4.0" -->
<!-- Although all the GWML2 schema may not be required, this instance imports all GWML2 packages via gwml2.xsd for consistence between instance examples  -->
	<!-- ######################### -->
	<!-- Mapping of Federation University (FedUni) Groundwater database tables and records to the proposed GroundWaterML2 OGC standard release candidate version 2.2  -->
	<!-- File created by Bruce Simons, CSIRO, February 2016 -->
	<!-- ######################### -->
	<!-- Although this instance is a gml:FeatureCollection with one or more gml:featureMembers, a valid alternative is as a single om:GW_GeologyLog -->
	<!-- Other related GWML2 features are referred to "byReference" using xlink:href. In most cases these could be included "inLine" (i.e. within this instance). A separate instance for each feature is provided for ease of mapping. The final aggregation of inLine vs. byReference features will be determined by the use case requirements -->
	<!-- Where features are aggregated into single feature services the xlink:href references to URIs need to be replaced with internal # references to gml:id -->
	<!-- ######################### -->
	<!-- FedUni - Mapping patterns -->
	<!-- Comments beginning 'FedUni -' are instructions for mappings between FedUni data and GWML2 -->
	<!-- ???? Comments beginning ???? require further checking -->
	<!-- FedUni table record pairs are referred to by the pattern [table.record] -->
	<!-- The mapping pattern is [schema/property] = [table.record] -->
	<!-- ######################### -->
	<!-- FedUni - Feature IDs and identifiers -->
	<!-- Feature IDs (gml:id) are document specific unique identifiers based on FedUni table keys and the feature type -->
	<!-- To create the id, replace [table.record_id] with values from the appropriate table -->
	<!-- Feature identities (gml:identifier) use the URI for the feature. This is in the format "[domain name]/[category]/[gml:id]" -->
	<!-- Domain Name - The temporary domain name "http://www.groundwater-victoria.com.au" has been used for the feature identifiers and vocabulary term references. An appropriate persistent and organisation independent domain will need to be established.
A redirect service, such as the SISS PID service, is required to resolve these URIs -->
	<!-- Category - where the object is a GML Feature use "feature". Where the object is a vocabulary concept use "def". -->
	<!-- ######################### -->

	<!-- FedUni Mapping -->
			<!-- Example gwWellGeology geology logs from [lithology.lithology_description], [stratigraphy.strat_code], [stratigraphy.formation_age]  -->

	<!-- This gml:featureMember is a gwml2w:GW_GeologyLog based on [lithology] table -->
	<gml:featureMember>
	<!-- ???? FedUni - Each Borehole [lithology} contains a total log (e.g. 0-26) and component parts (e.g. 0-2, 2-6, 6-26 {see bore 119330}). It will be necessary to only map the component parts -->

				<!-- gwml2w:GW_GeologyLog gml:id="feduni.borehole.lithology.[lithology.bore_id_fk].[lithology:lithology_id]"  where [lithology:lithology_id] is the total log -->
				<gwml2w:GW_GeologyLog gml:id="feduni.borehole.lithology.51409.242285">

			<!-- FedUni - gml:identifier codeSpace="http://www.ietf.org/rfc/rfc2616" value ="http://groundwater.victoria.com.au/feature/geology-log/feduni.borehole.lithology.[lithology.bore_id_fk].[lithology:lithology_id] -->

			<gml:identifier codeSpace="http://www.ietf.org/rfc/rfc2616">http://groundwater.victoria.com.au/feature/geology-log/feduni.borehole.lithology.51409.242285</gml:identifier>
					<om:phenomenonTime nilReason="unknown"/>
					<om:resultTime nilReason="unknown"/>
					<!--If [lithology:log_type] = "D" then om:procedure xlink:title="driller's log" -->
					<!--If [lithology:log_type] = "E" then om:procedure xlink:title="engineer's log" -->
					<!--If [lithology:log_type] = "G" then om:procedure xlink:title="geologist's log" -->
					<!-- #### Need appropriate xlink:href URIs for "driller's log", "engineer's log" and "geologist's log" -->
					<om:procedure xlink:href="http://??" xlink:title="driller's log"/>
					<om:observedProperty xlink:href="http://www.opengis.net/def/gwml/2.0/observedProperty/earthMaterial" xlink:title="lithology"/>
					<!-- The  om:featureOfInterest is the GW_Well the lithology describes.  -->
					<!-- FedUni - om:featureOfInterest xlink:href="http://groundwater.victoria.com.au/feature/water-well/feduni.borehole.[bore.bore_id]" -->
					<om:featureOfInterest xlink:href="http://groundwater.victoria.com.au/feature/water-well/feduni.borehole.51409"/>


					<om:result>
						<!-- gwml2w:GW_GeologyLogCoverage gml:id="feduni.borehole.[bore:bore_id].lithology.[lithology:log_type].lithology:lithology_id].coverage" for lithology logs -->
						<gwml2w:GW_GeologyLogCoverage gml:id="feduni.borehole.lithology.51409.242285.coverage">
						<!-- FedUni - First element in lithology coverage -->
							<gwml2w:element>
								<gwml2w:LogValue>
									<gwml2w:fromDepth>
										<swe:Quantity>
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<!-- swe:value from [lithology.from_m] -->
											<swe:value>0.00</swe:value>
										</swe:Quantity>
									</gwml2w:fromDepth>
									<gwml2w:toDepth>
										<swe:Quantity>
											<!-- swe:value from [lithology.to_m] -->
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<swe:value>2</swe:value>
										</swe:Quantity>
									</gwml2w:toDepth>
									<gwml2w:value>
										<!-- swe:DataRecord needs defining for free text record -->
										<swe:DataRecord definition="http://www.opengis.net/def/gwml/2.0/data-record/free-text">
											<swe:field name="lithology">
												<!-- FedUni bore has no lithology code so there is no category, just a lithology description free text -->
												<swe:Text>
													<!-- swe:value from [lithology:lthology_description] -->
													<swe:value>brown clay</swe:value>
												</swe:Text>
											</swe:field>
										</swe:DataRecord>
									</gwml2w:value>
								</gwml2w:LogValue>
							</gwml2w:element>
							<!-- FedUni - second element in lithology coverage -->
							<gwml2w:element>
								<gwml2w:LogValue>
									<gwml2w:fromDepth>
										<swe:Quantity>
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<swe:value>2</swe:value>
										</swe:Quantity>
									</gwml2w:fromDepth>
									<gwml2w:toDepth>
										<swe:Quantity>
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<swe:value>6</swe:value>
										</swe:Quantity>
									</gwml2w:toDepth>
									<gwml2w:value>
										<swe:DataRecord definition="http://www.opengis.net/def/gwml/2.0/observedProperty/earthMaterial">
											<swe:field name="lithology">
												<swe:Text>
													<!-- swe:value from [lithology:lthology_description] -->
													<swe:value>weathered grey brown basalt</swe:value>
												</swe:Text>
											</swe:field>
										</swe:DataRecord>
									</gwml2w:value>
								</gwml2w:LogValue>
							</gwml2w:element>
							<!-- FedUni - third element in lithology coverage -->
							<gwml2w:element>
								<gwml2w:LogValue>
									<gwml2w:fromDepth>
										<swe:Quantity>
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<swe:value>6</swe:value>
										</swe:Quantity>
									</gwml2w:fromDepth>
									<gwml2w:toDepth>
										<swe:Quantity>
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<swe:value>19</swe:value>
										</swe:Quantity>
									</gwml2w:toDepth>
									<gwml2w:value>
										<swe:DataRecord definition="http://www.opengis.net/def/gwml/2.0/observedProperty/earthMaterial">
											<swe:field name="lithology">
												<swe:Text>
													<!-- swe:value from [lithology:lthology_description] -->
													<swe:value>BLUE BASALT (W)</swe:value>
												</swe:Text>
											</swe:field>
										</swe:DataRecord>
									</gwml2w:value>
								</gwml2w:LogValue>
							</gwml2w:element>
						</gwml2w:GW_GeologyLogCoverage>
					</om:result>
					<!-- FedUni - gwml2w:startDepth and gwml2w:endDepth capture the top and bottom values of the log. These are {lithology.from_m] and [lithology.to_m] for the total log -->
					<gwml2w:startDepth>
						<swe:Quantity>
							<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
							<swe:value>0</swe:value>
						</swe:Quantity>
					</gwml2w:startDepth>
					<gwml2w:endDepth>
						<swe:Quantity>
<!-- FedUni - <swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/> -->
							<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
							<swe:value>19</swe:value>
						</swe:Quantity>
					</gwml2w:endDepth>
				</gwml2w:GW_GeologyLog></gml:featureMember>
					<!-- This gml:featureMember is a gwml2w:GW_GeologyLog based on [stratigraphy] table -->
<gml:featureMember>
				<!-- gwml2w:GW_GeologyLog gml:id="feduni.borehole.stratigraphy.[stratigraphy.bore_id_fk]"  for Stratigraphy logs -->
				<gwml2w:GW_GeologyLog gml:id="feduni.borehole.stratigraphy.51409">

			<!-- FedUni - gml:identifier codeSpace="http://www.ietf.org/rfc/rfc2616" value
 ="http://groundwater.victoria.com.au/feature/geology-log/feduni.borehole.stratigraphy.[stratigraphy.bore_id_fk]. -->
		<gml:identifier codeSpace="http://www.ietf.org/rfc/rfc2616">http://groundwater.victoria.com.au/feature/geology-log/feduni.borehole.stratigraphy.51409</gml:identifier>
					<!-- FedUni - does not have the time stratigraphy log was made -->
					<om:phenomenonTime nilReason="unknown"/>
					<om:resultTime nilReason="unknown"/>
					<!-- FedUni - does not record method stratigraphy log was created -->
					<om:procedure xsi:nil="true" nilReason="unknown"/>
					<om:observedProperty xlink:href="http://www.opengis.net/def/gwml/2.0/observedProperty/stratigraphy" xlink:title="stratigraphy"/>
						<!-- The  om:featureOfInterest is the GW_Well the stratigraphy describes.  -->
					<!-- FedUni - om:featureOfInterest xlink:href="http://groundwater.victoria.com.au/feature/water-well/feduni.borehole.[bore.bore_id]" -->
					<om:featureOfInterest xlink:href="http://groundwater.victoria.com.au/feature/water-well/feduni.borehole.51409"/>
					<om:result>
						<!-- gwml2w:GW_GeologyLogCoverage gml:id="feduni.borehole.stratigraphy.[stratigraphy.bore_id_fk].coverage" for stratigraphy logs -->
						<gwml2w:GW_GeologyLogCoverage gml:id="feduni.borehole.stratigraphy.51409.coverage">

							<gwml2w:element>
								<gwml2w:LogValue>
									<gwml2w:fromDepth>
										<swe:Quantity>
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<!-- swe:value from [stratigraphy.from_m] -->
											<swe:value>0.00</swe:value>
										</swe:Quantity>
									</gwml2w:fromDepth>
									<gwml2w:toDepth>
										<swe:Quantity>
											<!-- swe:value from [stratigraphy.to_m] -->
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<swe:value>19</swe:value>
										</swe:Quantity>
									</gwml2w:toDepth>
									<gwml2w:value>
										<!-- swe:DataRecord needs defining for stratigraphy record -->
										<swe:DataRecord definition="http://www.opengis.net/def/gwml/2.0/observedProperty/stratigraphy">
											<swe:field name="stratigraphy">
												<!-- Following is for categorical example to be used for stratigraphic log -->
												<swe:Category definition="http://www.opengis.net/def/gwml/2.0/observedProperty/stratigraphy">
													<!-- swe:description from [stratigraphy:formation_description] -->
													<swe:description>Some geological description</swe:description>
													<swe:codeSpace xlink:href="http://geology.data.gov.vic.au/stratigraphicunit"/>
													<!-- swe:value from [stratigraphy:strat_code] -->
													<swe:value>To</swe:value>
												</swe:Category>
											</swe:field>
										</swe:DataRecord>
									</gwml2w:value>
								</gwml2w:LogValue>
							</gwml2w:element>
							<gwml2w:element>
								<gwml2w:LogValue>
									<gwml2w:fromDepth>
										<swe:Quantity>
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<swe:value>0.30</swe:value>
										</swe:Quantity>
									</gwml2w:fromDepth>
									<gwml2w:toDepth>
										<swe:Quantity>
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<swe:value>4.27</swe:value>
										</swe:Quantity>
									</gwml2w:toDepth>
									<gwml2w:value>
										<swe:DataRecord definition="http://www.opengis.net/def/gwml/2.0/observedProperty/earthMaterial" id="le.2">
											<swe:field name="stratigraphy">
												<!-- Following is for categorical example to be used for stratigraphic log -->
												<swe:Category definition="http://www.opengis.net/def/gwml/2.0/observedProperty/stratigraphy">
													<!-- swe:description from [stratigraphy:formation_description] -->
													<swe:description>Newer Volcanics Formation</swe:description>
													<swe:codeSpace xlink:href="http://geology.data.gov.vic.au/stratigraphicunit"/>
													<!-- swe:value from [stratigraphy:strat_code] -->
													<swe:value>Qvn</swe:value>
												</swe:Category>
											</swe:field>
										</swe:DataRecord>
									</gwml2w:value>
								</gwml2w:LogValue>
							</gwml2w:element>
						</gwml2w:GW_GeologyLogCoverage>
					</om:result>
					<!-- #### gwml2w:startDepth and gwml2w:endDepth capture the top and bottom values of the log. Is the only way to determine this to check all [stratigraphy:from_m] and [lstratigraphy:to_m] for a specific [lstratigraphy:stratigraphy_id] and select smallest and largest respectively? -->
					<gwml2w:startDepth>
						<swe:Quantity>
							<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
							<swe:value>0</swe:value>
						</swe:Quantity>
					</gwml2w:startDepth>
					<gwml2w:endDepth>
						<swe:Quantity>
						<!-- FedUni - <swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/> -->
							<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
							<swe:value>11.58</swe:value>
						</swe:Quantity>
					</gwml2w:endDepth>
				</gwml2w:GW_GeologyLog>
				</gml:featureMember>
				<!-- This gml:featureMember is an age gwml2w:GW_GeologyLog based on [stratigraphy] table -->
				<gml:featureMember>
				<!-- gwml2w:GW_GeologyLog gml:id="feduni.borehole.age.[stratigraphy.bore_id_fk]" for geologic age logs -->
				<gwml2w:GW_GeologyLog gml:id="feduni.borehole.age.51409">


			<!-- FedUni - gml:identifier codeSpace="http://www.ietf.org/rfc/rfc2616" value
 ="http://groundwater.victoria.com.au/feature/geology-log/feduni.borehole.age.[stratigraphy.bore_id_fk]. -->
		<gml:identifier codeSpace="http://www.ietf.org/rfc/rfc2616">http://groundwater.victoria.com.au/feature/geology-log/feduni.borehole.age.51409</gml:identifier>
					<!-- FedUni does not have the time the age log was made -->
					<om:phenomenonTime nilReason="unknown"/>
					<om:resultTime nilReason="unknown"/>
					<!-- FedUni does not record method age log was created -->
					<om:procedure xsi:nil="true" nilReason="unknown"/>
					<om:observedProperty xlink:href="http://www.opengis.net/def/gwml/2.0/observedProperty/geologicAge" xlink:title="geologic age"/>
								<!-- The  om:featureOfInterest is the GW_Well the age describes.  -->
					<!-- FedUni - om:featureOfInterest xlink:href="http://groundwater.victoria.com.au/feature/water-well/feduni.borehole.[bore.bore_id]" -->
					<om:featureOfInterest xlink:href="http://groundwater.victoria.com.au/feature/water-well/feduni.borehole.51409"/>

					<om:result>
						<!-- gwml2w:GW_GeologyLogCoverage gml:id="feduni.borehole.age.[stratigraphy.bore_id_fk].coverage" for stratigraphy logs -->
						<gwml2w:GW_GeologyLogCoverage gml:id="feduni.borehole.age.51409.coverage">
							<gwml2w:element>
								<gwml2w:LogValue>
									<gwml2w:fromDepth>
										<swe:Quantity>
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<!-- swe:value from [stratigraphy.from_m] -->
											<swe:value>0.00</swe:value>
										</swe:Quantity>
									</gwml2w:fromDepth>
									<gwml2w:toDepth>
										<swe:Quantity>
											<!-- swe:value from [stratigraphy.to_m] -->
											<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
											<swe:value>0.30</swe:value>
										</swe:Quantity>
									</gwml2w:toDepth>
									<gwml2w:value>
										<!-- swe:DataRecord needs defining for age record -->
										<swe:DataRecord definition="http://www.opengis.net/def/gwml/2.0/observedProperty/geologicAge">
											<swe:field name="geologicAge">
												<!-- Following is for categorical example to be used for chronostratigraphic log -->
												<swe:Category definition="http://www.opengis.net/def/gwml/2.0/observedProperty/chronostratigraphy">
													<!-- swe:description from [stratigraphy:formation_description] -->
													<!-- Need to map [stratigraphy:formation_age] values to http://resource.geosciml.org/classifier/ics/ischart/ values -->
													<swe:identifier>xlink:href="http://resource.geosciml.org/classifier/ics/ischart/Quaternary"</swe:identifier>
													<swe:description>Some geological description</swe:description>
													<!-- Need to map [stratigraphy:formation_age] values to http://resource.geosciml.org/classifier/ics/ischart/ values -->
													<swe:codeSpace xlink:href="http://resource.geosciml.org/classifier/ics/ischart/Quaternary"/>
													<!-- swe:value from [stratigraphy:formation_age] -->
													<swe:value>Quaternary</swe:value>
												</swe:Category>
											</swe:field>
										</swe:DataRecord>
									</gwml2w:value>
								</gwml2w:LogValue>
							</gwml2w:element>
						</gwml2w:GW_GeologyLogCoverage>
					</om:result>
					<!-- ???? FedUni - gwml2w:startDepth and gwml2w:endDepth capture the top and bottom values of the log. Is the only way to determine this to check all [stratigraphy:from_m] and [stratigraphy:to_m] for a specific [stratigraphy:stratigraphy_id] and select smallest and largest respectively? -->
					<gwml2w:startDepth>
						<swe:Quantity>
<!-- FedUni - <swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/> -->
							<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
							<swe:value>0</swe:value>
						</swe:Quantity>
					</gwml2w:startDepth>
					<gwml2w:endDepth>
						<swe:Quantity>
<!-- FedUni - <swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/> -->
							<swe:uom xlink:href="http://qudt.org/vocab/unit#Meter" xlink:title="metre" code="m"/>
							<swe:value>11.58</swe:value>
						</swe:Quantity>
					</gwml2w:endDepth>
				</gwml2w:GW_GeologyLog>
			</gml:featureMember>
			</gml:FeatureCollection>

