Show TOC

Adding Vocabulary-Based Annotations to Data Model ArtifactsLocate this document in the navigation structure

Explains how to add vocabulary-based annotations to data model artifacts in the Service Builder.

Prerequisites

  • At least one vocabulary file must be uploaded in Vocabulary Repository
  • A Service Builder project of type Service with Vocabulary-Based Annotations or Annotation Model for Referenced Service
  • Import a vocabulary file to your project.
    Note If the project is of type Annotation Model for referenced Service, import a service reference also to add vocabulary based annotations.

Context

Add vocabulary-based annotations to data model artifacts such as complex types, entity types, and associations entity sets, association sets and, function import to specify additional information about a particular artifact that would not be possible using core attributes alone. To add vocabulary-based annotations, you can use the vocabulary files available in the Vocabulary Repository as standard in the /IWBEP/ name-space or you can define and upload customer-specific vocabulary files. For example, you want to use the standard vocabulary Org.OData.Aggregation.V1 to add the annotations LeveledHierarchy or RecursiveHierarchy to entity types for which only core attributes could be defined such as Base Type Name and Is Abstract. You can import one or more vocabulary files in a data model, provided that the data model is created in a Service Builder project of type Service with Vocabulary-Based Annotations or Annotation Model for Referenced Service.

Imported Vocabularies
After you have imported a vocabulary file into your data model, a Vocabularies subfolder is displayed for the data model in the tree view. The Vocabularies subfolder includes:
  • Imports subfolder that lists the name of the vocabulary files explicitly imported from the Vocabulary Repository to the data model. Expand Imports folder, expand the imported vocabulary folder and double click folder Terms to know to which data model artifact the terms in the imported vocabulary file are applicable. The Name column displays the name of the vocabulary terms and columns with selected check-box indicates to which data model artifact the specific term applies. For example, complex types and their properties and the defined terms.
  • Implicit References subfolder that lists the names of the vocabular files used implicitly since the imported vocabularies reference it. For each implicitly referenced vocabulary file, you can expand the data model artifacts for which it applies, for example, complex types and their properties and the defined terms.
Further, nested inside each sub-folder for a particular entity type or complex type, for example, in the data model, an Annotations sub-folder exists that lists the imported vocabularies folder. Double click this folder to display the number of applicable terms each vocabulary defines for the given node (this information is displayed in the mass maintenance view). These are the vocabulary-based annotations you can add to these artifacts.

Procedure

  1. Double-click the subfolder that contains the artifacts you want to annotate, for example, Entity Sets. Existing entity sets are listed in the mass maintenance view.
  2. Select the Annotation pushbutton to see the vocabulary that is valid for this artifact. If more than one vocabulary defines applicable terms, you can select the vocabulary you want to use to annotate the entity set and, if required, toggle between the different vocabularies. If none of the imported vocabularies includes applicable terms for entity sets, for example, this pushbutton is not enabled. After you have selected the vocabulary, all entity sets are displayed in a table in the mass maintenance view with the name of the applicable vocabulary displayed as a header.
  3. To create annotations for an entity set, select either the entire row to create all available annotations or select the applicable cells for each annotation you want to create and choose the Create Annotation pushbutton. You can make/change the entries in the Expression Value column in the subtable displayed. You can select more than one row and more than one cell to enable the mass maintenance of multiple entity sets and annotations, for example. The annotations you have created for a particular artifact are also displayed in the Annotations subfolder, organized according to vocabulary, for each node in the data model's tree view.
  4. To display detailed information (annotation data, term type, and expression value) about an annotation, double-click the annotation. The annotation data is then displayed in an additional table.
  5. If you want to delete any annotations, select the relevat rows or cells and choose the Delete Annotation pushbutton.
  6. Save your entries. If you want to navigate from the annotation mass maintenance view and see an overview of the core attributes (SAP annotations) that can be defined for the entity set, for example, click the Core Attributes .