OpenLink Logo

Virtuoso Demo

Turn Your Data Into Decisive Knowledge

Build powerful, secure, and scalable Knowledge Graphs with the Virtuoso Data Spaces platform.

Overview

This document presents a collection of practical use-case demonstrations showcasing the Virtuoso Data Spaces platform (spanning databases, knowledge graphs, and filesystems), the OpenLink AI Layer (OPAL), and other complementary tools from our vertically integrated product portfolio.

Generating A Knowledge Graph from a WebPage

Using a combination of the OpenLink Structure Data Sniffer (OSDS) and OpenLink AI Layer (OPAL), a knowledge graph can be immediately generated and stored without hand-written code.

Example: https://www.boozallen.com

Booz Allen Hamilton Unstructured Knowledge Graph

Generating a Knowledge Graphs from disparate sources via the OpenLink AI Layer (OPAL)

OPAL

(OPAL) is an LLM powered Smart Agent for invoking Actions via Functions that operate on data accessible via HTTP, ODBC, or JDBC.

OPAL is both MCP (Model Context Protocol) and A2A (Agent-2-Agent Protoco) complient, and is immediately useable with OpenAI, Anthropic, Grok, Mistral, Gemini, and other LLM services. Additionally, it can be easily configured to use any LLM service that uses the OpenAI API URL pattern (E.G., OpenAI, Ollama, LM Studio, etc.)

architecture

Using The OpenLink AI Layer (OPAL), we can create and upload a knowledge graph using natural language.

The /chat interface interface allows users to communicate with Assistants powered by JSON configurations. These configurations can be used with OpenAI, Anthropic, Gemini, and other models.

The /assist-metal interface allows users to develop and communicate with assistants built for use with the OpenAI API

Generating a Knowledge Graph from Email Files

This example demonstrates adding email content and extracted entities to our knowledge graph.

Generating a Knowledge Graph using Call Transcripts

This example demonstrates converting call transcript files to RDF turtle, and also executing entity extraction.

Generating a Knowledge Graph using a DoD Report

This example demonstrates converting a reportto RDF turtle, and adding it to our knowedge graph.

Integration with LLMs

OPAL

The OpenLink AI Layer (OPAL) is a powerful add-on to Virtuoso that loosely couples LLMs with operations and data spaces—spanning databases, knowledge graphs, and filesystems.

OPAL is ready to use with OpenAI, Anthropic, Grok, Mistral, and more. It can also be easily configured to work with any LLM service that supports OpenAI’s function-calling API, including options like Ollama, LM Studio, Cerebras, and Groq.

generic-llm-app-architecture
Webpage Integration
Evaluation License Generation

Here’s a screencast demonstrating an OPAL-deployed AI Agent/Assistant embedded in an HTML page and accessed via a Chatbot interface. In this example, a Customer Support Agent handles a request for an evaluation license.

opal-demo-eval
Support Agent

In this screencast example, the same Customer Support Agent handles a product support-related interaction.

opal-demo-support

MCP Servers

OPAL’s core functionality—along with the AI Agents/Assistants built using it—is also directly accessible as MCP (Model Context Protocol) tools via the OPAL MCP server. As a Virtuoso add-on, OPAL additionally exposes a broad range of functionality, including:

  • Database administration
  • Fine-grained, attribute-based access controls
  • WebDAV filesystem management
  • Virtual and native multi-model database management
  • Query processing (SQL, SPARQL, GraphQL), and more.
Querying Attached PostgreSQL tables from Virtuoso via MCP and creating a Dashboard with Claude
Claude MCP JDBC Virtuoso PostgreSQL
Using OPAL to query Virtuoso via MCP Inspector + SSE
OpenLink MCP Servers

A2A Example

This screencast demonstrates an A2A instigated Agentic workflow that includes interactions with an AI Agent/Assistant created and deployed using OPAL.

Langchain

Additional Examples

Virtual + Physical Knowledge Graphs from CSV Documents

Dataset

