Version: | 1.0 |
---|---|
Provider: | PyXMCDA |
SOAP service’s name: | |
csvToXMCDA-criteriaScales-PyXMCDA (see SOAP requests for details) |
Transforms a file containing criteria scales from a comma-separated values (CSV) file to two XMCDA compliant files, containing the corresponding criteria ids and their criteriaScales.
Contact: Nicolas Duminy (nicolas.duminy@telecom-bretagne.eu)
Web page: https://gitlab.com/nduminy/ws-pyxmcda
(For outputs, see below)
The criteria and their criteria scales defined, as a CSV file. The first line contains the columns titles and is purely informative (i.e criterion,scales id,pref dir,scale label,scale def). Then for the following lines, the first cell contains a criterion id (and name, see below), the second cell contains the associated scale id, the following cells are either empty if the scale was already defined before or the scale definition (see below). The scale definition can extend on multiple rows if necessary, those extra rows have their first two cells empty.
Example:
criterion, scales id, pref dir, scale label, scale definition
c01 (risk),regular qualitative scale,min,Critical,3
,,,Serious,2
,,,Minor,1
c02 (issue),regular qualitative scale,,,
The first column contains the criteria’ ids. Additionally, the criteria’ names are also extracted when the cells are formatted like id (name). Set the parameter “First column” to “id” to deactivate the extraction of criteria’ names.
The fourth column contains the scale labels. Each row can only contains one label, so additional labels are given by extending the scale definition on extra rows.
The fifth column contains the additional scale definition, its formatting depends on the type of the scale being defined.
Three types of scales can be defined: nominative, quantitative, qualitative.
A nominal scale is defined only by its list of labels, which are given in the relevant fourth column. The listing of labels can either begin on a new row or on the row where the scale id is present.
Example:
c01,nominal scale,,Poor,
,,,Standard,
,,,Top,
c02,nominal scale 2,,,
,,,Poor,
,,,Standard,
,,,Top,
A quantitative scale is defined by its preference direction (in column three) and its boundaries (defined in column five). Those boundaries are a pair of numeric values, lower first, in the following format: (lower_limit, upper_limit) Those boundaries can also be contained in double quotes “. The whole definition of a quantitative scale is on one row and cannot be extended.
Example:
c01,quantitative scale,max,,"(0, 1)"
c02,quantitative scale 2,max,,(0, 1)
A qualitative scale is defined by its preference direction (column three) and its list of valued labels (columns four and five). As for the nominative scale, the listing of valued labels can either begin on a new row or on the row where the scale id is present. The labels (column four) are associated to their value (column five). Those values could either be a ranking, defined by single numeric values, or fuzzy numbers for a fuzzy scale, defined by a list of points (between 2 and 4). Each point formatted (abscissa, ordinate) and separated from the others by ` - . Each fuzzy number can also be contained in double quotes `”. Each scale cannot mix up those types of values.
Example:
c01,fuzzy qualitative scale, max,,
,,,Very Low,"(0, 0) - (0.2, 1) - (0.5, 0)"
,,,Low,(0.0, 0) - (0.2, 1) - (0.5, 0)
,,,Medium,"(0.2, 0) - (0.5, 1) - (0.6, 0)"
,,,Almost High,"(0.5, 0) - (0.6, 1) - (0.7, 0)"
,,,High,"(0.6, 0) - (0.7, 1) - (0.8, 1) - (0.9, 0)"
,,,Very High,"(0.8, 0) - (0.9, 1) - (1.0, 0)"
,,,Perfect,"(0.9, 0) - (1.0, 1)"
c02,ranked qualitative scale,min,Deadly,3
,,,Serious,2
,,,Minor,1
Complete example:
criterion, scales id, pref dir, scale label, scale definition
c01,fuzzy scales, max,,
,,,Very Low,"(0, 0) - (0.2, 1) - (0.5, 0)"
,,,Low,"(0.0, 0) - (0.2, 1) - (0.5, 0)"
,,,Medium,"(0.2, 0) - (0.5, 1) - (0.6, 0)"
,,,Almost High,"(0.5, 0) - (0.6, 1) - (0.7, 0)"
,,,High,"(0.6, 0) - (0.7, 1) - (0.8, 1) - (0.9, 0)"
,,,Very High,"(0.8, 0) - (0.9, 1) - (1.0, 0)"
,,,Perfect,"(0.9, float:0) - (1.0, 1)"
c02,fuzzy scales,,,
c03,nominal scales,,,
,,,Poor,
,,,Standard,
,,,Top,
c04,nominal scales,,,
c05,quantitative scales,max,,"(0, 1)"
c06,regular qualitative scale,min,Deadly,3
,,,Serious,integer:2
,,,Minor,1
The input value should be a valid XMCDA document whose main tag is <other>
.
Parameters of the method
The input value should be a valid XMCDA document whose main tag is <programParameters>
.
It must have the following form:
<programParameters>
<programParameter id="csv_delimiter">
<values>
<value>
<label>%1</label>
</value>
</values>
</programParameter>
<programParameter id="default_prefix">
<values>
<value>
<label>%2</label>
</value>
</values>
</programParameter>
<programParameter id="name_in_id">
<values>
<value>
<boolean>%3</boolean>
</value>
</values>
</programParameter>
</programParameters>
where:
%1 is a parameter named “CSV delimiter”. This is a string, and the value should conform to the following constraint: One character maximum. More formally, the constraint is:
%1.length() < 2
%2 is a parameter named “Default content”. It can have the following values:
float
: floatlabel
: stringinteger
: integerboolean
: booleanThe default value is float.
%3 is a parameter named “First column”. It can have the following values:
false
: idtrue
: id (name)The default value is id_and_name.
The equivalent criteria ids.
The returned value is a XMCDA document whose main tag is <criteria>
.
The equivalent criteria scales.
The returned value is a XMCDA document whose main tag is <criteriaScales>
.
Status messages.
The returned value is a XMCDA document whose main tag is <programExecutionResult>
.