[SAP HANA Academy] Better Identify Business Content in SAP HANA with the New Enterprise Semantic Services
In a series of three tutorial videos the SAP HANA Academy‘s Tahir Hussain Babar (aka Bob) shows you how to use Enterprise Semantic Services, a new feature available in SAP HANA SPS 11. Enterprise Semantic Services facilities data discovery by enabling developers and business users to search SAP HANA catalog objects and remote source objects for relevant business content. Part of SAP HANA’s Smart Data Integration, Enterprise Semantic Services answers a user’s search request by using metadata, semantic information and table contents to build knowledge graphs.
Overview of Enterprise Semantic Services’ Admin UI and Demo Tool Kit
Watch the first video of the series where Bob provides an overview of the Enterprise Semantic Services’ Admin User Interface and Demo Tool Kit. The Admin UI is used to both set up and configure the system. The Demo Tool Kit provides a business-focused search UI which enables you to find datasets using keyword queries à la a Google engine search. The extraction of the meaning is down by data profiling techniques, such as discovering the business type of a column in a table.
To access the Admin UI navigate to http://ess:8011/sap/hana/im/ess/ui in a web browser. To access the Demo Tool Kit, a sample search UI application, navigate to http://ess:8011/sap/hana/im/ess/demo. You can use either the SAP HANA Web-based Development Workbench or SAP HANA Studio to view ESS’s content. Bob opts to use the SAP HANA Studio and has already created a schema connected to his repository. The pair of videos profiled below show how to install the Admin UI and the Demo Kit. Bob log in with his credentials to access both the Admin and Search UIs.
The Admin UI contains four tiles on the front page.
The Publish and Scheduling Monitor allows you to both create and schedule profiling requests. The Request Monitor is an administration tile that allows you to monitor any requests. The Entity Grid Monitor is an access point to the knowledge graphs. The Data Profiling Blacklist indicates which datasets will never be profiled.
The Catalog contains your objects from SAP HANA and a list of schemas. There is also a list of Remote Sources. It is possible to publish an entire schema within a catalog. To publish first drill down into SAP ECC from the Catalog and select a table. You have the option to publish the table immediately or schedule a data profile or a table publishing. You have the option to associate published artifacts with an application scope which will in turn enable you to search for objects only in a specified application scope.
Once you click on publish a green icon will appear next to the table and the schedules table will display what has been executed. These same concepts apply regardless if its a remote source object, a local object, a view or a table.
The Request Monitor tile shows the publishing history. If you drill into a listed object’s detail you can see the publication artifact’s status and any errors.
The Entity Grid Monitor is essentially the knowledge graph. If you drill down to the object you published you can verify its success. If you go to the schema you can see how many Metadata elements were extracted and the total number of extracted values.
Imagine a workflow where Bob has published an entire schema. In Bob’s example it’s the FOODMART Database. You can see FOODMART’s profiling information in the SAP HANA Studio. The SAP HANA IM ESS schema comes with the ESS back-end system which includes storage and services. Bob drills into the SAP_HANA_IM_ESS_DEMO and does a data preview on the DISCOVERED_CONTENT_TYPES view.
To focus on a certain section Bob adds a filter on RUNTIME_OBJECTS for his FOODMART CUSTOMER table. It’s found that the Customer table in the FOODMART schema contains the below objects. One attribute is know as STATE_PROVINCE (technical) but is labeled Region (business).
The PROFILE_ATTRIBUTES view gives you the values for the attributes that have been extracted and indexed. The PROFILED_VALUE_TYPE column tells you the type of extracted value, TIME_VALUES, GEO_VALUES, or ENUMERATED_SET. The CONTENT_TYPE_CODE column tells you whether or not the extracted values correspond to known business types. Its important that values are extracted even if the business type is unknown. The extracted values will become searchable in queries even if they don’t have a known business type. These values are indexed using SAP HANA Full Text Indexes.
The ENUMERATED_VALUES view lists groups by the various values in each of the measures. For example, the types of member cards, such as Normal, Golden, Silver, Bronze.
How to use the Demo Tool Kit’s Search UI
The scenario in which Bob demonstrate the ESS Semantic Search he imagines he’s a business user, with a program that connects via an API, who’s searching for the total payment information for a specific insurance claim. While entering the keywords for his search Bob is prompted with potential results.
The EntitySet listed at the top matches the seven keywords Bob entered. The search uses SAP HANA Text Analysis and search capabilities to derive a ranking of the EntitySets it’s returned. The view listed at the top, InsuranceClaimPaymentQuery, has the highest scores because it matches all seven words.
Bob enters another search for “number of insurance contracts by premium exempt” and returns a list of SAP HANA Live views that best match his query. Ordinal 1, 4, 5 and 7 all have five key words matching Bob’s query.
How the Score Rankings are Derived
In SAP HANA Studio Bob shows how there are 37 different Calculation views in the fspm510 SAP HANA Live View. The Calculation views are ranked according to the objects contained within. On his ESS Semantic Search the InsuranceContractQuery view is ranked higher than the InsuranceContractPremium view. Bob opens both views in SAP HANA Studio to show that InsuranceContractQuery contains a measure while InsuranceContractPremium has zero measures.
Objects that contain both a measure and a dimension are ranked higher than objects that only contain a dimension. Similar rules also exist.
To further show how ESS Semantic Search works Bob queries for “unit sales by product and store canada versus usa from 2006 to 2007”. The results demonstrate the role played by extracted values in discovering dimensions hidden in the search query.
By navigating to the SALES Calculation views contained in the foodmart view back in SAP HANA Studio you can verify that its COUNTRY attribute is listed as a dimension.
You also have the option to use a programming like language to search as demonstrated below.
The other tabs available include SEARCH [MATCH] which breaks the results out by EntitySet, Attribute, and Match Annotations and Values.
This search feature is actually just a sample application. You’re actually accessing your data using a series of ESS APIs.
Admin UI Install, Setup and Test
In another video in the series Bob shows how to install the Enterprise Semantic Services’ Admin UI.
First navigate to SAP support portal from the SAP Service Marketplace. Go to download software, then installation, then choose H (for HANA) from the A – Z Index and log in with your certificate. Go to SAP HANA SDI and then click on Support Packages and Patches. Choose Comprised Software Component Variations, then drill down to HANA ESS 1.0, then # OS Independent and then SAP HANA Database. Select to download SP02 Patch0 for HANA ESS1.0.
Extract the Delivery Unit contained in a TGZ file and then log into your SAP HANA Lifecycle Manger through either your Web-based Development Workbench or your SAP HANA Studio. Go to your Delivery Unit page and import your downloaded TGZ file. You can verify its successful importation via the Transport Overview.
Navigate to the security section of the Web-based Development Workbench in order to grant your HANA user the roles necessary to use ESS. Click the green plus button under Granted Roles and search for ESS. The three roles you must grant are Administrator, Publisher and User.
The User role has access to the ESS consumption (search, suggest and CTID) APIs. This is read only access.
The Administrator can access the Admin UI of ESS and preform administration actions.
The Publisher role has access to the ESS publication API which allows content to published to the entity grid.
Next change the URL to sap/hana/im/ess/ui and log in with the user you recently granted the ESS roles. You now have access to the four Admin UI tiles Bob profiled in the video above.
In a new tab as your user access your Catalog from the Web-based Development Workbench. To test that the work flow works Bob will create a simple table with a single comment using the script below.
Next Bob opens the Publishing and Scheduling Monitor tile and drills down into his User’s schema from the Catalog. Bob selects his recently created HELLO_ESS table and chooses to publish it.
To confirm that it’s been published Bob opens the Request Monitor tile and confirms that the artifact HELLO_ESS has been successfully published.
To further test Bob opens the Entity Grid Monitor to confirm that the table appears in the tree list view of published artifacts.
Demo Kit Install, Setup and Test
In the next video Bob walks-through the installation of the Demo Tool Kit, which provides the sample ESS Search UI application showcased in the prior videos. The Demo Tool Kit contains both published and unpublished URLs to specify on-demand or unscheduled publication request, which are used to populate the entity grid.
Note that currently (early 2016) the demo kit is not available on SAP Service Marketplace. So you will have to get it through SAP support and/or your SAP contact.
Once you have the Demo Kit delivery unit navigate to the SAP HANA XS Lifecycle Manager to import it. Logon as the system user, go to the Delivery Unit page and import the Demo Kit Delivery Unit.
After logging out as the system user you will need to run a special utility to set up the Demo Kit. So append sap/hana/im/ess/setup/install.html on the end of HANA URL and log in as the system user. You can run setup at anytime especially to confirm that everything is OK if an instance has crashed. You can manually execute some of the settings such as the JobScheduler.
Click on Run ESS Setup and log in as your ESS technical user. Once the installation is finished your technical user’s ESS password will be disabled for security reasons. Once it’s completed you will get a confirmation that all of the settings are OK.
Next you must grant the proper rights to a user so they can use the Search UI contained in the Demo Tool Kit. You can do this in either the security section of the SAP HANA Web-based Development workbench or SAP HANA Studio. Bob elects to use SAP HANA Studio.
In SAP HANA Studio as the system user drill down into your catalog and open the SAP_HANA_IM_ESS schema. Opening the tables folder will show all of the tables including a batch of text index tables and a lot of objects. This ESS schema acts as your repository.
Open a new SQL console and run the below syntax to grant your user (Bob’s is called SHA) access to the Demo Tool Kit.
Next run the five commands shown below to grant privilege on the IM ESS on various views from the Administrator role. Bob’s user, SHA, is an Administrator.
Once these seven statements have been executed go to the Search UI by appending sap/hana/im/ess/demo to your HANA URL. Log in with your user’s credentials. It must be a system user or a user that has execute rights on the SYS repo activated role procedure, has access to the SQLcc administrator role, is an ESS role user and has the ESS Demo role.
First you will encounter the configuration screen shown above. Select the Configure ESS for imported delivery unit option to initialize your package. Bob demonstrated how to use the Search UI in the earlier video. Bob tests his Search UI by entering hello world ess and returns the Entityset he created in the previous video.
For more tutorial videos about What’s New with SAP HANA SPS 11 please check out this playlist.
SAP HANA Academy – Over 1,300 free tutorials videos on SAP HANA, SAP Analytics and the SAP HANA Cloud Platform.