Categories and Metadata
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Categories and Metadata

  • Dark
    Light
  • PDF

Article summary

If field metadata is attached to a project, depending on the metadata, some or all of the following features will be enabled:

  • Database Category
  • Second Degree Search
  • Property Metadata

Loading metadata

File Format

Metadata is specific to a project, and can be attached either during database load and build, or later via Script | Script Editor.   Metadata details are loaded from an excel spreadsheet of the following format:

  1. Table Name - required, table must exist or the row will be ignored.  Case Sensitive. Must be first column.
  2. Field Name - required, field must exist or the row will be ignored.  Case Sensitive.  Must be first column.
  3. [Col3] - Any number of additional columns may be present in the spreadsheet.  Each column header must have a unique name.
  4. ...

Metadata Types

Each  column in the spreadsheet is one of the following types:

  • Item Identifier  (e.g., Tablename and Fieldname) 
  • Code - If configured (see Configuring Metadata), data in the code column will be displayed in the code column of the Database Category tab.  Data in this metadata column can be searched via the Category Search option.
  • Categories - If configured (see Configuring Metadata), data in the categories column will be used to control which categories fields are assigned to
  • Description - If a description column is present, the content of that column will be displayed as the field's description property
  • Other - Any other metadata column


Attaching and Configuring Metadata 

Configuring Metadata

To specify which column(s) correspond to which metadata types, use the SetProjectProperties method.   

  • Set the categoryProperty key to point to the spreadsheet column that contains category information 
  • Set the "secondDegreeSearchProperty" to point to the column that contains the data to be displayed in the code column.   
  • List all metadata properties which are to be loaded from file in the "fieldPropertyNames" list - this list must include the categoryProperty and secondDegreeSearchProperty column headers if they have been specified. 
{
  "method": "SetProjectProperties",
  "categoryProperty": "Categories",
  "secondDegreeSearchProperty": "Code",
  "fieldPropertyNames": [
    "Code",
    "Categories"
  ],
  "project": "Demonstration"
}
Categories
All fields will be displayed in the ALL category.    Fields can belong to multiple categories - by default a comma is used to separate categories.   Other delimiters can be used if necessary.

Attaching Metadata

To load configured metadata from file and attach it to the database schema, use the SetPropertiesFromWorkbook method.

  • filename - points to the spreadsheet that contains the metadata
  • properties - list of all columns (apart from columns 1 and 2, which are tablename and fieldname and must be present) to be loaded into metadata properties.    This must include the column headers specified for SetProjectProperties:categoryProperty and SetProjectProperties:secondDegreeSearchProperty
{
  "method": "SetPropertiesFromWorkbook",
  "filename": "%DATAPATH%RegressionTest/FieldPropertiesWorkbook.xlsx",
  "properties": [
    "Description",
    "Categories"
  ],
  "project": "Demonstration"
}

Once metadata has been attached, re-open the project.    The category button will now be visible in the Project Explorer:



Was this article helpful?

What's Next