SQL to RDF Converter
Transform SQL database dumps into RDF (Resource Description Framework) format for semantic web, knowledge graphs, and linked data applications
SQL Input
RDF Output
About SQL to RDF Converter
Convert SQL database dumps (CREATE TABLE and INSERT statements) to RDF (Resource Description Framework) format with support for Turtle, RDF/XML, and N-Triples serializations. Perfect for semantic web applications, knowledge graphs, and linked data.
Key Features
- Multiple RDF Formats: Turtle (.ttl), RDF/XML (.rdf), N-Triples (.nt)
- Automatic Type Detection: Numeric values → xsd:decimal, URIs → resource references
- Custom Base URI: Configure the base URI for your RDF resources
- W3C Compliant: Generates valid RDF according to W3C standards
- Property Sanitization: Converts column names to valid RDF property names
- Smart Parsing: Extracts column names and data from SQL dumps
- File Download: Save as .ttl, .rdf, or .nt file
How to Use
- Input SQL Data: Paste your SQL CREATE TABLE and INSERT statements or upload a .sql file
- Select RDF Format: Choose between 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 Format Options
- Turtle (.ttl): Human-readable, compact syntax with prefixes
- RDF/XML (.rdf): XML-based format for maximum compatibility
- N-Triples (.nt): Simple line-based format, easy to parse
Example Conversion
SQL Input:
CREATE TABLE products ( id INT, name VARCHAR(100), price DECIMAL(10,2) ); INSERT INTO products VALUES (1, 'Laptop', 999.99); INSERT INTO products VALUES (2, 'Mouse', 24.99);
Turtle Output:
@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 "Laptop" ; ex:price "999.99"^^xsd:decimal . <http://example.org/data/record2> ex:id "2"^^xsd:decimal ; ex:name "Mouse" ; ex:price "24.99"^^xsd:decimal .
Common Use Cases
- Knowledge Graphs: Build semantic knowledge graphs from relational data
- Linked Data: Publish linked open data on the web
- Semantic Web: Create machine-readable data for AI applications
- Triple Stores: Import data into RDF databases (Virtuoso, Jena, Blazegraph)
- SPARQL Queries: Enable semantic queries on your data
- Data Integration: Integrate data from multiple sources
- Ontology Development: Create ontologies from database schemas
Type Detection
The converter automatically determines the appropriate RDF datatype:
- Numeric Values: Converted to xsd:decimal literals
- URIs: Values starting with http:// or https:// become resource references
- Strings: All other values become string literals
- NULL Values: Omitted from RDF output (no triple generated)
RDF Triple Stores
The generated RDF can be imported into:
- Apache Jena: Java-based RDF framework and triple store
- Virtuoso: High-performance RDF database
- Blazegraph: GPU-accelerated graph database
- GraphDB: Enterprise semantic graph database
- Stardog: Knowledge graph platform
- Amazon Neptune: Managed graph database service
Supported SQL Syntax
- CREATE TABLE: Extracts column names for RDF properties
- INSERT INTO: Parses data values for RDF triples
- Data Types: Handles all SQL data types (VARCHAR, INT, DECIMAL, etc.)
- Quoted Strings: Handles single and double quotes with proper escaping
- NULL Values: Skipped in RDF output
Privacy & Security
All conversions happen locally in your browser. Your SQL data is never uploaded to any server, ensuring complete privacy and security.
