Skip to main content

Add custom fields

If you would like to add a custom metadata field to the data.world UI, then you can do so by adding custom fields in the Metadata Profile. By the end of this guide, you will know how to add a custom metadata field to your data.world organization.

Why would I do this?

Metadata fields allow you to assign metadata to resources in data.world. If you would like to use a metadata field but it is not included with data.world by default, then you can create a custom metadata field.

Plan your custom field

Key things to decide - what objects the custom field belong to, which section do you want them to show up in, and the properties of the field. Follow this documentation, if you want the fields to be read-only for users.

Table 1.

Property

Description

Applies to which all objects

Define the objects for which you want to add the custom field. It can be all or one of the following:

Datasets and projects

Analysis

Business terms (and any sub-types)

Collections

Tables

Database columns

Custom resources

Where does the field show

Define where the field should show. it can be any of the default sections or a custom section you have added to the pages.

The default sections are: Informational, Technical, People.

Field properties

Decide field properties such as name, type of field (single-line or multi-line), any display and edit hint text for the field, should the field always show on screen when it has no value, should the field be available for filtering search terms.



Note

For steps of updating the Metadata profile file, see Updating the metadata profile.

Define your custom field

Use the following syntax to add the custom field to the file:

##Complete Metadata Field Entity
:MetadataPresentation-Custom
  # REQUIRED FIELDS:
  rdf:type dwec:MetadataPresentation ;
  rdfs:label "Custom" ;
  dwec:forType dwec:BusinessTerm ;
  dwec:inMetadataSection :MetadataSectionInformational ;
  dwec:viaProperty :custom ;
  # OPTIONAL FIELDS:
  dwec:presentationSortOrder  2 ;
  dwec:presentationTemplate "This 5 digit zipcode is {{$1}}." ;
  dwec:editHint "Specify the US zipcode." ;
  dwec:displayHint "The US postal zipcode.";
  rdf:type dwec:Multiline ;
  rdf:type dwec:Mandatory ;
  rdf:type dwec:AdditionalProperty ;
  rdf:type dwec:Facetable ;
.
Table 2.

Property

Required

Description

Example or Possible values

:MetadataPresentation-Custom

Yes

This is the unique identifier for the custom field. Replace custom with the name of your custom field.

:MetadataPresentation-Zipcode

rdf:type dwec:MetadataPresentation ;

Yes

This property is for internal use of the application and should be added as-is.

rdfs:label "Custom";

Yes

The name as it should appear on the UI.

Replace Custom with the label of the field you want to display on the UI.

rdfs:label "Zip code";

dwec:forType

Yes

Specify the objects for which you want to add the custom field. You can define multiple objects here.

Possible values:

_ dwec:forType dwec:DwDataset ;

_ dwec:forType dwec:Analysis ;

_ dwec:forType dwec:BusinessTerm ;

(subtypes of business terms)

_ dwec:forType dwec:Catalog ;

_ dwec:forType dwec:DatabaseTable ;

_ dwec:forType dwec:DatabaseColumn ;

_ dwec:forType dwec:_Custom* ;

dwec:inMetadataSection

Yes

Specify the section where you want to show the custom field.

Possible values:

MetadataSectionInformational

MetadataSectionTechnical

MetadataSectionPeople

MetadataSectionCustom

dwec:viaProperty

Yes

A unique internal name for the field. This is the field in which the values are stored internally in the system.

zipcode

dwec:presentationSortOrder

No

When defining multiple custom fields, define the order. If you don't define one, the fields show in alphabetical order.

2

dwec:presentationTemplate

No

Instead of just displaying the field value on the resource page, you add text around to make it more meaningful.

For example, instead of just showing 95050, you would display This 5 digit zip code is 95050.

"This 5 digit zip code is {{$1}}."

{{$1}} gets programmatically replaced by the value of the field. For example, it could look like: This 5 digit zip code is 95050.

dwec:displayHint

No

Provide a help text to give context to your users about the field when they are viewing the field values.

dwec:editHint

No

