Skip to content

Commit

Permalink
Merge pull request #36 from BROprogramma/Versie_0_99
Browse files Browse the repository at this point in the history
Versie 0.99v2
  • Loading branch information
RHuismn authored Nov 28, 2023
2 parents 9a4053d + 56a81b2 commit 23f206e
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,23 @@
<xsl:copy-of select="sikb:checkGeometryElement(.,$prGUID,'gml:MultiSurface','ERROR')"/>
<!--> Check of the reportDate voor vandaag is-->
<xsl:copy-of select="sikb:checkDateBeforeDate(., $prGUID, 'reportDate', 'current', 'ERROR')"/>
<!-- Check sub elementen-->
<xsl:copy-of select="sikb:checkDependancyProjectSubElements(., $prGUID, 'projectType', '|3|5|6|7|8|12|', 'measurementObjects', 'WARNING')"/>
<xsl:if test="not(./*[local-name()='measurementObjects']) and contains('|3|5|6|7|8|12|', concat('|', substring-after(./*[local-name()='projectType'], ':id:'), '|'))">

<!-- Check meetpunten aanwezigheid-->
<xsl:if test="not(./*[local-name()='measurementObjects'])">
<xsl:variable name="message" select="replace(string-join(('Bij', string(./local-name()), $prGUID, 'moet een measurementObject zijn opgevoerd, tenzij er vanuit Archief alleen mengmonsters bekend zijn.'), ' '), ' ', ' ')"/>
<xsl:copy-of select="sikb:createRecord('WARNING', string(./name()), $message)"/>
</xsl:if>
<!-- Check existence sample with @xlink:href='urn:immetingen:RelatedSamplingFeatureRollen:id:6' -->
<xsl:if test="not(//@xlink:href='urn:immetingen:RelatedSamplingFeatureRollen:id:6') and contains('|3|5|6|7|8|', concat('|', substring-after(.//imsikb0101:projectType, ':id:'), '|'))">
<xsl:if test="not(//@xlink:href='urn:immetingen:RelatedSamplingFeatureRollen:id:6')">
<xsl:variable name="message" select="replace(string-join(('Bij', string(./local-name()), $prGUID, 'moet een Sample met role urn:immetingen:RelatedSamplingFeatureRollen:id:6 zijn opgevoerd, tenzij er vanuit Archief geen meetpunten bekend zijn.'), ' '), ' ', ' ')"/>
<xsl:copy-of select="sikb:createRecord('WARNING', 'xml-bestand', $message)"/>
</xsl:if>
<!-- Check existence Analysis -->
<xsl:if test="not(//immetingen:Analysis) and contains('|3|5|6|7|8|', concat('|', substring-after(//imsikb0101:projectType, ':id:'), '|'))">
<!-- Check existence Analysis for Watersamples or AnalysisSamples-->
<xsl:if test="not(//immetingen:Analysis)">
<xsl:variable name="message" select="'In het xml-bestand moet een Analysis zijn opgenomen.'"/>
<xsl:copy-of select="sikb:createRecord('ERROR', 'xml-bestand', $message)"/>
</xsl:if>
<xsl:if test="not(//immetingen:Analysis) and contains('|11|', concat('|', substring-after(.//imsikb0101:projectType, ':id:'), '|'))">
<xsl:if test="not(//immetingen:Analysis)">
<xsl:variable name="message" select="'In het xml-bestand moet een Analysis zijn opgenomen.'"/>
<xsl:copy-of select="sikb:createRecord('ERROR', 'xml-bestand', $message)"/>
</xsl:if>
Expand Down Expand Up @@ -169,16 +169,17 @@
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'measurementObjectType', 'ERROR')"/>
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'geometry', 'ERROR')"/>
<xsl:copy-of select="sikb:checkFilled(., $prGUID, 'geometry', 'ERROR')"/>
<!-- Depth is required, except when it a measurement location or point -->
<xsl:if test="not(lower-case(./immetingen:measurementObjectType) = lower-case('urn:immetingen:MeetObjectSoort:id:7') or lower-case(./immetingen:measurementObjectType) = lower-case('urn:immetingen:MeetObjectSoort:id:8'))">
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'depth', 'ERROR')"/>
</xsl:if>