This synthetic dataset includes:

  • Transaction Data: Details of financial transactions including transaction ID, timestamp, amount, sender and receiver account numbers, transaction type, and status.
  • Customer Data: Customer profiles including customer ID, name, address, account numbers, transaction history, and risk scores.
  • Account Data: Information about different accounts, balances, account types, and linked customers.
  • Fraud Labels: Indicate whether a transaction is fraudulent or not (for training and validation in machine learning models).
Script Breakdown: Creating a Knowledge Graph from 80 CSV Documents.

Convert customer and transaction data into Virtual and Physical RDF triples using R2RML (Wizard and Linked Data View Generator).

Load Data into Virtual and Physical SQL Tables

Install Custom Stored Procedure for quickly mapping multiple CSV documents to a virtual SQL Table:

SQL
-- Install ATTACH_FROM_CSV_DIR
DROP PROCEDURE file_dirlist_full;
CREATE PROCEDURE file_dirlist_full (IN a ANY)
    {
        DECLARE _inx integer;        
        DECLARE F VARCHAR;
        DECLARE L INT;

        F := file_dirlist(a,1);
        L := length(F);
        _inx := 0;

        
        While(_inx < L){
            DECLARE v any;
        F[_inx] := concat(a,'/',F[_inx]);
        _inx := _inx + 1;

        }

        return F;
    
    };

DROP PROCEDURE attach_from_csv_dir;
CREATE PROCEDURE attach_from_csv_dir (IN tb VARCHAR, IN dir ANY, in delimiter VARCHAR, in newline VARCHAR, in esc VARCHAR, in skip_rows int, in pkey_columns any := null)
    {
    declare f VARCHAR;

    f:= attach_from_csv(tb,file_dirlist_full(dir),delimiter,newline,esc,skip_rows,pkey_columns);

    return F;
    };

Additional Content

Create Virtual and Physical SQL Tables of CSV Data

SQL
SPARQL CLEAR GRAPH  <urn:demo.openlinksw.com:fint>;

DROP TABLE demo.fint.account IF EXISTS;
DROP TABLE demo.fint.customer IF EXISTS;
DROP TABLE demo.fint.transaction IF EXISTS;
DROP TABLE demo.fint.fraud_label IF EXISTS;

DROP TABLE demo.fint.account_physical IF EXISTS;
DROP TABLE demo.fint.customer_physical IF EXISTS;
DROP TABLE demo.fint.transaction_physical IF EXISTS;
DROP TABLE demo.fint.fraud_label_physical IF EXISTS;

ATTACH_FROM_CSV_DIR('demo.fint.account','fint/synthetic_data/accounts',',','\n',null,1,VECTOR(1));
ATTACH_FROM_CSV_DIR('demo.fint.customer','fint/synthetic_data/customers',',','\n',null,1,VECTOR(1));
ATTACH_FROM_CSV_DIR('demo.fint.transaction','fint/synthetic_data/transactions',',','\n',null,1,VECTOR(1));
ATTACH_FROM_CSV_DIR('demo.fint.fraud_label','fint/synthetic_data/fraud_labels',',','\n',null,1,VECTOR(1));

GRANT SELECT ON demo.fint.account to SPARQL_SELECT;
GRANT SELECT ON demo.fint.customer to SPARQL_SELECT;
GRANT SELECT ON demo.fint.transaction to SPARQL_SELECT;
GRANT SELECT ON demo.fint.fraud_label to SPARQL_SELECT;


-- Optional Create SQL Tables Containing Physical Data

CREATE TABLE demo.fint.account_physical
AS SELECT * FROM demo.fint.account
WITH DATA;

CREATE TABLE demo.fint.customer_physical
AS SELECT * FROM demo.fint.customer
WITH DATA;

CREATE TABLE demo.fint.transaction_physical
AS SELECT * FROM demo.fint.transaction
WITH DATA;

CREATE TABLE demo.fint.fraud_label_physical
AS SELECT * FROM demo.fint.fraud_label
WITH DATA;

GRANT SELECT ON demo.fint.account_physical to SPARQL_SELECT;
GRANT SELECT ON demo.fint.customer_physical to SPARQL_SELECT;
GRANT SELECT ON demo.fint.transaction_physical to SPARQL_SELECT;
GRANT SELECT ON demo.fint.fraud_label_physical to SPARQL_SELECT;
fint-cleanup-and-add-tables
Confirm Virtual and Physical Table Creation by Chatting with our Data:

