Building Intelligent Data Applications with SAP HANA Cloud Knowledge Graph Engine

Estimated read time 19 min read

As part of the QRC1 2025 release, SAP HANA Cloud has unveiled its latest multi-model feature—the Knowledge Graph Engine (KGE). We’re thrilled to announce the publication of a discovery mission that explores this powerful new capability in depth.

What Our Discovery Mission Offers

Our mission provides a comprehensive look at the Knowledge Graph Engine’s key features, demonstrating how to build end-to-end applications and solution for processing:

Unstructured data (such as documents)Tabular data through the SAP HANA Cloud Knowledge EngineIntegrations with various LLM platforms, including:SAP GenAI HubAWS Bedrock (direct partner access)Azure OpenAIPrompt templates for generating SPARQL queries based on user prompts

We’ve included fully functional repositories that can be validated with Python scripts and a demo application. The content is designed to be plug-and-play—we provide both unstructured and tabular datasets, requiring you to simply replace the credentials for SAP HANA Cloud and API keys for your preferred LLM service. Once you grasp the fundamentals of SAP HANA Cloud KGE, you can easily extend or modify the code for your specific use cases.

Background Reading

Several blogs have already addressed the announcement of SAP HANA Cloud KGE. For those new to the topic, I recommend reviewing  @shabana ‘s blogs to understand:

The basics of SAP HANA Cloud KGEThe RDF framework we’ve adoptedCore concepts of SPARQL

Additionally,  @thomashammer ‘s blogs on the QRC1 2025 release of KGE provide valuable insights into the latest developments. Finally for early adoption of KGE, please refer to @susenpoppe  blog.

About Our Discovery Mission

Our newly launched SAP Discovery Mission covers:

The fundamentals of SAP HANA KGEUsing graph transformers to process unstructured data and convert it to triplesCreating ontologies for structured data and generating triples based on these ontologies

All repositories are provided as part of the mission, which you can access here:  Building Intelligent Data Applications with SAP HANA Cloud Knowledge Graphs

What is the Ideal Use Case for this Discovery Mission?

Consider an organization where project members must review numerous specification documents during onboarding. Instead of the time-consuming process of reviewing all documents manually, users could query document content using natural language, significantly reducing review time. This is precisely where having documents stored as triples in SAP HANA Cloud KGE delivers tremendous value.

In our demo scenario, we process a PDF document (SAP FAQ Note) through a graph transformer to extract its content. The extracted information is then processed using RDF libraries to convert it into triples. Finally, we implement a prompt template mechanism for intelligent retrieval based on business users’ natural language queries.

For example, based on an FAQ note about SAP HANA hotspots, if a business user asks, “What is the HANA KPI collector?”, our application:

Converts this natural language prompt into a precise SPARQL query using a prompting templateExecutes the query against the knowledge graphDelivers a refined, contextual response powered by AWS Bedrock foundation models like Anthropic Claude Sonnet

This scenario clearly demonstrates how our solution:

Chunks unstructured documents (PDFs, Word files) into manageable segmentsEmploys graph transformers to analyze these chunks and identify nodes and edgesTransforms graph transformer responses into standardized RDF triplesIngests these RDF triples into SAP HANA Cloud using the Knowledge Graph Engine via SPARQLConverts business user prompts into executable SPARQL queries through specialized prompting templatesRoutes retrieved triples to an LLM to generate concise, accurate responses for the user

While we use SAP FAQ notes rather than actual customer data (for privacy reasons), this approach demonstrates all the core capabilities mentioned above. Our Discovery Mission includes a comprehensive schema for tabular data applications, and we’ll share additional scenarios and code snippets in upcoming blog posts.

Another powerful use case involves business users interacting with tabular data through natural language rather than pre-built analytical models. In this approach, metadata and semantic relationships between tables are stored as triples in SAP HANA Cloud KGE. We leverage ontologies to establish these semantic relationships, also stored as triples within SAP HANA Cloud.

When a business user submits a natural language query, the application identifies relevant semantic relationships, dynamically generates appropriate SQL, and presents a refined response using an LLM. While our demonstration uses database tables, this approach easily extends to OData services or Calculation Views.

Though the retrieval mechanism remains consistent across these scenarios, the triple generation approach differs significantly when working with tabular data by employing ontology-based modeling. Please refer to the complete mission for detailed implementation guidance and examples.

What About the Architecture for Unstructured Data Use Cases?

