You can add vocabulary-based annotations to data model artifacts such as complex types, entity types, 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.
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. For more information, see Importing a Vocabulary File
If the project is of type Annotation Model for referenced Service, import a service reference to add vocabulary based annotations. For more information, see Referencing a Service to Annotate a Model
After you have imported a vocabulary file into your data model, a sub-folder Vocabularies is displayed in the hierarchy view. This sub-folder includes:
Imports sub-folder that lists the names 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 sub-folder that lists the names of the vocabulary 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.
To add annotations to the artifacts, proceed as follows:
Double-click the sub-folder that contains the artifacts you want to annotate. or example, Entity Sets. Existing entity sets are listed in the mass maintenance view.
Select the Annotations 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 artifacts and, if required, toggle between the different vocabularies. If none of the imported vocabularies includes applicable terms for the selected artifact, this push-button is disabled.
After you have selected the vocabulary for annotating, all entity sets are displayed in a table in the mass maintenance view with the name of the applicable vocabulary terms displayed as a header.
To create annotations for an artifact, select either the entire row to create all available annotations, or select the applicable cells for each annotation you want to create and select Create Annotation You can make/change the entries in the Expression Value column in the sub-table 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 sub-folders in the data model’s hierarchy view, organized according to vocabulary for each node .
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.
If you want to delete any annotation, select the relevant row or cell and click Delete Annotation.
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, choose the Core Attributes.
To proceed with generating the project, see Runtime Artifacts.