MySQL to RDF Converter
Transform MySQL database dumps into RDF (Resource Description Framework) format for semantic web and linked data applications
MySQL Input
Convert MySQL to other formats
RDF Output
Convert other formats to RDF
Related Tools
MySQL to reStructuredText
Convert MySQL CREATE TABLE and INSERT statements to reStructuredText table format for Sphinx documentation
MySQL to Ruby
Convert MySQL CREATE TABLE and INSERT statements to Ruby arrays, hashes, and Struct objects for Rails applications
MySQL to SQL
Convert MySQL CREATE TABLE and INSERT statements to other SQL dialects (PostgreSQL, SQLite, SQL Server)
MySQL to Textile
Convert MySQL CREATE TABLE and INSERT statements to Textile markup format for Redmine and Textpattern
MySQL to TOML
Convert MySQL CREATE TABLE and INSERT statements to TOML configuration file format
MySQL to TracWiki
Convert MySQL CREATE TABLE and INSERT statements to TracWiki table markup format for Trac project management
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
- Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
- Choose RDF Format: Select Turtle, RDF/XML, or N-Triples
- Configure Base URI: Set the base URI for your RDF resources
- 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
FAQ
- Do I need both CREATE TABLE and INSERT statements? Including both is recommended so the tool can derive good property names and a complete set of rows, but it can also infer structure from INSERT-only dumps.
- Why are numeric values typed as xsd:decimal? Decimal is a safe, general numeric type for many use cases. You can post-process the RDF to adjust datatypes (for example, to xsd:integer or xsd:double) if your ontology requires it.
- What if a value is already a URL? Values that look like HTTP/HTTPS URLs are treated as resource IRIs instead of string literals, which is helpful when linking to external resources.
- Can I change the namespaces? Yes. After generation, you can update the
ex:prefix and base URIs to match your own vocabulary and dataset conventions. - Is my data uploaded anywhere? No. RDF generation is performed entirely client-side; your MySQL dump stays in your browser.
Privacy & Security
All conversions happen locally in your browser. Your MySQL data is never uploaded to any server, ensuring complete privacy and security.
