Skip to content

Commit

Permalink
Record view / DQ / Add measure date information
Browse files Browse the repository at this point in the history
The same measure may be followed over time - Add the date information if
available.
  • Loading branch information
fxprunayre committed Nov 27, 2023
1 parent 4ff1aba commit 50694f5
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1172,21 +1172,28 @@
<xsl:for-each select="mdq:report/*[
normalize-space(mdq:measure/*/mdq:nameOfMeasure/gco:CharacterString) != ''
or normalize-space(mdq:measure/*/mdq:measureDescription/gco:CharacterString) != ''
]">
]/mdq:result/mdq:DQ_QuantitativeResult">

<xsl:variable name="name"
select="(mdq:measure/*/mdq:nameOfMeasure/gco:CharacterString)[1]"/>
select="(../../mdq:measure/*/mdq:nameOfMeasure/gco:CharacterString)[1]"/>
<xsl:variable name="value"
select="(mdq:result/mdq:DQ_QuantitativeResult/mdq:value)[1]"/>
select="mdq:value"/>
<xsl:variable name="unit"
select="(mdq:result/mdq:DQ_QuantitativeResult/mdq:valueUnit//gml:identifier)[1]"/>
select="mdq:valueUnit//gml:identifier"/>
<xsl:variable name="description"
select="(mdq:measure/*/mdq:measureDescription/gco:CharacterString)[1]"/>
select="(../../mdq:measure/*/mdq:measureDescription/gco:CharacterString)[1]"/>

<xsl:variable name="measureDate"
select="mdq:dateTime/gco:DateTime"/>

<measure type="object">{
"name": "<xsl:value-of select="gn-fn-index:json-escape($name)"/>",
<xsl:if test="$description != ''">
"description": "<xsl:value-of select="gn-fn-index:json-escape($description)"/>",
</xsl:if>
<xsl:if test="$measureDate != ''">
"date": "<xsl:value-of select="gn-fn-index:json-escape($measureDate)"/>",
</xsl:if>
<!-- First value only. -->
"value": "<xsl:value-of select="gn-fn-index:json-escape($value/gco:Record[1])"/>",
<xsl:if test="$unit != ''">
Expand All @@ -1196,7 +1203,7 @@
}
</measure>

<xsl:for-each select="mdq:result/mdq:DQ_QuantitativeResult/mdq:value/gco:Record[. != '']">
<xsl:for-each select="mdq:value/gco:Record[. != '']">
<xsl:element name="measure_{gn-fn-index:build-field-name($name)}">
<xsl:value-of select="."/>
</xsl:element>
Expand Down
17 changes: 11 additions & 6 deletions schemas/iso19139/src/main/plugin/iso19139/index-fields/index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -967,20 +967,25 @@


<xsl:for-each select="gmd:report/*[gmd:nameOfMeasure/gco:CharacterString != ''
or gmd:measureDescription/gco:CharacterString != '']">
or gmd:measureDescription/gco:CharacterString != '']/gmd:result/gmd:DQ_QuantitativeResult">
<xsl:variable name="name"
select="(gmd:nameOfMeasure/gco:CharacterString)[1]"/>
select="(../../gmd:nameOfMeasure/gco:CharacterString)[1]"/>
<xsl:variable name="value"
select="(gmd:result/gmd:DQ_QuantitativeResult/gmd:value)[1]"/>
select="(gmd:value)[1]"/>
<xsl:variable name="unit"
select="(gmd:result/gmd:DQ_QuantitativeResult/gmd:valueUnit//(gml:identifier|gml320:identifier))[1]"/>
select="(gmd:valueUnit//(gml:identifier|gml320:identifier))[1]"/>
<xsl:variable name="description"
select="(gmd:measureDescription/gco:CharacterString)[1]"/>
select="(../../gmd:measureDescription/gco:CharacterString)[1]"/>
<xsl:variable name="measureDate"
select="../../gmd:dateTime/gco:DateTime"/>
<measure type="object">{
"name": "<xsl:value-of select="gn-fn-index:json-escape($name)"/>",
<xsl:if test="$description != ''">
"description": "<xsl:value-of select="gn-fn-index:json-escape($description)"/>",
</xsl:if>
<xsl:if test="$measureDate != ''">
"date": "<xsl:value-of select="gn-fn-index:json-escape($measureDate)"/>",
</xsl:if>
<!-- First value only. -->
"value": "<xsl:value-of select="gn-fn-index:json-escape($value/gco:Record[1])"/>",
<xsl:if test="$unit != ''">
Expand All @@ -990,7 +995,7 @@
}
</measure>

<xsl:for-each select="gmd:result/gmd:DQ_QuantitativeResult/gmd:value/gco:Record[. != '']">
<xsl:for-each select="gmd:value/gco:Record[. != '']">
<xsl:element name="measure_{gn-fn-index:build-field-name($name)}">
<xsl:value-of select="."/>
</xsl:element>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,7 @@
]);

module.directive("gnQualityMeasuresTable", [
"gnGlobalSettings",
function (gnGlobalSettings) {
function () {
return {
templateUrl:
"../../catalog/components/search/mdview/partials/qualitymeasures.html",
Expand All @@ -597,9 +596,10 @@
name: false,
description: false,
value: false,
type: false
type: false,
date: false
};
for (idx in scope.measures) {
for (var idx in scope.measures) {
angular.forEach(Object.keys(scope.columnVisibility), function (p) {
if (scope.measures[idx][p]) {
scope.columnVisibility[p] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{{(columnVisibility['name'] ? 'measureDescription' : 'measureName') | translate}}
</td>
<td data-ng-if="columnVisibility['value']" data-translate="">measureValue</td>
<td data-ng-if="columnVisibility['date']" data-translate="">measureDate</td>
</tr>
</thead>
<tbody>
Expand All @@ -17,6 +18,7 @@
<td data-ng-if="columnVisibility['value']">
{{m.value}} <span data-ng-if="m.unit"> {{m.unit}}</span>
</td>
<td data-ng-if="columnVisibility['date']">{{m.date}}</td>
</tr>
</tbody>
</table>
1 change: 1 addition & 0 deletions web-ui/src/main/resources/catalog/locales/en-v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@
"measureName": "Measure",
"measureDescription": "Description",
"measureValue": "Value",
"measureDate": "Date",
"switchPortals": "Switch to another Portal",
"dataPreview": "Discover data",
"tableOfContents": "Table of Contents",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ <h2 data-translate="">technicalInformation</h2>

<div
class="row gn-section gn-section-{{mdView.current.record.resourceType[0]}} gn-padding-bottom-lg"
data-ng-if="mdView.current.record.specificationConformance || mdView.current.record.processSteps"
data-ng-if="mdView.current.record.specificationConformance || mdView.current.record.measure || mdView.current.record.processSteps"
>
<div class="col-md-8 gn-record">
<div ng-include="'../../catalog/views/default/templates/recordView/quality.html'" />
Expand Down
23 changes: 23 additions & 0 deletions web/src/main/webResources/WEB-INF/data/config/index/records.json
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,29 @@
}
}
},
"measure": {
"type": "nested",
"properties": {
"name": {
"type": "keyword"
},
"description": {
"type": "text"
},
"date": {
"type": "date"
},
"value": {
"type": "keyword"
},
"unit": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
}
},
"processSteps": {
"type": "nested",
"properties": {
Expand Down

0 comments on commit 50694f5

Please sign in to comment.