The architecture leveraging SAP HANA Cloud Knowledge Graph Engine and Large Language Models (LLMs) for unstructured data consists of two distinct phases: Triple Generation and Knowledge Retrieval. Let’s examine each component:

Phase 1: Generating Triples (Steps 1-3)

Document Processing & Chunking:
PDF documents from either local FTP servers or cloud storage are accessed and systematically divided into manageable chunks. This chunking strategy is critical for efficient processing and ensuring the graph transformer can effectively analyze contextual relationships.

Graph Transformation:
The chunked text undergoes transformation through a graph transformer powered by Azure GPT-4o LLM. This sophisticated process parses and categorizes entities while identifying meaningful relationships between them, creating a structured representation of previously unstructured content.

Triple Creation & Ingestion:
The identified entities and relationships are converted into standardized RDF triples using RDF libraries. These triples are then ingested into SAP HANA Cloud via SPARQL insert operations, forming the foundation of our queryable knowledge graph.

Phase 2: Retrieving Triples Based on User Prompts (Steps 4-7)

Validation Through User Interaction:
The ingested triples can be validated through direct user prompts using either the provided Python scripts or a custom application included in the mission materials.

Query Transformation:
User prompts in natural language are transformed into precise SPARQL queries using specialized prompting templates, enabling accurate knowledge retrieval from the graph.

Knowledge Graph Query Execution:
The generated SPARQL query is executed against either the default namespace or a specified named graph, retrieving relevant triples that match the user’s information needs.

Response Refinement:
Before presenting results to the user, we enhance the raw triple data using Anthropic Claude Sonnet (accessed through AWS Bedrock foundation models) to generate coherent, contextually relevant responses. This validation can be performed through the provided Python scripts or mission application.

This architecture demonstrates how unstructured document knowledge can be transformed into structured, queryable information that supports natural language interactions while leveraging the complementary strengths of knowledge graphs and large language models.

What About the Architecture Using LLMs from SAP GenAI Hub?

 

 

For our use case leveraging SAP HANA Cloud KGE and  LLMs from SAP GenAI Hub for unstructured data, we adopt a similar approach to what we discussed previously, with one key distinction.

Currently, we are utilizing SAP GenAI Hub exclusively for the retrieval phase (Steps 4-7) and not for the triple ingestion process (Steps 1-3). This means that while our knowledge retrieval, query transformation, and response generation leverage SAP GenAI Hub’s capabilities, the initial document processing, graph transformation, and triple creation still rely on our previously described workflow.

As SAP continues to expand GenAI Hub’s capabilities with relevant langchain implementations, we plan to update the mission to incorporate these advancements across the entire pipeline. This will eventually enable a fully integrated approach using SAP’s native generative AI capabilities throughout the knowledge graph lifecycle.

We will keep the mission documentation current as these implementations become available, ensuring you have access to the most efficient and integrated approach possible.

What Configurations & Prerequisites Are Needed for This Discovery Mission?

Before embarking on this Knowledge Graph journey, you’ll need to set up several key components to ensure a smooth experience throughout the Discovery Mission.

First and foremost, please review the comprehensive “Preparation” and “Setup” sections of the Project Board included in the Discovery Mission. These sections provide detailed guidance on configuring your environment properly.

 

Critical requirements include:

SAP HANA Cloud Triple Store Activation: Ensure you have enabled the triple store functionality on your SAP HANA Cloud instance. This is essential for storing and querying the RDF triples that form the foundation of the knowledge graph.

LLM Access for Graph Transformation: To generate high-quality triples using graph transformers, you’ll need an Azure OpenAI subscription. This powers the sophisticated entity and relationship extraction process from unstructured documents.

Retrieval Layer Options: For the knowledge retrieval and response generation components, you have flexibility in your approach. You can leverage either:

SAP GenAI Hub (recommended for SAP-integrated environments)Azure OpenAI servicesAWS Bedrock subscription

Each option provides robust capabilities for transforming user queries and generating refined responses, allowing you to select the platform that best aligns with your existing technology stack or strategic direction.

The mission documentation provides specific connection parameters and configuration steps for each of these components to streamline your setup process.

What is the Mission implementation approach with SAP HANA Cloud KGE?

In our mission, we’ve curated a comprehensive set of scenarios that highlight the powerful capabilities of the SAP HANA Cloud Knowledge Graph Engine, SAP Generative AI Hub, and partner LLMs from AWS Bedrock and Azure OpenAI. For practitioners and technical experts looking to gain hands-on experience, we’ve developed detailed Python scripts that serve as practical implementation guides.