<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'groundLevel', 'WARNING')"/>
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'startTime', 'ERROR')"/>
<xsl:copy-of select="sikb:checkLength(., $prGUID, 'name', 24, 'ERROR')"/>
<xsl:copy-of select="sikb:checkLookupId(., $prGUID, 'measurementObjectType', 'MeetObjectSoort', 'ERROR')"/>
<xsl:variable name="layers" select="//imsikb0101:Layer[sam:relatedSamplingFeature/sam:SamplingFeatureComplex/sam:relatedSamplingFeature/@xlink:href = concat('#', $prGUID) and sam:relatedSamplingFeature/sam:SamplingFeatureComplex/sam:role/@xlink:href = 'urn:immetingen:RelatedSamplingFeatureRollen:id:4']"/>
<xsl:copy-of select="sikb:checkConnectedLayers($prGUID, $layers)"/>

<xsl:if test="not(contains('|1|6|12|16|18|21|', concat('|', substring-after(./*[local-name()='measurementObjectType'], ':id:'), '|')))">
<xsl:copy-of select="sikb:createRecord('WARNING', 'imsikb0101:Borehole', string-join(('This Borehole will be ignored, because it has an unsupported measurementObjectType; Borehole gml:id =', $prGUID), ' ') )"/>
</xsl:if>
</xsl:template>
<xsl:template match="imsikb0101:MeasurementObject">
<xsl:variable name="prGUID" select="@gml:id"/>
Expand All @@ -188,10 +189,16 @@
<xsl:copy-of select="sikb:checkExistence(., $prGUID, 'startTime', 'ERROR')"/>
<xsl:copy-of select="sikb:checkLookupId(., $prGUID, 'measurementObjectType', 'MeetObjectSoort', 'ERROR')"/>
<xsl:copy-of select="sikb:checkLength(., $prGUID, 'name', 24, 'ERROR')"/>
<xsl:if test="not(contains('|1|6|12|16|18|21|', concat('|', substring-after(./*[local-name()='measurementObjectType'], ':id:'), '|')))">
<xsl:copy-of select="sikb:createRecord('WARNING', 'imsikb0101:MeasurementObject', string-join(('This MeasurementObject will be ignored, because it has an unsupported measurementObjectType; Borehole gml:id =', $prGUID), ' ') )"/>
</xsl:if>
</xsl:template>
<xsl:template match="immetingen:MeasurementObject">
<xsl:variable name="prGUID" select="@gml:id"/>
<xsl:copy-of select="sikb:checkGeometryElement(., $prGUID, 'gml:Point', 'ERROR')"/>
<xsl:if test="not(contains('|1|6|12|16|18|21|', concat('|', substring-after(./*[local-name()='measurementObjectType'], ':id:'), '|')))">
<xsl:copy-of select="sikb:createRecord('WARNING', 'imsikb0101:MeasurementObject', string-join(('This MeasurementObject will be ignored, because it has an unsupported measurementObjectType; Borehole gml:id =', $prGUID), ' ') )"/>
</xsl:if>
</xsl:template>
<!-- Layers-->
<xsl:template match="imsikb0101:Layer">
Expand Down Expand Up @@ -711,16 +718,7 @@
<xsl:copy-of select="sikb:createRecord($errorType, $elementName, $message)"/>
</xsl:if>
</xsl:if>
</xsl:function>
<xsl:function name="sikb:checkSender">
<xsl:param name="context"/>
<xsl:param name="prGUID"/>
<xsl:param name="errorType"/>
<xsl:if test="(sikb:checkValueBetween($context, $prGUID, 'sender', 9999, 10111, $errorType))">
<!-- Als waarde niet tussen 9999 en 10111 (waarden gebruikt voor test doeleinden) dan controle of waarde voorkomt in lookup-tabellen-->
<xsl:copy-of select="sikb:checkLookupId($context, $prGUID, 'sender', 'Bronhouders', $errorType)"/>
</xsl:if>
</xsl:function>
</xsl:function>
<xsl:function name="sikb:checkDependancyFields">
<!-- Function to check if field depending on another field exists -->
<xsl:param name="context"/>
Expand Down Expand Up @@ -749,26 +747,7 @@
<xsl:if test="substring-after($context/*[local-name()=$field], ':id:') = $condition and string-length(string($context/*[local-name()=$checkField])) = 0">
<xsl:copy-of select="sikb:createRecord($errorType, $elementName, $message)"/>
</xsl:if>
</xsl:function>
<xsl:function name="sikb:checkDependancyDecisionProject">
<!-- Function to check if field depending on another field exists -->
<xsl:param name="context"/>
<xsl:param name="prGUID"/>
<xsl:param name="decisionTypeValue"/>
<xsl:param name="projectType"/>
<xsl:param name="errorType"/>
<xsl:variable name="elementName" select="string($context/name())"/>
<xsl:variable name="elementLocalName" select="string($context/local-name())"/>
<xsl:variable name="decisionTypeValue" select="document($imsikb0101LookupFile)//*[@categorie='Besluit']/*[id = $decisionTypeValue]/waarde"/>
<xsl:variable name="projectTypeValue" select="document($imsikb0101LookupFile)//*[@categorie='OnderzoekType']/*[id = $projectType]/waarde"/>
<xsl:variable name="dossierGmlId" select="$context/ancestor::imsikb0101:Dossier/@gml:id"/>
<xsl:variable name="decisions" select="$context[imsikb0101:decisionType=string-join(('urn:imsikb0101:Besluit:id:', $decisionTypeValue), '')]"/>
<xsl:variable name="projects" select="$context/ancestor::node()//FeatureCollectionIMSIKB0101/imsikb0101:Project[imsikb0101:dossiers/@xlink:href=string-join(('#', $dossierGmlId), '') and imsikb0101:projectType=string-join(('urn:imsikb0101:OnderzoekType:id:', $projectType), '')]"/>
<xsl:variable name="message" select="replace(string-join(($elementLocalName, $prGUID, 'betreft een', $decisionTypeValue, 'maar een Project van het type', $projectTypeValue, 'ontbreekt.'), ' '), ' ', ' ')"/>
<xsl:if test="count($decisions)!=0 and count($projects)=0">
<xsl:copy-of select="sikb:createRecord($errorType, $elementName, $message)"/>
</xsl:if>
</xsl:function>
</xsl:function>
<xsl:function name="sikb:checkCoordinates">
<!-- Function to check if coordinates are correct -->
<xsl:param name="context"/>
Expand Down Expand Up @@ -878,7 +857,7 @@
</xsl:if>
</xsl:if>
</xsl:function>
<xsl:function name="sikb:checkDependancyProjectSubElements">
<xsl:function name="sikb:checkDependancySubElements">
<xsl:param name="context"/>
<xsl:param name="prGUID"/>
<xsl:param name="field"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@
<unit>14</unit>
<unit>60</unit>
<unit>79</unit>
<unit>1</unit>
</units>
</quantity>
<quantity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<imsikb0101:name>SIKB Voorbeeld project Protocol 2001 en 2002</imsikb0101:name>
<imsikb0101:phase>urn:imsikb0101:OnderzoeksfaseType:id:5</imsikb0101:phase>
<imsikb0101:projectCode>SIKB_PROT_2001_2002</imsikb0101:projectCode>
<imsikb0101:projectType>urn:imsikb0101:OnderzoekType:id:1</imsikb0101:projectType>
<imsikb0101:projectType>urn:imsikb0101:OnderzoekType:id:3</imsikb0101:projectType>
<imsikb0101:remarks>Opmerking bij het project</imsikb0101:remarks>
<imsikb0101:reportDate>2018-12-07</imsikb0101:reportDate>
<imsikb0101:reportNumber>123123</imsikb0101:reportNumber>
Expand Down Expand Up @@ -526,7 +526,7 @@
</immetingen:Height>
</imsikb0101:heightTopFiltertube>
<imsikb0101:filtertubeDiameter uom="urn:immetingen:Eenheid:id:19">82</imsikb0101:filtertubeDiameter>
<imsikb0101:filtertubeLength uom="urn:immetingen:Eenheid:id:19">0</imsikb0101:filtertubeLength>
<imsikb0101:filtertubeLength uom="urn:immetingen:Eenheid:id:19">200</imsikb0101:filtertubeLength>
<imsikb0101:filtertubeMaterial>PVC</imsikb0101:filtertubeMaterial>
</imsikb0101:Filter>
</imsikb0101:featureMember>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,12 @@
<sadcom:filter>
<sadcom:Filter gml:id="_9d0e6631-0268-4929-8303-c9e24f6145e5">
<sadcom:deliveredVerticalPosition>
<!-- optioneel bovenkant peilbuis tov maaiveld> -->
<sadcom:groundLevelPosition uom="m">0.20</sadcom:groundLevelPosition>
<sadcom:localVerticalReferencePoint codeSpace="urn:bro:sad:LocalVerticalReferencePoint">bovenkantPeilbuis</sadcom:localVerticalReferencePoint>
<!-- bovenkantPeilbuis hoogte -->
<sadcom:offset uom="m">0.22</sadcom:offset>
<sadcom:verticalDatum codeSpace="urn:bro:sad:VerticalDatum">nap</sadcom:verticalDatum>
<!-- maaiveld hoogte tov nap -->
<sadcom:offset uom="m">0.02</sadcom:offset>
<sadcom:verticalDatum codeSpace="urn:bro:sad:VerticalDatum">maaiveld</sadcom:verticalDatum>
</sadcom:deliveredVerticalPosition>
<sadcom:identification>9d0e6631-0268-4929-8303-c9e24f6145e5</sadcom:identification>
<sadcom:lowerBoundary uom="m">1.80</sadcom:lowerBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,13 @@
<sadcom:filter>
<sadcom:Filter gml:id="_9d0e6631-0268-4929-8303-c9e24f6145e5">
<sadcom:deliveredVerticalPosition>
<!-- optioneel bovenkant peilbuis tov maaiveld> -->
<sadcom:groundLevelPosition uom="m">0.20</sadcom:groundLevelPosition>
<sadcom:localVerticalReferencePoint codeSpace="urn:bro:sad:LocalVerticalReferencePoint">bovenkantPeilbuis</sadcom:localVerticalReferencePoint>
<!-- bovenkantPeilbuis hoogte -->
<sadcom:offset uom="m">0.22</sadcom:offset>
<sadcom:verticalDatum codeSpace="urn:bro:sad:VerticalDatum">nap</sadcom:verticalDatum>
</sadcom:deliveredVerticalPosition>
<!-- maaiveld hoogte tov nap -->
<sadcom:offset uom="m">0.02</sadcom:offset>
<sadcom:verticalDatum codeSpace="urn:bro:sad:VerticalDatum">maaiveld</sadcom:verticalDatum>
</sadcom:deliveredVerticalPosition>
<sadcom:identification>9d0e6631-0268-4929-8303-c9e24f6145e5</sadcom:identification>
<sadcom:lowerBoundary uom="m">1.80</sadcom:lowerBoundary>
<sadcom:name>Filter1</sadcom:name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,13 @@
<sadcom:filter>
<sadcom:Filter gml:id="_9d0e6631-0268-4929-8303-c9e24f6145e5">
<sadcom:deliveredVerticalPosition>
<!-- optioneel bovenkant peilbuis tov maaiveld> -->
<sadcom:groundLevelPosition uom="m">0.20</sadcom:groundLevelPosition>
<sadcom:localVerticalReferencePoint codeSpace="urn:bro:sad:LocalVerticalReferencePoint">bovenkantPeilbuis</sadcom:localVerticalReferencePoint>
<!-- bovenkantPeilbuis hoogte -->
<sadcom:offset uom="m">0.22</sadcom:offset>
<sadcom:verticalDatum codeSpace="urn:bro:sad:VerticalDatum">nap</sadcom:verticalDatum>
</sadcom:deliveredVerticalPosition>
<!-- maaiveld hoogte tov nap -->
<sadcom:offset uom="m">0.02</sadcom:offset>
<sadcom:verticalDatum codeSpace="urn:bro:sad:VerticalDatum">maaiveld</sadcom:verticalDatum>
</sadcom:deliveredVerticalPosition>
<sadcom:identification>9d0e6631-0268-4929-8303-c9e24f6145e5</sadcom:identification>
<sadcom:lowerBoundary uom="m">1.80</sadcom:lowerBoundary>
<sadcom:name>Filter1</sadcom:name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ Explanation: Betreft het internetadres waar het onderzoeksrapport te vinden is.
</xs:complexType>
<xs:complexType name="GroundLevelType">
<xs:sequence>
<xs:element name="groundlevelPosition" minOccurs="0" maxOccurs="1">
<xs:element name="groundLevelPosition" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation source="http://www.imvertor.org/model-info/technical-documentation">Definition: De positie van het maaiveld ten opzichte van het lokaal verticaal referentiepunt van de peilbuis.
Explanation: Dit is de positie van het maaiveld t.o.v. de bovenkant van de peilbuis. De waarde kan positief of negatief zijn. Als de waarde positief is, bevindt de bovenkant van de peilbuis zich boven het maaiveld. Is de waarde negatief, dan bevindt de bovenkant van de peilbuis zich onder het maaiveld. De positie van het maaiveld is van belang om de metingen in de peilbuis in de juiste ruimtelijke context te kunnen plaatsen.</xs:documentation>
Expand Down

0 comments on commit 23f206e

Please sign in to comment.