Provide a help text to give context to your users for what values they should provide while they are editing the field.

rdf:typedwec:Multiline

No

Add the field as a multiline field that supports markdown.

By default the fields are single-line and only support simple markdown syntax such as hyperlinks.

rdf:typedwec:Mandatory

No

Define if the field should always show on the Ul. When marked Mandatory, the fields always show on the resource page even when they do not have any values.

When not mandatory, the field shows on the resource page only when a value is set for the field.

Note: Custom sections show only if fields have values or if the fields included in the custom section are marked as mandatory.

rdf:typedwec:AdditionalProperty

No

For fields that are used less often, define them as additional properties so that they show as secondary field under an Add new field dropdown on the page where the field values are defined and edited.

rdf:typedwec:Facetable

No

Specify if the field should show in the search filter options so that users can use it for filtering search results.



Sample 2: Add a field as additional property

 Use the following syntax to add Known issues as an additional property for business terms, datasets, and collections. The property appears in the People section of the pages.

##Sample code for additional fields
:MetadataPresentation--Additional-KnownIssues
  rdf:type dwec:MetadataPresentation ;
  rdf:type dwec:AdditionalProperty ;
  rdfs:label "Known Issues" ;
  dwec:forType dwec:BusinessTerm ;
  dwec:forType dwec:DwDataset ;
  dwec:forType dwec:Catalog ;
  dwec:inMetadataSection :MetadataSectionPeople ;
  dwec:viaProperty :knownissues ;
.
add_custom.gif

 

Sample 3: Add owner email field

 Use the following syntax to add custom >owner email field to the People section of the page for database tables and for subtypes of business terms Metrics and Acronym:

:MetadataPresentation-OwnerEmail
  rdf:type dwec:MetadataPresentation ;
  rdfs:label "Owner Email" ;
  dwec:inMetadataSection :MetadataSectionPeople ;
  dwec:viaProperty :owner_email ;
  dwec:forType :Acronym ;
  dwec:forType :Metric ;
  dwec:forType dwec:DatabaseTable ;
  dwec:presentationTemplate "Contact [{{$1}}](mailto:{{$1}}) for questions regarding this resource" ;
.

Sample 4: Add frequency updated field to collections page

 Use the following syntax to add a frequency updated field to the Information section of the collections page.

:MetadataPresentation-FrequencyUpdated
  rdf:type dwec:MetadataPresentation ;
  rdf:type dwec:Mandatory ;
  dwec:presentationTemplate "This collection is reviewed and updated {{$1}}." ;
  rdfs:label "Frequency Updated" ;
  dwec:forType dwec:Catalog ;
  dwec:inMetadataSection :MetadataSectionInformational ;
  dwec:viaProperty :frequencyupdated ;
.
date_picker.png

Sample 5: Add a date field to business terms, datasets, and collections pages

 Use the following syntax to add date field:

Table 3.

Property

Use

:certified_on rdfs:range xsd:date

Use this property to provide a date picker for the date field.



:MetadataPresentation-CertifiedOn
  rdf:type dwec:MetadataPresentation ;
  rdf:type dwec:Mandatory ;
  rdfs:label "Certified On" ;
  dwec:forType dwec:BusinessTerm ;
  dwec:forType dwec:Dataset ;
  dwec:forType dwec:Catalog ;
  dwec:inMetadataSection :MetadataSectionInformational ;
  dwec:viaProperty :certified_on ;
:certified_on rdfs:range xsd:date .

Sample 6: Add a multiline field to a subtype of business term

 Use the following syntax to add a multiline field to a sub type of business glossary.

:MetadataPresentation-Metric-Formula
  rdf:type dwec:MetadataPresentation ;
  rdfs:label "Formula" ;
  dwec:inMetadataSection :MetadataSectionTechnical ;
  dwec:viaProperty :formula ;
  dwec:forType :Metric ;
  dwec:presentationSortOrder  2 ;
  dwec:editHint "Specify a formula for generating this Metric." ;
  dwec:displayHint "The formula used for generating this Metric."
  rdf:type dwec:Multiline ;