Querying data using semantic types

Semantic types can be used to search for data in several different entity types or link types in a single query. You can also use semantic types to search a number of fields in different entity or link types that contain the same kind of information.

There are two ways to use semantic types in a query:
  1. Entity and link semantic types. You can search across several entity or link types that all represent the same sort of information.
  2. Property semantic types. You can search fields across different entity or link types which may be called different things but contain the same sort of information.
You will only be able to use semantic types in your query if the database is an SQL Server database and semantic types have been assigned to the data. If no semantic types have been assigned, none of the semantic options are available when you define a query. Speak to your database administrator for more information about the semantic types that are assigned in your database.

Constructing a query that contains semantic types

You construct a query that uses semantic types in the same way as you would create any other query. You can:

  • Specify the semantic type for an entity or link type in the query structure area.
  • Use a property semantic type for a condition in the Conditions area.

Viewing the scope of a query that contains semantic types

When you view the results of a query that includes semantic types it is useful to see exactly which entity types, link types and fields are searched. Unlike other queries, when you use a semantic type, you do not necessarily know before the query is run which types and fields are included in the query. You can use the scope to view a list of the searched items.