Scenario Coverage: 

Unstructured Data Knowledge Graphs (Scenarios 1-5)

Implementation Scenarios: Unstructured Data
These scenarios provide end-to-end workflows for transforming document-based information into queryable knowledge graphs. Each scenario clearly identifies which LLM service powers specific components and precisely where SAP HANA Cloud KGE plays a critical role in the processing pipeline.

Tabular Data Knowledge Graphs (Scenarios 6-7)

Our tabular data scenarios demonstrate how structured business data can be enhanced through knowledge graph representations. These examples illustrate ontology creation, semantic relationship modeling, and natural language interfaces for business data access.

To facilitate smooth implementation, we’ve included comprehensive setup guides for all required services:

Azure OpenAI configuration and API integrationAWS Bedrock foundation model accessSAP GenAI Hub connection setupAuthentication key management for Python script integration

 

These detailed instructions ensure you can focus on exploring the knowledge graph capabilities rather than troubleshooting configuration issues. The provided Python scripts serve not only as implementation tools but also as learning resources that can be adapted for your specific use cases.

How to Deploy the Knowledge Graph Application?

Deploying the Knowledge Graph application is straightforward—simply follow the comprehensive step-by-step instructions provided within the deployment tile of our mission. The application has been designed with flexibility in mind, offering full compatibility with LLMs from both SAP Generative AI Hub and AWS Bedrock, allowing you to leverage whichever platform best suits your organization’s needs.

What’s Coming Next

In our upcoming blog, we’ll provide a practical, hands-on exploration and detailed code review for one of the key scenarios we’ve discussed. This deep dive will give you actionable insights into implementation specifics and best practices for working with knowledge graphs and LLMs in an integrated environment.

We strongly encourage you to engage with the mission content and follow the guided journey to gain a comprehensive understanding of SAP HANA Cloud KGE and its impressive capabilities. The hands-on exercises will help you build practical skills that can be applied to your specific business challenges.

Your feedback is invaluable to us! As you work through the mission, we welcome your thoughts, suggestions, and questions. Should you encounter any difficulties while exploring the knowledge graph implementation, our support team is readily available through the Discovery Center Mission support channels.

Here’s to an enjoyable learning journey as you discover the transformative potential of combining SAP HANA Cloud knowledge graphs with LLMs!

 

 

