Defining custom semantic types
You may find that the semantic types supplied do not contain a semantic type that is appropriate for your data. In this case, you can define custom entity, link, and property semantic types.
About this task
When you define a semantic type, it inherits some of the properties of the parent, but not its name or synonyms.
Note: Be sure to carefully search for an available semantic type before you define your own custom semantic types. Before you can do this, you may need to load all the custom semantic types available at your site. See Loading the semantic type library.
Never define a custom semantic type when the Semantic Type Library in use at your site already contains an appropriate semantic type. If you do, you will end up with duplicate types (such as Football Match, Football Match_001, Football Match_002) and the information retrieved from your database cannot be aligned with information retrieved from other data sources that has the correct semantic type assigned. This will limit your users' ability to analyze data from different sources.
A custom semantic type has a globally unique, internal identifier which is derived from the database in which it is created. Therefore an entity semantic type called Football Match created in one database is distinct from an entity semantic type of the same name created in a different database. To avoid the problems that this will cause, make sure to share the custom semantic types with other users in your organization.
In order to avoid the creation of duplicates, you should do only create custom semantic types in the database that holds the Semantic Type Library for your organization.
When to define custom semantic types
You may decide to define custom semantic types for a variety of reasons.
For example, consider if your data contains different kinds of sporting events. The Semantic Type Library contains an Event entity semantic type, but it does not contain entity semantic types for distinguishing between different kinds of sporting events. To ensure that appropriate semantic types for sporting events are added to your Semantic Type Library, you must define custom semantic types that are derived from the Event entity semantic type.
If it is not necessary to distinguish between different specializations of an entity, then you can simply assign the appropriate generalized entity semantic type to your data. For example, suppose your data contains a list of people who have attended an annual convention. The library does not contain a Convention entity semantic type, but you can assign the Event entity semantic type to your Convention data field because your data contains records for only one kind of event.
You may want to define a custom property semantic type if you want to assign multiple values for the same property to a single entity or link. For example, suppose your database contains a list of a person's bank account numbers, and you have decided to represent each bank account as a field on the entity type, rather than use bank account entities with links to the person that owns them. Since a property semantic type can only be added once to each entity semantic type or link semantic type in a Semantic Type Library, you can create specializations of the Account Number property semantic type so that each occurrence has a unique property semantic type assignment.
Deriving the custom semantic type from the correct parent
Choosing the correct semantic type to derive your new custom semantic type from is a critical decision because the custom semantic type inherits characteristics and behaviors from its parent. In the sporting event example (given above in When to define custom semantic types), it would be inappropriate to derive the custom semantic types from the Document entity semantic type, for example, because a sporting event is not a special type of document.
Sharing and reusing custom semantic types
If others in your organization are also assigning semantic types to data, you should share your custom semantic types so that all databases use the same Semantic Type Library. If two people define custom semantic types of the same name, they are not identical because the semantic type name does not uniquely identify the semantic type--- its unique identity is determined by the database in which it is created.
For more information about duplicate names and sharing your custom semantic types with others, see Maintaining the semantic type library.
Backing up the Semantic Type Library
After adding custom semantic types to your library, save them to file so that you can:
Distribute the new semantic types to others in your organization.
Restore deleted custom types (you cannot recreate custom semantic types by adding a new one of the same name).
To do this, click Save in the Semantic Types dialog. The Semantic Type Library is saved in a file with an .mtc file extension. For further information, see Maintaining the semantic type library.
Procedure
Select Tools > Database Design > Semantic Types.
Load any custom semantic types specific to your organization. See Loading the semantic type library for details.
Locate the semantic type that is a generalization of the special type that you require. You can do this by searching for semantic types that have a generalized name. For example, if you require additional entity semantic types to represent different stolen property articles, you should derive these custom semantic types from the Property entity semantic type.
On the appropriate page, select the generalized type, right-click, and select New.
Change the name of the custom semantic type to a name that reflects your usage.
In the Synonyms box, enter some other words that have the same meaning, and that you want to group together under the same semantic type.
For example, synonyms for Location might be Area, Map Reference, Region, and Situation. Enter these like this (with no space after the commas):
Area,Map Reference,Region,Situation
In the Description box, enter some notes on how to use the custom semantic type.
Click OK to add the new semantic type as a child of the generalized semantic type. Notice that the icon changes slightly to indicate a custom semantic type. This allows you to see which are standard semantic types and which are specific to your organization.
Assign the custom semantic type to an item in your database schema in the usual way.
When you have finished, click OK.