Page tree
Skip to end of metadata
Go to start of metadata

Contents

Overview

Different kind of properties can be defined for samples in the region config file SampleMetadataSchema.xml. 

They can have different value types like the predefined string, double or dataTime but also custom value types.

With custom value types it is possible to define a list of restricted values the properties can have.

Config

An example configuration can be seen below where the different properties are defined in SampleProperties.csv and the custom value type "SOURCE" in Bron.csv. By using %<column>% there can be referred to the content of the columns in the csv file. It is also possible to define properties directly in xml, this is shown in <property .../> elements

<?xml version="1.0" encoding="UTF-8"?>
<sampleMetadataSchema xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/sampleMetadataSchema.xsd">
	<valueTypes>
		<string id="TEXT"/>
		<enumerationsCsvFile>
			<file>Bron.csv</file>
			<id>SOURCE</id>
			<code>%BRON%</code>
			<label>%NAME%</label>
		</enumerationsCsvFile>
	</valueTypes>
	<properties>
		<propertiesCsvFile>
			<file>SampleProperties.csv</file>
			<charset>UTF-8</charset>
			<id>%id%</id>
			<name>%name%</name>
			<valueTypeId>%valueTypeId%</valueTypeId>
			<scope>%scope%</scope>
		</propertiesCsvFile>
		<property id="testSampleProperty" name="Sample Property" valueTypeId="TEXT" scope="sample"/>
		<property id="testValueProperty" name="Value Property" valueTypeId="TEXT" scope="value"/>
	</properties>
</sampleMetadataSchema>

In SampleProperties.csv (located in MaplayerFiles config directory) shown below the properties "EMP_NR_A", "EXT_REF", "SMP_NAME" and "COST_CODE" are sample properties which are of value type "TEXT" that is defined as string with no other restrictions. 

id,name,valueTypeId,scope
EMP_NR_A,Medewerker analyse,TEXT,sample
EXT_REF,Externe referentie,TEXT,sample
SMP_NAME,Monster omschrijving,TEXT,sample
COST_CODE,Projectcode,TEXT,sample
BRON,Bron,SOURCE,sample
WEIGHT,Gewicht,TEXT,value

The property "BRON" however has the custom value type "SOURCE" which is defined as an enumeration in the file Bron.csv (located in MaplayerFiles config directory). This means the values of the property "BRON" can only have the values "Visdata_Waternet_2006-2012 V4" or "MACFT2010LIJN"

BRON;NAME
Visdata_Waternet_2006-2012 V4;Visdata_Waternet_2006-2012 V4
MACFT2010LIJN;MACFT2010LIJN


Since 2020.02 it is possible to import properties for individual values too. It is therefore possible to distinguish which properties should be applied to the whole sample and which only to individual values within the sample. For this the element "scope" has been introduced. This can be "sample" when the property is a sample property which means it applies to a whole sample, or "value" which means it is a value property and it only applies to a single value. When scope is not defined it will be "sample" by default.

In the example below, a table is defined as part of the timeSeriesImportRun configuration. The first property column, "COST_CODE", refers to sample properties (because "COST_CODE" is defined in SampleMetadataScheme.xml), while the second property column "testValueProperty" refers to a value property.

<table>				
	<propertyColumn name="COST_CODE" key="COST_CODE"/>
	<propertyColumn name="testValueProperty" key="testValueProperty"/>
	<valueColumn name="Waarde"/>
</table>


  • No labels