Creating a semantic type using the API
You can create semantic types.
The following workflow applies to anyone creating semantic type using the Talend Dictionary Service API:
- Create a semantic type in sandbox status, which is the initial status of a semantic type.
- Edit the type of your semantic type:
- The DICT type, based on an open or closed list of values.
- The REGEX type that compares your data against a preselected regular expression.
- The COMPOUND type, under which you can group several existing types.
- Add documents to the dictionary semantic type
- Select Post for the HTTP method.
- Enter the following URL: https://tds.{region}.cloud.talend.com/semanticservice/documents
- In the Body field, include the semantic type details in
JSON:
{ "categoryId": "{{categoryID}}", "values": [ ["categoryValue1"], ["categoryValue2"] ] }
{{categoryID}} is the identifier returned when you created the semantic type, for example: 5f80848e51b6b16703a4318d
{{categoryValue1}} and {{categoryValue2}} are the values you want to add to this type. You can add any number of values, but this example includes two inserted values.
The response will look like this, one identifier is generated for each inserted value:{ "ids": [ "683db466204921103f58807c", "683db467204921103f58807d" ] }
- Save the semantic type in sandbox status as a draft.
- Check the semantic type status.
- Publish the draft to make the semantic type available in Talend applications.