Version: | 2.0 |
---|---|
Provider: | PyXMCDA |
SOAP service’s name: | |
csvToXMCDA-alternativesValues-PyXMCDA (see SOAP requests for details) |
Transforms a file containing alternatives values from a comma-separated values (CSV) file to two XMCDA compliant files, containing the corresponding alternatives ids and their alternativesValues.
Contact: Sébastien Bigaret (sebastien.bigaret@telecom-bretagne.eu)
Web page: https://gitlab.com/sbigaret/ws-pyxmcda
(For outputs, see below)
The alternatives and their alternatives values as a CSV file. The first line is made of two cells, the first one being empty, and the second one will be the content of the attribute “mcdaConcept” in the tag “<alternativesValues>”, if supplied. The following lines are made of at least two cells, with the first cell being an alternative’ id (and name, see below), and the remaining cells their associated values.
Example:
,ranks
a1 (eggs),1,2,3,4,5
a2 (spam),3.14159
a3 (parrot),int:0xDEAD
The first column contains the alternatives’ ids. Additionally, the alternatives’ names are also extracted when the cells are formatted like id (name). Set the parameter “First column” to “id” to deactivate the extraction of alternatives’ names.
By default the values are considered as float numbers. This can be changed using the parameter “Default content”. It is possible to specify the type of a value by prepending it with a prefix:
Example:
,values
a1,float:1.0
a2,integer:2
a3,3.03
a4,string:a label
a4b,string:another label
a5,na:content ignored for N/A
a6,boolean: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>
<parameter id="csv_delimiter">
<values>
<value>
<label>%1</label>
</value>
</values>
</parameter>
<parameter id="default_prefix">
<values>
<value>
<label>%2</label>
</value>
</values>
</parameter>
<parameter id="name_in_id">
<values>
<value>
<boolean>%3</boolean>
</value>
</values>
</parameter>
</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 alternatives ids.
The returned value is a XMCDA document whose main tag is <alternatives>
.
The equivalent alternatives values.
The returned value is a XMCDA document whose main tag is <alternativesValues>
.
Status messages.
The returned value is a XMCDA document whose main tag is <programExecutionResult>
.