Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The mapping process can be less manual by using .txt files. Please send the files to Hayley Mills to load into Archivist. Once loaded you can then check the mappings. The format specifications are given at below along with examples. A list of the Archivist pages which can be used to check the mappings (and view a list of questions) can be found at the end of the page with examples. 


It is recommended that you create only one topic mapping file first (preferably tv) as the other will be inherited once the question and variable have been mapped. Any gaps in topics can then be filled afterwards. This should prevent topic conflicts.

Question to Variable mappings

These are loaded by navigating to Admin > Instruments > search for the instrument prefix > IMPORT MAPPINGS. Choose files and select the qv.txt file you want to import. See format specifications below for details of the qv.txt file. You can also select to import question to topic mappings tq.txt at the same time. From the dropdown select whether the file is Q-V Mapping or T-Q Mapping. Note. the Heroku in-out-worker server must be turned on for the files to be imported. The state will change from pending, to running, then to success or failure once imported. If the state is failure, VIEW LOGS under Actions. The state will be failure if the whole file fails and if there is one invalid record (row) in the file. 

Common reasons for failures:

  • The incorrect file has been selected
  • The incorrect mapping type has been selected
  • The file format is not correct
  • The instrument and dataset is not linked
  • The content is not valid
    • The names are not the correct case
    • The variable in not in the dataset
    • Typos or spaces in the names

Depending on the number of invalid records, if there are only a couple of issues, then you can fix these by using the Archivist interface see Map Questions, Variables and Topics, If there are many, systematic or file related issues, then update the qv.txt file and re-import.

Note. when re-importing, the current mappings will be replaced, so you must include all the question to variables you want to import in the file, not only the records (rows) you want to update. 

Note. All manual mappings will be replaced by the imported qv.txt mapping file. If you do not want this to happen, then export the qv.txt first, then update this before importing. 

Variable to Topic mappings

After the question to variables have been imported successfully, it makes sense to add the variable topic mappings which will then be inherited by the questions. These are loaded by navigating to Admin > Datasets> search for the dataset prefix > IMPORT MAPPINGS. Choose files and select the tv.txt file you want to import. See format specifications below for details of the tv.txt file. You can also select to import derived variable mappings dv.txt at the same time. From the dropdown select whether the file is T-V Mapping or D-V Mapping. Note. the Heroku in-out-worker server must be turned on for the files to be imported. The state will change from pending, to running, then to success or failure once imported. If the state is failure, VIEW LOGS under Actions. The state will be failure if the whole file fails and if there is one invalid record (row) in the file. 

In addition to the common reasons for failures listed above, other reasons include:

  • Topics conflict - questions and variables which are mapped together must have the same topic. If a different topic has already been assigned to question which has been mapped to that variable this will be invalid
  • If a variable has been mapped to 0.

Depending on the number of invalid records, if there are only a couple of issues, then you can fix these by using the Archivist interface see Map Questions, Variables and Topics, If there are many, systematic or file related issues, then update the tv.txt file and re-import.

Note. when re-importing, the previous imported topic mappings will not be replaced unless they have been updated in the file. 

Note. All manual mappings will be replaced by the imported tv.txt mapping file. If you do not want this to happen, then export the tv.txt first, then update this before importing.  

Note: Only one topic can be applied to a grid as a whole- this means that all variables mapped to a grid question must have the same topic.
It is recommended that you create only one topic mapping file first (preferably tv) as the other will be inherited once the question and variable have been mapped. Any gaps in topics can then be filled afterwards. This should prevent topic conflicts.

Question to Topic mappings

After the question to variables have been imported successfully, you can import the tv.txt mappings files as above, alternatively if you only have question to topic mappings, or you have both tv.txt and tq.txt you can import those next or at the same time. 

These are loaded by navigating to Admin > Instruments> search for the instrument prefix > IMPORT MAPPINGS. Choose files and select the tq.txt file you want to import. See format specifications below for details of the tq.txt file. You can also select to import the question to variable mappings qv.txt at the same time. From the dropdown select whether the file is T-Q Mapping or Q-V Mapping. Note. the Heroku in-out-worker server must be turned on for the files to be imported. The state will change from pending, to running, then to success or failure once imported. If the state is failure, VIEW LOGS under Actions. The state will be failure if the whole file fails and if there is one invalid record (row) in the file, see common reasons listed above. 

Depending on the number of invalid records, if there are only a couple of issues, then you can fix these by using the Archivist interface see Map Questions, Variables and Topics, If there are many, systematic or file related issues, then update the tq.txt file and re-import.

Note: if you map to 0 (i.e. no topic), this will give an invalid error, but it will map the question to 0, this way you can reset the mapping back to no mappings. Not this is not the same as None topic. 

Note. when re-importing, the current question to topic mappings will be replaced, so you must include all the question to topic mappings you want to import in the file, not only the records (rows) you want to update. 

Note. All manual mappings will be replaced by the imported tq.txt mapping file. If you do not want this to happen, then export the tv.txt first, then update this before importing.  

Note: Only one topic can be applied to a grid as a whole- this means that all variables mapped to a grid question must have the same topic.

add how 0 and 000s work. 

Derived variable mappings


Format specifications

qv.txt

...

Variable to topic mappings can be saved as a .txt by clicking e.g. e.g. tv.txt

Quesiton Question to variable mappings with topics included can be viewed and saved by navigating to the instrument map page. On the instrument page search for the prefix then select MAP, then click e.g. Download File, this will list; Question name, Question text, Question Topic ID, Variable name, Variable Topic ID, and Variable Label. Note it doesn't include derived variables mappings.

...