HOW TO - Copy a table and its metadata
  • 1 Minute to read
  • Dark
    Light
  • PDF

HOW TO - Copy a table and its metadata

  • Dark
    Light
  • PDF

Article summary

Tables can be copied from a source project to another (different) target project using CopySourceTable.   If metadata exists on the source table in the source project, this can be added to the target table by first configuring the target project.

The approach to bringing across metadata from a source project to a target project is as follows:

  1. Obtain project metadata configuration from Source Project
  2. Run SetProjectProperties in Target Project
  3. Run CopySourceTable in the Target Project
  4. Open the Target Project and verify that metadata properties appear in the Context Panel Property Pane.

Setting up metadata in the Source Project

The following shows how metadata was originally set up in the source project (BioInvestigate):

  1. CreateTableFromFile - creates table "framingham"
  2. SetProjectProperties configures project "BioInvestigate" with metadata properties Description, ObservationType and Unit
  3. SetPropertiesFromWorkbook applies the metadata in "META_framingham_figsure.xlsx" to the project.


{
  "method": "CreateTableFromFile",
  "action": "LOAD",
  "table": "framingham",
  "filename": "%DATAPATH%04_Bio/framingham_figshare_cleaned.csv",
  "definition": [
    "RecordNo|DISCRETE|INTEGER|BYTE",
    "RANDID|CONTINUOUS|INTEGER|",
    "SEX|DISCRETE|INTEGER|BYTE",
...
    "TIMEHYP|DISCRETE|INTEGER|BYTE"
  ],
  "loading": [
    "RecordNo",
    "RANDID",
    "SEX",
...
    "TIMEHYP"
  ],
  "preHeaderSkip": 0,
  "dateFormat": "YYYY-MM-DD",
  "fileFormat": "ASCII8",
  "skipFirstLine": true,
  "delimiter": "COMMA",
  "stripCharacter": "",
  "dateTimeFormat": "YYYY-MM-DD HH:MM:SS",
  "sample": false,
  "ignoreErrors": false,
  "project": "{
  "method": "SetPropertiesFromWorkbook",
  "filename": "%DATAPATH%04_Bio/META_framingham_figsure.xlsx",
  "delimiter": ",",
  "properties": [
    "Description",
    "ObservationType",
    "Unit"
  ],
  "project": "BioInvestigate"
}"
}
{
  "method": "SetProjectProperties",
  "categoryProperty": "ObservationType",
  "secondDegreeSearchProperty": "Unit",
  "fieldPropertyNames": [
    "Description",
    "ObservationType",
    "Unit"
  ],
  "project": "BioInvestigate"
}
{
  "method": "SetPropertiesFromWorkbook",
  "filename": "%DATAPATH%04_Bio/META_framingham_figsure.xlsx",
  "delimiter": ",",
  "properties": [
    "Description",
    "ObservationType",
    "Unit"
  ],
  "project": "BioInvestigate"
}

Copying table and metadata from Source Project to Target Project

The following shows how to copy a table and its metadata from one project to another

  1. SetProjectProperties configures project "BioInvestigate" with metadata properties Description, ObservationType and Unit
  2. CopySourceTable copies the table and its metadata into the target project (SalesData1)

{
  "method": "SetProjectProperties",
  "categoryProperty": "ObservationType",
  "secondDegreeSearchProperty": "Unit",
  "fieldPropertyNames": [
    "Description",
    "ObservationType",
    "Unit"
  ],
  "project": "SalesData1"
}
{
  "method": "CopySourceTable",
  "sourceProject": "BioInvestigate",
  "table": "framingham",
  "targetName": "Bio_framingham",
  "allFields": true,
  "moveFiles": false,
  "project": "SalesData1"
}




Was this article helpful?