We can use OPAL to query the generated table using natural language. A configuration file provides the DDL (Data Definition Language), which can be used to generate queries, provide hard-coded queries to execute, and deliver answers.

OPAL SQL Virtual Test Queries

Generate Virtual and Physical Linked Data Views

Option 1: R2RML Wizard (for users who already have an R2RML Script)
FINT R2RML Wizard
Option 2: Linked Data View Generator (for users who want an automatically generated mapping and ontology)
FINT Linked Data View Generator
Option 3: SQL Script

Chatting with our Knowledge Graph to confirm its creation

OPAL FINT Virtual KG Test

Querying Virtuoso

SPARQL Query Editor
Virtuoso SPARQL Query Editor
Authentication Demo

When logged in as demo, we can access the Virtual Named Graph after authenticating due to SELECT permissions having been granted in the setup script. Without having granted SELECT permissions on the underlying table, access will be denied:

SPARQL Query Editor Example
SPARQL Query Editor Authentication
cURL Example
demo-authentication-error-curl

This is a result of ACLs applied to the Virtuoso Authentication Layer (VAL). VAL is an open-standards-based, multi-protocol authentication layer, that provides fine-grained, attributed-based access controls (ABAC) for protected resources (HTTP-accessible documents, folders, services [via their endpoints], and SPARQL named graphs). In a nutshell, this solution uses logic, expressed in the form of entity relationships, to address issues such as identity, authorization, and restriction.

ACLs can be applied to physical and virtual data, in addition to limiting access and usage to applications and services.

SPASQL QB

SPARQL-within-SQL Example
SPASQL QB Example 1
  • Blue Links = Globally Resolvable
SQL Example
SPASQL QB Green Links

Example Queries Against the Physical Dataset:

1. List All Accounts and their Primary + Secondary Account Holders
2. List All Accounts and their Balances
List All Accounts With a Primary or Secondary Account Holder with a Risk Score over 80.

Using Third-Party Tools

Any ODBC-, JDBC-, or HTTP-compliant application can connect to Virtuoso.

NetworkX (HTTP, ODBC, JDBC)

In this example, we demonstrate how NetworkX can be used in Python to operate on data retrieved from Virtuoso using HTTP(S), ODBC, or JDBC connections. Virtuoso serves as the backend triplestore where RDF data is stored, and this data can be accessed programmatically from Python using SPARQL queries over HTTP(S) or through database connections via ODBC or JDBC. Once the data is retrieved, it is processed and converted into graph structures compatible with NetworkX, enabling users to perform complex network analysis, graph algorithms, and visualizations within the Python environment. This integration provides a powerful means of bridging semantic web data with Python’s analytical capabilities.

NetworkX Image
Excel

Data from Virtuoso can be queried from Excel using the Virtuoso ODBC Driver, allowing users to seamlessly access and work with semantic data directly within the familiar Excel environment. By establishing an ODBC connection, Excel can interact with the Virtuoso triplestore, enabling users to import, filter, and analyze RDF-based data without leaving the spreadsheet interface. This integration is especially useful for business analysts and data professionals who rely on Excel for reporting and data manipulation, as it brings the power of linked data into everyday workflows.

Excel Example
Tableau (ODBC or JDBC)

Data from Virtuoso can be queried by Tableau through the use of either an ODBC or JDBC driver, enabling direct integration between the two systems. By connecting Tableau to Virtuoso in this way, users can visualize and analyze RDF-based data stored in Virtuoso using Tableau’s powerful data exploration and dashboarding capabilities. This setup allows for real-time or scheduled access to semantic data, making it easier for business users and analysts to derive insights from complex datasets without needing to export or manually transform the data.

Tableau Example
Neo4j

