SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Try Out Multi-Model Functionality with SAP HANA Cloud Central and Database Objects App

Explore knowledge graph, property graph, JSON document store, and spatial capabilities in SAP HANA Cloud Central.

Overview

🎓 beginner 15 min. SAP HANA CloudBeginnerSAP HANA Cloud SAP HANA DatabaseSAP HANASAP HANA Express EditionSAP HANA Multi Model ProcessingSAP HANA SpatialSAP HANA Graph

You will learn

  • โœ”How to create and explore a knowledge graph, a property graph, a document store, and spatial data
MICHELLE WANG M MICHELLE WANG August 13, 2026
Created by August 12, 2026
Contributors

Prerequisites

Prerequisites

  • A productive SAP HANA Cloud database
  • You have completed the first 3 tutorials in this group.

Steps

Intro

A knowledge graph can be used to store facts in triples providing additional meaning and relationships.

A property graph can be used to show the connections between items such as the connections between airports or between people or groups in a social network.

SAP HANA Cloud provides the ability to store and perform queries on spatial data such as a point, a line segment, or a polygon.

This tutorial is meant to be an introduction to these topics. For additional content see the tutorial groups Smart Multi-Model Data Processing with SAP HANA Cloud and Introduction to SAP HANA Spatial Data Types as well as the multi-model chapters in Basic Trial - Introduction to SAP HANA Cloud that are available once you sign up for the basic trial.


Step 1 Enable the triple store and create a knowledge graph (optional)
โ€”

The following steps will create a knowledge graph that provides information on additional hotel amenities, explores the created knowledge graph using the database objects app, and then will perform a query on the knowledge graph. Knowledge graphs are also known as resource description framework (RDF) named graphs and are stored in a triple store.