​ As part of the QRC1 2025 release, SAP HANA Cloud has unveiled its latest multi-model feature—the Knowledge Graph Engine (KGE). We’re thrilled to announce the publication of a discovery mission that explores this powerful new capability in depth.What Our Discovery Mission OffersOur mission provides a comprehensive look at the Knowledge Graph Engine’s key features, demonstrating how to build end-to-end applications and solution for processing:Unstructured data (such as documents)Tabular data through the SAP HANA Cloud Knowledge EngineIntegrations with various LLM platforms, including:SAP GenAI HubAWS Bedrock (direct partner access)Azure OpenAIPrompt templates for generating SPARQL queries based on user promptsWe’ve included fully functional repositories that can be validated with Python scripts and a demo application. The content is designed to be plug-and-play—we provide both unstructured and tabular datasets, requiring you to simply replace the credentials for SAP HANA Cloud and API keys for your preferred LLM service. Once you grasp the fundamentals of SAP HANA Cloud KGE, you can easily extend or modify the code for your specific use cases.Background ReadingSeveral blogs have already addressed the announcement of SAP HANA Cloud KGE. For those new to the topic, I recommend reviewing  @shabana ‘s blogs to understand:The basics of SAP HANA Cloud KGEThe RDF framework we’ve adoptedCore concepts of SPARQLAdditionally,  @thomashammer ‘s blogs on the QRC1 2025 release of KGE provide valuable insights into the latest developments. Finally for early adoption of KGE, please refer to @susenpoppe  blog.About Our Discovery MissionOur newly launched SAP Discovery Mission covers:The fundamentals of SAP HANA KGEUsing graph transformers to process unstructured data and convert it to triplesCreating ontologies for structured data and generating triples based on these ontologiesAll repositories are provided as part of the mission, which you can access here:  Building Intelligent Data Applications with SAP HANA Cloud Knowledge GraphsWhat is the Ideal Use Case for this Discovery Mission?Consider an organization where project members must review numerous specification documents during onboarding. Instead of the time-consuming process of reviewing all documents manually, users could query document content using natural language, significantly reducing review time. This is precisely where having documents stored as triples in SAP HANA Cloud KGE delivers tremendous value.In our demo scenario, we process a PDF document (SAP FAQ Note) through a graph transformer to extract its content. The extracted information is then processed using RDF libraries to convert it into triples. Finally, we implement a prompt template mechanism for intelligent retrieval based on business users’ natural language queries.For example, based on an FAQ note about SAP HANA hotspots, if a business user asks, “What is the HANA KPI collector?”, our application:Converts this natural language prompt into a precise SPARQL query using a prompting templateExecutes the query against the knowledge graphDelivers a refined, contextual response powered by AWS Bedrock foundation models like Anthropic Claude SonnetThis scenario clearly demonstrates how our solution:Chunks unstructured documents (PDFs, Word files) into manageable segmentsEmploys graph transformers to analyze these chunks and identify nodes and edgesTransforms graph transformer responses into standardized RDF triplesIngests these RDF triples into SAP HANA Cloud using the Knowledge Graph Engine via SPARQLConverts business user prompts into executable SPARQL queries through specialized prompting templatesRoutes retrieved triples to an LLM to generate concise, accurate responses for the userWhile we use SAP FAQ notes rather than actual customer data (for privacy reasons), this approach demonstrates all the core capabilities mentioned above. Our Discovery Mission includes a comprehensive schema for tabular data applications, and we’ll share additional scenarios and code snippets in upcoming blog posts.Another powerful use case involves business users interacting with tabular data through natural language rather than pre-built analytical models. In this approach, metadata and semantic relationships between tables are stored as triples in SAP HANA Cloud KGE. We leverage ontologies to establish these semantic relationships, also stored as triples within SAP HANA Cloud.When a business user submits a natural language query, the application identifies relevant semantic relationships, dynamically generates appropriate SQL, and presents a refined response using an LLM. While our demonstration uses database tables, this approach easily extends to OData services or Calculation Views.Though the retrieval mechanism remains consistent across these scenarios, the triple generation approach differs significantly when working with tabular data by employing ontology-based modeling. Please refer to the complete mission for detailed implementation guidance and examples.What About the Architecture for Unstructured Data Use Cases?The architecture leveraging SAP HANA Cloud Knowledge Graph Engine and Large Language Models (LLMs) for unstructured data consists of two distinct phases: Triple Generation and Knowledge Retrieval. Let’s examine each component:Phase 1: Generating Triples (Steps 1-3)Document Processing & Chunking:PDF documents from either local FTP servers or cloud storage are accessed and systematically divided into manageable chunks. This chunking strategy is critical for efficient processing and ensuring the graph transformer can effectively analyze contextual relationships.Graph Transformation:The chunked text undergoes transformation through a graph transformer powered by Azure GPT-4o LLM. This sophisticated process parses and categorizes entities while identifying meaningful relationships between them, creating a structured representation of previously unstructured content.Triple Creation & Ingestion:The identified entities and relationships are converted into standardized RDF triples using RDF libraries. These triples are then ingested into SAP HANA Cloud via SPARQL insert operations, forming the foundation of our queryable knowledge graph.Phase 2: Retrieving Triples Based on User Prompts (Steps 4-7)Validation Through User Interaction:The ingested triples can be validated through direct user prompts using either the provided Python scripts or a custom application included in the mission materials.Query Transformation:User prompts in natural language are transformed into precise SPARQL queries using specialized prompting templates, enabling accurate knowledge retrieval from the graph.Knowledge Graph Query Execution:The generated SPARQL query is executed against either the default namespace or a specified named graph, retrieving relevant triples that match the user’s information needs.Response Refinement:Before presenting results to the user, we enhance the raw triple data using Anthropic Claude Sonnet (accessed through AWS Bedrock foundation models) to generate coherent, contextually relevant responses. This validation can be performed through the provided Python scripts or mission application.This architecture demonstrates how unstructured document knowledge can be transformed into structured, queryable information that supports natural language interactions while leveraging the complementary strengths of knowledge graphs and large language models.What About the Architecture Using LLMs from SAP GenAI Hub?  For our use case leveraging SAP HANA Cloud KGE and  LLMs from SAP GenAI Hub for unstructured data, we adopt a similar approach to what we discussed previously, with one key distinction.Currently, we are utilizing SAP GenAI Hub exclusively for the retrieval phase (Steps 4-7) and not for the triple ingestion process (Steps 1-3). This means that while our knowledge retrieval, query transformation, and response generation leverage SAP GenAI Hub’s capabilities, the initial document processing, graph transformation, and triple creation still rely on our previously described workflow.As SAP continues to expand GenAI Hub’s capabilities with relevant langchain implementations, we plan to update the mission to incorporate these advancements across the entire pipeline. This will eventually enable a fully integrated approach using SAP’s native generative AI capabilities throughout the knowledge graph lifecycle.We will keep the mission documentation current as these implementations become available, ensuring you have access to the most efficient and integrated approach possible.What Configurations & Prerequisites Are Needed for This Discovery Mission?Before embarking on this Knowledge Graph journey, you’ll need to set up several key components to ensure a smooth experience throughout the Discovery Mission.First and foremost, please review the comprehensive “Preparation” and “Setup” sections of the Project Board included in the Discovery Mission. These sections provide detailed guidance on configuring your environment properly. Critical requirements include:SAP HANA Cloud Triple Store Activation: Ensure you have enabled the triple store functionality on your SAP HANA Cloud instance. This is essential for storing and querying the RDF triples that form the foundation of the knowledge graph.LLM Access for Graph Transformation: To generate high-quality triples using graph transformers, you’ll need an Azure OpenAI subscription. This powers the sophisticated entity and relationship extraction process from unstructured documents.Retrieval Layer Options: For the knowledge retrieval and response generation components, you have flexibility in your approach. You can leverage either:SAP GenAI Hub (recommended for SAP-integrated environments)Azure OpenAI servicesAWS Bedrock subscriptionEach option provides robust capabilities for transforming user queries and generating refined responses, allowing you to select the platform that best aligns with your existing technology stack or strategic direction.The mission documentation provides specific connection parameters and configuration steps for each of these components to streamline your setup process.What is the Mission implementation approach with SAP HANA Cloud KGE?In our mission, we’ve curated a comprehensive set of scenarios that highlight the powerful capabilities of the SAP HANA Cloud Knowledge Graph Engine, SAP Generative AI Hub, and partner LLMs from AWS Bedrock and Azure OpenAI. For practitioners and technical experts looking to gain hands-on experience, we’ve developed detailed Python scripts that serve as practical implementation guides.Scenario Coverage: Unstructured Data Knowledge Graphs (Scenarios 1-5)Implementation Scenarios: Unstructured DataThese scenarios provide end-to-end workflows for transforming document-based information into queryable knowledge graphs. Each scenario clearly identifies which LLM service powers specific components and precisely where SAP HANA Cloud KGE plays a critical role in the processing pipeline.Tabular Data Knowledge Graphs (Scenarios 6-7)Our tabular data scenarios demonstrate how structured business data can be enhanced through knowledge graph representations. These examples illustrate ontology creation, semantic relationship modeling, and natural language interfaces for business data access.To facilitate smooth implementation, we’ve included comprehensive setup guides for all required services:Azure OpenAI configuration and API integrationAWS Bedrock foundation model accessSAP GenAI Hub connection setupAuthentication key management for Python script integration These detailed instructions ensure you can focus on exploring the knowledge graph capabilities rather than troubleshooting configuration issues. The provided Python scripts serve not only as implementation tools but also as learning resources that can be adapted for your specific use cases.How to Deploy the Knowledge Graph Application?Deploying the Knowledge Graph application is straightforward—simply follow the comprehensive step-by-step instructions provided within the deployment tile of our mission. The application has been designed with flexibility in mind, offering full compatibility with LLMs from both SAP Generative AI Hub and AWS Bedrock, allowing you to leverage whichever platform best suits your organization’s needs.What’s Coming NextIn our upcoming blog, we’ll provide a practical, hands-on exploration and detailed code review for one of the key scenarios we’ve discussed. This deep dive will give you actionable insights into implementation specifics and best practices for working with knowledge graphs and LLMs in an integrated environment.We strongly encourage you to engage with the mission content and follow the guided journey to gain a comprehensive understanding of SAP HANA Cloud KGE and its impressive capabilities. The hands-on exercises will help you build practical skills that can be applied to your specific business challenges.Your feedback is invaluable to us! As you work through the mission, we welcome your thoughts, suggestions, and questions. Should you encounter any difficulties while exploring the knowledge graph implementation, our support team is readily available through the Discovery Center Mission support channels.Here’s to an enjoyable learning journey as you discover the transformative potential of combining SAP HANA Cloud knowledge graphs with LLMs!    Read More Technology Blogs by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author