Virtuoso content can be queried from Neo4j by leveraging Virtuoso’s JDBC Driver, which facilitates seamless connectivity between the two platforms. By using this driver, data stored within the Virtuoso triplestore can be accessed and integrated into Neo4j workflows, allowing for efficient querying and analysis across heterogeneous data sources. This approach enables developers and data analysts to bridge RDF-based semantic data in Virtuoso with property graph data in Neo4j, enhancing the ability to perform complex queries, data federation, and knowledge graph enrichment within a unified environment.

Neo4j Example
Example HTTP(s) consumer utilizing GraphQL

In this example, we demonstrate how GraphQL can be used in conjunction with an HTML-based Single Page Application (SPA) to operate on data retrieved from Virtuoso using SPARQL. The SPA serves as a dynamic front-end interface, while GraphQL acts as an intermediary layer that abstracts and simplifies access to the underlying RDF data. Data is initially queried from the Virtuoso triplestore using SPARQL, then exposed through a GraphQL API, which the SPA consumes to render interactive and responsive user experiences. This approach combines the flexibility of SPARQL with the developer-friendly querying capabilities of GraphQL, making it easier to build rich, data-driven web applications on top of semantic data.

GraphQL Example

Federated Queries

Creating a Knowledge Graph from Federated SQL RDBMS Tables (local, SQLServer, MySQL)
Federated SQL Example

Virtual and Physical RDF Views can be generated using the “Linked Data Views” feature, or using an R2RML script.

Storing the query as a SQL View
SQL
DROP TABLE demo.sql_federation.data;
CREATE VIEW demo.sql_federation.data AS
(
        SELECT 
          A.CustomerID, 
          A.CompanyName,
          B.OrderID, 
          C.EmployeeID, 
          C.LastName, 
          C.FirstName 
      FROM 
          "sqlserver"."northwind"."customers" A 
      NATURAL JOIN 
          "mysql5"."northwind"."orders" B 
      NATURAL JOIN    
          "Demo"."demo"."employees" C
);

GRANT SELECT ON demo.sql_federation.data TO SPARQL_SELECT;
Creating a Virtual Linked Data View
Creating a Virtual Linked Data View
Federated SPARQL Queries (SPARQL-FED)

List the Awards, past partners, and past/current spouses of Robert Downey Jr.

Attribute-based Access Control (ABAC) Example

In this example, access control is used to constrain access to a specific named graph such that, when users haven’t logged in via successful authentication, query solutions scoped to the graph return nothing. In other words, only authenticated users will receive query solutions from the protected named graph.

ACL Demo

Script used to implement ACL above

SQL
-- Cleanup

SPARQL CLEAR GRAPH <urn:fint:private>;

SPARQL 
DELETE WHERE
     {
          GRAPH <http://demo.openlinksw.com/acl/graph/rules/http%3A%2F%2Fwww.openlinksw.com%2Fontology%2Facl%23DefaultRealm> 
               {
                    <urn:fint:private:rule>  ?p ?o
               }
     } ;

-- Make Named Graph Private

DB.DBA.RDF_GRAPH_GROUP_INS ('http://www.openlinksw.com/schemas/virtrdf#PrivateGraphs', 'urn:fint:private');

-- Add an ACL

SPARQL
PREFIX  oplacl:  <http://www.openlinksw.com/ontology/acl#> 
PREFIX     acl:  <http://www.w3.org/ns/auth/acl#> 
INSERT INTO GRAPH <http://demo.openlinksw.com/acl/graph/rules/http%3A%2F%2Fwww.openlinksw.com%2Fontology%2Facl%23DefaultRealm> 
     {
          <urn:fint:private:rule>  a  acl:Authorization ;
                                   foaf:maker  <#dhm> ;
                         oplacl:hasAccessMode  oplacl:Read ;
                              acl:accessTo  <urn:fint:private> ;
                                   acl:agent  <http://demo.openlinksw.com/dataspace/person/demo#this>;
                              oplacl:hasScope  oplacl:PrivateGraphs ;
                              oplacl:hasRealm  oplacl:DefaultRealm .
     };

Benchmarks

Loading

Reasoning and Inference

Built-In Reasoning and Inference (RDFS, OWL)

Custom Reasoning and Inference (SPIN):

Public Instance Analysis