---
title: Convert Data From Multiple Tables To RDF Using The SQL Transformer
description: In our blog The fastest way to convert your data to RDF I went through the suite of DataLens ETL products and walked through using the...
image: https://lh6.googleusercontent.com/VFDeMg8iixZ2d8iK_agnA2c56Phk7FxFu1uDzvl1Rq1fdMr-is0PYvcUjpOZBzICid22F3Aqa6gbzaqj5I1fMdrkC8TfAE4p8W5ptMUb_RA9TKgcpJIGkpvI0LrV5rmLsBMUHppp0HXHe0wHNb0P9oI
---

[Skip to content](https://graph.build/blog/convert-data-from-multiple-tables-to-rdf-using-the-sql-lens#main)

[![graph.build](https://graph.build/hubfs/raw_assets/public/graphbuild-theme/images/logo-secondary-reverse.svg)](https://graph.build/)

Menu

- Platform
- AI context
  
  [Context for AI](https://graph.build/ai-context) [Semantic layer](https://graph.build/semantic-layer) [GraphRAG](https://graph.build/graphrag) [MCP & agent access](https://graph.build/mcp) [Ontologies explained](https://graph.build/resources/ontology)
- Resources
  
  [Blog](https://graph.build/blog) [Graph fundamentals](https://graph.build/resources) [Documentation](https://graph.build/documentation)
- Company
  
  [About us](https://graph.build/about) [Consulting](https://graph.build/consulting-services) [Contact](https://graph.build/contact)

[Book a demo](https://graph.build/enquire/book-a-demo)

Model

[Studio](https://graph.build/graph-build-studio) [Visual graph modelling](https://graph.build/graph-modelling-tool) [Ontologies & vocabularies](https://graph.build/platform-architecture#ontology)

Transform

[Transformers](https://graph.build/graph-build-transformers) [Knowledge graph ETL](https://graph.build/knowledge-graph-etl) [Change data capture](https://graph.build/graph-build-transformers#cdc)

Write

[Writers](https://graph.build/graph-build-writer) [Database compatibility](https://graph.build/graph-databases) [Deployment](https://graph.build/platform-architecture#deployment)

You are here

[The graph engineering lifecycle](https://graph.build/knowledge-graph-building)

Design, configure, engineer, iterate and automate graph model production: the whole lifecycle, without writing bespoke ingest code for each project.

Model

[Studio](https://graph.build/graph-build-studio) [Visual graph modelling](https://graph.build/graph-modelling-tool) [Ontologies & vocabularies](https://graph.build/platform-architecture#ontology)

Transform

[Transformers](https://graph.build/graph-build-transformers) [Knowledge graph ETL](https://graph.build/knowledge-graph-etl) [Change data capture](https://graph.build/graph-build-transformers#cdc)

Write

[Writers](https://graph.build/graph-build-writer) [Database compatibility](https://graph.build/graph-databases) [Deployment](https://graph.build/platform-architecture#deployment)

AI context

[Context for AI](https://graph.build/ai-context) [Semantic layer](https://graph.build/semantic-layer) [GraphRAG](https://graph.build/graphrag) [MCP & agent access](https://graph.build/mcp) [Ontologies explained](https://graph.build/resources/ontology)

Resources

[Blog](https://graph.build/blog) [Graph fundamentals](https://graph.build/resources) [Documentation](https://graph.build/documentation)

Company

[About us](https://graph.build/about) [Consulting](https://graph.build/consulting-services) [Contact](https://graph.build/contact) 

[Book a demo](https://graph.build/enquire/book-a-demo)

[← All posts](https://graph.build/blog)

# Convert Data From Multiple Tables To RDF Using The SQL Transformer

In our blog The fastest way to convert your data to RDF I went through the suite of DataLens ETL products and walked through using the...

![](https://graph.build/hubfs/DSC_0249.jpeg) Richard Loveday · Mar 1, 2023

![Graph Model](https://lh6.googleusercontent.com/VFDeMg8iixZ2d8iK_agnA2c56Phk7FxFu1uDzvl1Rq1fdMr-is0PYvcUjpOZBzICid22F3Aqa6gbzaqj5I1fMdrkC8TfAE4p8W5ptMUb_RA9TKgcpJIGkpvI0LrV5rmLsBMUHppp0HXHe0wHNb0P9oI)

In this blog I show how the [SQL Transformer](https://graph.build/graph-build-transformers) can use a SQL query to extract whatever data you want from a database (data lake, big data store, anything with a JDBC connector) to convert into [RDF](https://www.w3.org/RDF/).

The SQL Transformer allows users to ingest data from SQL Databases with ease. The Transformer is available as a docker image to be used wherever you wish in cloud or on premise.

The sample data is taken from 2 MySQL tables in a database. The first contains IMDB basic title information and the second contains user ratings information about the titles. The CSV file containing the data for the basic title info to be uploaded to your SQL database of choice can be found [here](https://graph.build/hubfs/Blog%20Sample%20Files/titles_basics_small.csv) and the ratings data [here](https://graph.build/hubfs/Blog%20Sample%20Files/titles_ratings_small%20(1).csv).

![](https://lh4.googleusercontent.com/qwvUVAiZXwSPXvVNk22LkSshhXlzsUecV84mhZ3UboD_WxIszMVa_LOw1oNElcjSu2rskC6r121ctDxwCF4CWHqFrRu2YjcnIWQQpEFyFTVxzXL0YchISMMm9xJLli_8K74iNzT8KwnHnbNSkQidzdY)

Basic Title Info

![](https://lh5.googleusercontent.com/9KrmAkyDLv1TbCxbK4Sy-14q99jnoKGE--lW5IkTcgDadgQiJ7lCyJ5ahbNb-UjF4MExuSQN_NAGqsGid5MJPzQxc7j-xmyYZuwjeas6Ye__dL4wH4NYgAwJ6iaJg3lG9UHmtV1HYRNk0fp1G757AXY)

Title Ratings Info

To help visualise the mapping between the source SQL and target RDF I have created a simple [Ontology](https://www.w3.org/standards/semanticweb/ontology). This is not a required step for the transformation but gives a document/diagram describing the RDF model that is helpful to discuss and share. [graph.build Studio](https://graph.build/graph-build-studio) creates models that replicate or replace your ontology. The source data here is relatively simple consisting of only one object class IMDB:Title with predicates linking to several data type properties I created this Ontology diagram in Lucid Chart:

![](https://lh3.googleusercontent.com/jNiMGaALLiqh8AhdC13HkFfCr5bed_qji9nAqXW2hN72Vey0Rub43ggfWVYZQG_uVqdhpzfZ5H2dfUtohvuXRbBb-wEAxJw3g4dl31faKYL2MD2RcdETLBHYeGQlvAu1f9ZRui8Y3mSt8mK4xhrcGsg)

Now I know how the data is going to be modelled I can move to the next part of the process which is the creation of the transformation.

The transformation of data is controlled by graph.build Studio. Starting from the first screen of the studio UI I need to connect to a SQL Transformer which will transforms the SQL data to RDF. I enter the Transformers URL and port to connect to it.

![](https://lh6.googleusercontent.com/3Jg791HnovyZ522gLnUWErbSpQOM17pww-BJRZWoXCZc9j3yhuTsCChL81cmeSOm5nRVCGw1wpjmlpaCH8fU0RM4u0Ozpdzs6a6eXxWoGLNmsNUzRM0Jl6VqIBXLUlBxobf60YATrG2Gg5ZI8mRm5ls)

select the graph type I am using which here is RDF

![](https://lh6.googleusercontent.com/tW0H_Jh2DjY0MBhkxeC2hCY_BykhbysdP_O488-BrvW36o6EAiq6zPLraRhBjtkF1CpSvYNk45SFjGjMnzFTBKPge5SSYeGz0oouj3bA2EDLzRmZ9Af5_cyqnvK7CRVOVZ_cHuJGRS5yRTWLKjc4jKI)

Add the prefixes I want to use

![](https://lh5.googleusercontent.com/otzGDBlQ9VOxzYf-I8Bnj9WUSilm7WwJoGZ5EpoE7m97gnMf_PXlU_3nyaPw3FoLuo6NLTGNvRG1PRc-UdgQg5GJ3s21oRm65fE4EKy_6Op2hc9r7vaaYOTOXcgpNk3zv6HruTMxzik0nj5q8HP1uoc)

Finally I add the connection details for the database I want to connect to and transform data from.

![](https://lh5.googleusercontent.com/kSYiLmf6BeBuoS1NAf7Wvn68jEvkvmtAoXYB0ndidtSqLpDO557mdsss3SXVJfgXcjzAU9I2TCRccEVdYrCmuxgxYfjASg4aYezs9WaznHEyowCsHuaALj8rhf0J-IIuKCHLIE1Wb5h-v2URVVXx85Q)

Now  I have entered the database credentials I am taken to the graph design section of the UI. 

![](https://lh3.googleusercontent.com/0hIVthgtaxiJUrfd8Jn-QLrVJ8JGHT-yYuGgl25AGgSp9mjj-Xs0UrGCu0yuZEcB8R9TsE-K_6032W1OC4GvAFWXlv4JSfjsFfnZYkw4zbOZvNGwyjpcygeiWH3_cYxnmTkQ53Mq_ivyo1fDGH-MpyI)

Here the input section is selected and contains three sections, query, query results and input blocks. First I need to enter a query to select the data I want to transform. The SQL query to use to retrieve data from the 2 tables is below. 

SELECT \*

FROM titles\_basics\_small left join titles\_ratings\_small

on titles\_basics\_small.tconst = titles\_ratings\_small.ratings\_tconst;

Once the query is  run I can view the data it returns in the Query Results section.

![](https://lh5.googleusercontent.com/1JXXuXdIc4hmHF80Wo_yqvYYOG-cg5EhI6eX-YJL2j1qX-18k3TU0e-r8AahC85SGBovRlfMMh6Cn3BZsp74hYZBcYdxF8_NH5R4bi-QHf9b3I91eu1wFwozxK4MiAfvDNMkRaIxjJedlG7_L5mFx1I)

The fields from the data are available as input blocks which can be dragged and dropped into the main mapping area of the UI to create graph entities or attributes.

![](https://lh4.googleusercontent.com/PLUIXo0nfX41KbSWsGW6GJgi9Rb51XkEO86KcO09yAS_fxMe-wuBzLoQmbRMw9uKhVjSKOLY2cEP1NnagFLB9Rz00Y_DXnNLZBtQB5vA3yKHKut89Qx3anx5DAhjIQ2z606K9_gcvyg-d8v9kXEW2AU)

Details on how to create graph diagrams through dragging and dropping components are contained in the  [blog creating a knowledge graph or any graph model without coding a step by step guide](https://graph.build/blog/creating-a-knowledge-graph-or-any-graph-model-without-coding-a-step-by-step-guide) and are also available in the [graph.build studio documentation](https://graph.build/documentation) .

Using the input blocks I can create a graph diagram that matches the ontology.

![](https://lh6.googleusercontent.com/VFDeMg8iixZ2d8iK_agnA2c56Phk7FxFu1uDzvl1Rq1fdMr-is0PYvcUjpOZBzICid22F3Aqa6gbzaqj5I1fMdrkC8TfAE4p8W5ptMUb_RA9TKgcpJIGkpvI0LrV5rmLsBMUHppp0HXHe0wHNb0P9oI)

Now the graph diagram is complete I can use “Generate Model” to create the configuration file the Transformer needs to convert the source data into RDF and “Test Model” to see a sample of the RDF that our model creates.

![](https://lh5.googleusercontent.com/RuLvoMK0d7ekQ69RTUVTxM5x59VPJnLfQpaRM0upZnQCaJoqPnt5KKlW6_MWGH2Z95go7Q40OQgeeQ1FU5eWqgKfKuhxPY3RBpfqiAbNKZeQM2iY8deLLGvyL3VKGQBsufx9pAxzz2-EmOV2QJ8nevs)

With the source data and a model, I can now use the Semi-Structured Transformer to generate RDF. The below diagram gives a basic overview of how the Semi-Structured Transformer works. The below diagram is using AWS S3 but any file system can be used.

![fastest way blog - SQL blog architecture](https://graph.build/hs-fs/hubfs/fastest%20way%20blog%20-%20SQL%20blog%20architecture.jpeg?width=645&height=496&name=fastest%20way%20blog%20-%20SQL%20blog%20architecture.jpeg)

To Execute a transformation from the studio I press the graph icon at the top right of the screen to bring up the Execution window

 

![76e75a72-9862-42c0-9d89-222250362fc7](https://graph.build/hs-fs/hubfs/76e75a72-9862-42c0-9d89-222250362fc7.png?width=277&height=68&name=76e75a72-9862-42c0-9d89-222250362fc7.png)

 

![Screenshot 2023-02-12 at 19.05.03-1](https://graph.build/hs-fs/hubfs/Screenshot%202023-02-12%20at%2019.05.03-1.png?width=999&height=396&name=Screenshot%202023-02-12%20at%2019.05.03-1.png)![](blob:https://data-lens.atlassian.net/731f971f-c2ec-4230-9fed-74675e76f3cc#media-blob-url=true&id=11f40fd9-1a77-41f5-bc69-ea5c06ea2d3c&collection=contentId-1756102657&contextId=1756102657&mimeType=image%2Fpng&name=Screenshot%202023-02-12%20at%2019.05.03.png&size=41488&width=999&height=396&alt=) 

 Once the Transformation has been executed a Success screen is returned with details of the transformation.

 

![Screenshot 2023-02-14 at 19.27.50](https://graph.build/hs-fs/hubfs/Blog%20Images/Screenshot%202023-02-14%20at%2019.27.50.png?width=1003&height=564&name=Screenshot%202023-02-14%20at%2019.27.50.png)

 

The screen details the location of the generated RDF, the number of iterations were used to process the data, the processing time of the transformation and the mapping file used. 

 

Written by Richard Loveday · Mar 1, 2023 

[All posts](https://graph.build/blog)

More from the blog

## Recently

### [![](https://graph.build/hubfs/gb3_hero_banner_final.webp) Studio Introducing Graph.Build Studio v3.2 Feb 11, 2026](https://graph.build/blog/introducing-graph-build-studio-v3-2)

### [![Graph Virtualization vs Materialization](https://graph.build/hubfs/unnamed%20(3).png) Knowledge Graph Resources Graph Virtualization vs Graph Materialization: Choosing the Right Approach for Your Data Feb 4, 2025](https://graph.build/blog/graph-virtualization-vs-graph-materialization)

### [![](https://graph.build/hubfs/unnamed%20(2).png) Studio Introducing the Latest Feature Release from Graph.Build Jan 27, 2025](https://graph.build/blog/introducing-v2.2)

Platform

[Studio](https://graph.build/graph-build-studio) [Transformers](https://graph.build/graph-build-transformers) [Writers](https://graph.build/graph-build-writer) [Database compatibility](https://graph.build/graph-databases) [Platform architecture](https://graph.build/platform-architecture)

AI context

[Context for AI](https://graph.build/ai-context) [Semantic layer](https://graph.build/semantic-layer) [GraphRAG](https://graph.build/graphrag) [MCP & agent access](https://graph.build/mcp) [Ontologies explained](https://graph.build/resources/ontology)

Resources

[Blog](https://graph.build/blog) [Graph fundamentals](https://graph.build/resources) [Choosing a graph database](https://graph.build/graph-databases) [How to build a knowledge graph](https://graph.build/knowledge-graph-building) [Documentation](https://graph.build/documentation)

Company

[About us](https://graph.build/about) [Consulting](https://graph.build/consulting-services) [Contact](https://graph.build/contact)

Legal

[Privacy policy](https://graph.build/privacy-policy)

Get in touch

No newsletter. If you want to talk about a model, or want to be kept posted, the contact form is the way in.

[Contact us](https://graph.build/contact)

- <https://www.linkedin.com/company/graphbuild>

 © 2026 Graph.Build · A trading name of Data Lens Labs Ltd, registered in England & Wales, company number 12483318 

[![graph.build](https://graph.build/hubfs/raw_assets/public/graphbuild-theme/images/logo-secondary-reverse.svg)](https://graph.build/)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Richard Loveday",
    "url" : "https://graph.build/blog/author/richard-loveday"
  },
  "dateModified" : "2023-03-13T21:37:43.003Z",
  "datePublished" : "2023-03-01T12:43:49.000Z",
  "headline" : "Convert Data From Multiple Tables To RDF Using The SQL Transformer",
  "image" : [ "https://lh6.googleusercontent.com/VFDeMg8iixZ2d8iK_agnA2c56Phk7FxFu1uDzvl1Rq1fdMr-is0PYvcUjpOZBzICid22F3Aqa6gbzaqj5I1fMdrkC8TfAE4p8W5ptMUb_RA9TKgcpJIGkpvI0LrV5rmLsBMUHppp0HXHe0wHNb0P9oI" ],
  "mainEntityOfPage" : {
    "@id" : "https://graph.build/blog/convert-data-from-multiple-tables-to-rdf-using-the-sql-lens",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://graph.build/hubfs/graph-build-logo-primary-1.svg"
    },
    "name" : "Graph.Build"
  }
}
```

```json
{
  "@context" : "http://schema.org",
  "@type" : "HowTo",
  "estimatedCost" : {
    "@type" : "MonetaryAmount",
    "currency" : "",
    "value" : ""
  },
  "image" : {
    "@type" : "ImageObject",
    "height" : "406",
    "url" : "https://lh6.googleusercontent.com/3Jg791HnovyZ522gLnUWErbSpQOM17pww-BJRZWoXCZc9j3yhuTsCChL81cmeSOm5nRVCGw1wpjmlpaCH8fU0RM4u0Ozpdzs6a6eXxWoGLNmsNUzRM0Jl6VqIBXLUlBxobf60YATrG2Gg5ZI8mRm5ls",
    "width" : "305"
  },
  "name" : "How To Convert Data From Multiple Tables To RDF",
  "step" : [ ],
  "supply" : [ ],
  "tool" : [ ],
  "totalTime" : "PT30M"
}
```