MySQL to RDF Converter

Transform MySQL database dumps into RDF (Resource Description Framework) format for semantic web and linked data applications

MySQL Input

RDF Output

About MySQL to RDF Converter

Convert MySQL database dumps (CREATE TABLE and INSERT statements) to RDF (Resource Description Framework) format for semantic web applications, knowledge graphs, and linked data. RDF is a W3C standard for representing information about resources on the web.

Key Features

  • Multiple RDF Formats: Turtle (.ttl), RDF/XML (.rdf), and N-Triples (.nt)
  • Automatic Type Detection: Detects numeric values and URIs for proper RDF typing
  • Custom Base URI: Configure the base URI for your RDF resources
  • Property Sanitization: Converts MySQL column names to valid RDF property names
  • W3C Compliant: Generates standards-compliant RDF output
  • Smart Parsing: Extracts column names and data from MySQL dumps
  • File Download: Save as .ttl, .rdf, or .nt files

How to Use

  1. Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
  2. Choose RDF Format: Select Turtle, RDF/XML, or N-Triples
  3. Configure Base URI: Set the base URI for your RDF resources
  4. Copy or Download: Use the Copy or Download button to save your RDF data

RDF Formats

  • Turtle (.ttl): Human-readable, compact syntax with prefixes
  • RDF/XML (.rdf): XML-based format, widely supported
  • N-Triples (.nt): Simple line-based format, easy to parse

Example Conversion

MySQL Input:

CREATE TABLE employees (
  id INT,
  name VARCHAR(100),
  age INT,
  city VARCHAR(50)
);

INSERT INTO employees VALUES (1, 'John Doe', 28, 'New York');
INSERT INTO employees VALUES (2, 'Jane Smith', 34, 'London');

RDF Output (Turtle):

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ex: <http://example.org/vocab/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://example.org/data/record1>
  ex:id "1"^^xsd:decimal ;
  ex:name "John Doe" ;
  ex:age "28"^^xsd:decimal ;
  ex:city "New York" .

<http://example.org/data/record2>
  ex:id "2"^^xsd:decimal ;
  ex:name "Jane Smith" ;
  ex:age "34"^^xsd:decimal ;
  ex:city "London" .

Common Use Cases

  • Knowledge Graphs: Build semantic knowledge graphs from relational data
  • Linked Data: Publish database content as linked open data
  • Semantic Web: Integrate MySQL data with semantic web applications
  • Triple Stores: Import MySQL data into RDF triple stores (Apache Jena, Virtuoso, GraphDB)
  • SPARQL Queries: Enable SPARQL querying of MySQL data
  • Data Integration: Combine data from multiple sources using RDF

Type Detection

  • Numeric Values: Automatically typed as xsd:decimal
  • URIs: Detected and represented as resource references
  • Strings: Represented as literal values

RDF Tools & Applications

The generated RDF can be used with:

  • Apache Jena: Java framework for building semantic web applications
  • Virtuoso: High-performance RDF database
  • GraphDB: Enterprise-ready semantic graph database
  • Protégé: Ontology editor and knowledge management system
  • SPARQL Endpoints: Query RDF data using SPARQL query language

Supported MySQL Syntax

  • CREATE TABLE: Extracts column names for RDF properties
  • INSERT INTO: Parses data values from INSERT statements
  • Data Types: Handles all MySQL data types (VARCHAR, INT, DECIMAL, etc.)
  • Quoted Strings: Handles single and double quotes with proper escaping

Privacy & Security

All conversions happen locally in your browser. Your MySQL data is never uploaded to any server, ensuring complete privacy and security.