In this part of the series on Graph – the new API for connecting to your business data – we will discuss the concepts and configuration of the Business Data Graph. Please refer to the Information Map to see all parts of this series. The Graph documentation on the Help Portal provides an in-depth look at many of the concepts featured in this part.
The “data graph” concept is central to the Graph capability. The business data graph is essentially the artifact that connects the business data together. The administrator is responsible for creating and shaping how the data in the business systems is reflected in the business data graph.
A data graph consists of mirrored entities, which are projections of the business objects that Graph automatically discovered in the business systems. They are mirrored one-to-one in the data graph and grouped in namespaces that correspond to each business system. Then the mirrored entities are connected through additional semantic connections.
Additional projections, called unified entities, are created on top of the mirrored entities. They connect semantically common business concepts from multiple data sources and are created in the namespace sap.graph. It is also possible for customers to extend the data graph by creating custom entities. We will address model extensions in a separate blog post.
Finally, the data graph is activated to create a business data graph, which is a runtime artifact based on the configured data graph, and accessible as a unified API.
The official documentation set provides goes more in-depth of what is described in this section and can be accessed here: SAP Help Portal: Graph - Business Data Graph
We pick up from where we left off at the end of the previous blog. You previously set up Graph in SAP Integration Suite, created destinations to data source endpoints, and assigned yourself the dedicated Graph role collections. Also, you created a service binding for Graph and generated and downloaded the credentials text file.
In the following steps, you will construct a business data graph from the data sources you previously configured as SAP BTP destinations and explore the business data graph in the Graph Navigator tool.
Construct the Business Data Graph
1. In the SAP Integration Suite application, select Graph under Design Artifacts in the left-side menu.
2. Select Create new business data graph in the center panel.
3. Provide an ID for the business data Graph. Use lowercase letters, numbers, and hyphens.
4. Select the data sources you would like to include in your business data graph. These are the destinations you previously configured in the SAP BTP cockpit. Select Next.
5. Skip the optional Model Extension step for now, by selecting Next. Your draft business data graph gets generated.
6. Review the configuration file and select Create to activate the business data graph.
7. Wait for the Status to update to be Available. Eventually, the status goes from Processing to Available.
Note: You can navigate to more information about individual business data graphs by selecting >. You can edit or delete the business data graph, or view the logs.
Explore the business data graph in the Graph Navigator
You just created your business data graph. Wouldn’t it be cool to explore the semantic connections between the data entities and even try out a few OData queries on the real data in the business systems? You can do exactly that using the Graph Navigator within API Business Hub Enterprise! This section takes you through exploring the business data graph you created in the previous section, using the Graph Navigator tool.
1. Open the Graph Navigator tool in API Business Hub Enterprise by selecting the menu icon in the top panel and then Graph Navigator.
2. The Graph Navigator automatically lists all the business data graphs in your SAP BTP subaccount. Select the business data graph you previously created.
3. On the left, in the Entities index, you see a search window, and collections of the available entities, grouped per namespace.
4. Depending on the data sources you included in your business data graph, you may have three namespaces containing the business objects from SAP SuccessFactors (sap.hcm), SAP S/4 HANA (sap.s4) and SAP Sales and Service Cloud (sap.c4c). Open one of these three namespaces. For instance, pick the sap.c4c namespace, and then select SalesQuoteCollection under Sales Quote.
5. You can easily see which operations are allowed (create, read, update, and delete), review the list of attributes, and see an actual data example. Take the time to explore the root entities (potentially representing 4,500+ entities and sub-entities in SAP systems), in the different namespaces, within the Graph Navigator context.
6. Explore one of the unified entities in the sap.graph namespace, the top namespace in the list on the left. Unified entities are simplified projections on some of the most complex business objects in SAP systems. They are useful in particular for apps that only require basic, essential information.
For instance, you can search for sales quote (or SalesQuote) in the search box on the left and pick the first search result: sap.graph/SalesQuote.
This too is a synthetic entity, a projection, of the actual sales information in your systems.
7. Now switch to the Try Out tab at the top.
8. You can see an OData request, for one record of sap.graph/SalesQuote ($top=1). Click Run. You will see your Sales Quote appear on the screen.
9. Now let's have some fun. Use the $expand button to check _salesOrganization and _distributionChannel. Did you see how this automatically changed the OData request?
10. Click run to see the result of this query. Scroll down to see the expanded sales organization and distribution channel information. As you can see, this is a (mock) quote from one of BestRun's direct sales customers in the US.
11. We could try out different variations of "$expand", to get of sense of all the data. Here is another fun query we can try:
/sap.graph/SalesQuote?$top=1&$expand=items($expand=_product)
and learn that the customer was quoted a single calculator which is of product type 3.
12. When dealing with a specific single record, we can also navigate across the data to access other pertinent information. First, let's expand the customer (a business partner) on our order to find out the type:
/sap.graph/SalesQuote/c4c~1?$expand=_soldToParty
13. This is a corporation, so we can navigate to:
/sap.graph/SalesQuote/c4c~1/_soldToParty/_corporateAccount
Let's also add some options to the query before we run it:
/sap.graph/SalesQuote/c4c~1/_soldToParty/_corporateAccount?$expand=addresses,contacts
14. Expanding and navigating are two powerful capabilities. But what makes data graphs even more useful are queries that combine these capabilities with other features, such as:
$select: return only the attributes you need
$filter: use data selection criteria
$orderby: return results in sort-order.
For instance, the following query lists ten sorted (ascending order) quotes by netAmount greater than 2000, with customer names and sales organization:
/sap.graph/SalesQuote?$top=10&$expand=_soldToParty($select=name)&$filter=netAmount ge 2000&$select=id,netAmount,salesOrganization&$orderby=netAmount
In summary
This part of the series concludes the basic introduction to Graph. In the previous part, we learned how to set up a landscape for Graph, which we used in this part to create a business data graph and explore it in the Graph Navigator tool.
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
Marc Vornetran, Product Owner – Graph in SAP Integration Suite
Learn more about Graph in the SAP Community
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
32 | |
17 | |
15 | |
14 | |
11 | |
9 | |
8 | |
8 | |
8 | |
7 |