Before you can create a knowledge graph, please ensure your instance has the triple store activated. Here are the steps to doing this:

  1. Go to Manage Configuration on your SAP HANA Cloud Database.

    Manage Configuration
    Manage Configuration

  2. Under the Advanced Settings Tab, ensure the Triple Store option is enabled.

    Add Triple Store
    Add Triple Store

    The knowledge graph feature is not available for free tier instances. To view what is available in the free tier please refer to SAP HANA Database License

    To learn more about knowledge graphs see Connecting the Facts: SAP HANA Cloudโ€™s Knowledge Graph Engine for Business Context.

  3. Execute the following in the SQL Console. This query creates a knowledge graph with several hotels and amenities such as an indoor pool, hot tub, fitness center, etc.

    SQL
    --CALL SPARQL_EXECUTE('DROP GRAPH <kg_hotels>', '', ?, ?);
    CALL SPARQL_EXECUTE('
        INSERT DATA { GRAPH <kg_hotels> { 
            <http://example.org/hotels/Delta> a <Hotel>;
            <name> "Delta";
            <city> "Waterloo";
            <yearBuilt> 2012 .
    
            <http://example.org/hotels/hotelamenities/IndoorPool1> a <IndoorPool>;
            <included_at> <http://example.org/hotels/Delta>;
            <length> 25;
            <width> 10.
    
            <http://example.org/hotels/hotelamenities/Hottub1> a <Hottub>;
            <included_at> <http://example.org/hotels/Delta>;
            <length> 6;
            <width> 6.
    
            <http://example.org/hotels/hotelamenities/FitnessCenter1> a <FitnessCenter>;
            <included_at> <http://example.org/hotels/Delta>.
    
            <http://example.org/hotels/hotelamenities/Keurig> a <CoffeeMaker>;
            <included_at> <http://example.org/hotels/Delta>. 
    
            <http://example.org/hotels/Sunshine> a <Hotel>;
            <name> "Sunshine";
            <city> "Clearwater";
            <yearBuilt> 1975 .
    
            <http://example.org/hotels/hotelamenities/Restaurant1> a <Restaurant>;
            <included_at> <http://example.org/hotels/Sunshine>;
            <seating> 95.
    
            <http://example.org/hotels/hotelamenities/FitnessCenter2> a <FitnessCenter>;
            <included_at> <http://example.org/hotels/Sunshine>.
    
            <http://example.org/hotels/hotelamenities/Laundry1> a <DryCleaning>;
            <included_at> <http://example.org/hotels/Sunshine>. 
    
            <http://example.org/hotels/Congress> a <Hotel>;
            <name> "Congress";
            <city> "Seattle";
            <yearBuilt> 2012 .
    
            <http://example.org/hotels/hotelamenities/IndoorPool2> a <IndoorPool>;
            <included_at> <http://example.org/hotels/Congress>;
            <length> 30;
            <width> 15.
    
            <http://example.org/hotels/hotelamenities/Restaurant2> a <Restaurant>;
            <included_at> <http://example.org/hotels/Congress>;
            <seating> 122.
    
            <http://example.org/hotels/hotelamenities/FitnessCenter3> a <FitnessCenter>;
            <included_at> <http://example.org/hotels/Congress>.
    
            <http://example.org/hotels/hotelamenities/Spa1> a <Spa>;
            <included_at> <http://example.org/hotels/Congress>. 
    
            <http://example.org/hotels/OceanStar> a <Hotel>;
            <name> "Ocean Star";
            <city> "Atlantic City";
            <yearBuilt> 2012 .
    
            <http://example.org/hotels/hotelamenities/IndoorPool3> a <IndoorPool>;
            <included_at> <http://example.org/hotels/OceanStar>;
            <length> 50;
            <width> 30.
    
            <http://example.org/hotels/hotelamenities/Restaurant2> a <Restaurant>;
            <included_at> <http://example.org/hotels/OceanStar>;
            <seating> 205.
    
            <http://example.org/hotels/hotelamenities/Cleaning1> a <CleaningServices>;
            <included_at> <http://example.org/hotels/OceanStar>.
    
            <http://example.org/hotels/hotelamenities/Spa2> a <Spa>;
            <included_at> <http://example.org/hotels/OceanStar>. 
    
            <http://example.org/hotels/LongIsland> a <Hotel>;
            <name> "LongIsland";
            <city> "Long Island";
            <yearBuilt> 2021 .
    
            <http://example.org/hotels/hotelamenities/Entertainment1> a <Entertainment>;
            <included_at> <http://example.org/hotels/LongIsland>.
    
            <http://example.org/hotels/hotelamenities/Restaurant3> a <Restaurant>;
            <included_at> <http://example.org/hotels/LongIsland>;
            <seating> 122.
    
            <http://example.org/hotels/hotelamenities/Cleaning2> a <CleaningServices>;
            <included_at> <http://example.org/hotels/LongIsland>.
    
            <http://example.org/hotels/hotelamenities/Spa3> a <Spa>;
            <included_at> <http://example.org/hotels/LongIsland>. 
    
            <http://example.org/hotels/hotelamenities/Hottub2> a <Hottub>;
            <included_at> <http://example.org/hotels/LongIsland>. 
        } 
        }
        ', '', ?, ?
    );

    Additional examples can be found at SAP HANA Cloud, SAP HANA Database SPARQL Reference Guide

  4. To visualize and examine the knowledge graph database objects, you must first enable the feature in your preferences. Click on your account

    Account Settings
    Account Settings

    Go to the Database Objects tab

    Database Objects Tab
    Database Objects Tab

    Enable RDF Named Graphs

    Enable RDF Graphs
    Enable RDF Graphs

    You will now have the RDF Named Graphs view available.

    RDF Named Graphs View
    RDF Named Graphs View

    You may also edit visibility by navigating to Select Object Types

    Select Objects
    Select Objects

    The DEFAULT graph is where content goes when it doesn’t have a name. For more information, review the DEFAULT_GRAPHS and Named Graphs help page.

    Click on the kg_hotels graph, and open the graph ontology to see the nodes.

    Graph Ontology View
    Graph Ontology View

  5. Run a query to find hotelsย that have an indoor pool.

    SQL
    SELECT *
    FROM SPARQL_TABLE('
    PREFIX ex: <http://example.org/hotels/>
    SELECT ?hotel ?hotelName ?city ?yearBuilt ?poolLength ?poolWidth
    FROM <kg_hotels>
    WHERE {
        ?hotel a <Hotel> ;
    <name> ?hotelName ;
    <city> ?city ;
    <yearBuilt> ?yearBuilt .
        ?pool a <IndoorPool> ;
    <included_at> ?hotel ;
    <length> ?poolLength ;
    <width> ?poolWidth .
    }
    ');

    Indoor Pool
    Indoor Pool

    Further examples of creating SPARQL statements can be found at SPARQL SELECT Queries Using SPARQL_TABLE.

Step 2 Create a property graph workspace
+
Step 3 Explore a property graph using the viewer
+
Step 4 Use property graph algorithms
+
Step 5 Create, populate, and query a JSON collection (optional)
+
Step 6 Import a JSON collection using the hana_ml.docstore package (optional)
+
Step 7 Import spatial data
+
Step 8 Use spatial functions in a query
+
Step 9 Knowledge check
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 9
1. Enable the triple store and create a knowledge graph (optional) 2. Create a property graph workspace 3. Explore a property graph using the viewer 4. Use property graph algorithms 5. Create, populate, and query a JSON collection (optional) 6. Import a JSON collection using the hana_ml.docstore package (optional) 7. Import spatial data 8. Use spatial functions in a query 9. Knowledge check

Learn more →