Want to parse RDF file and save to SQLite ? Want to schedule and automate this importing task?
To import Xml format RDF file (.rdf, .owl) to SQLite, https://www.withdata.com/blog/rdftosqlite/sqlite-import-rdf.html
To import RDF Turtle file (.ttl, .n3) to SQLite, https://www.withdata.com/blog/rdftosqlite/ttl-to-sqlite.html
To import RDF N-Triples file (.nt, .ntriples) to SQLite, https://www.withdata.com/blog/rdftosqlite/n-triples-to-sqlite.html
To import RDF N-Quads file (.nq, .nquads) to SQLite, https://www.withdata.com/blog/rdftosqlite/n-quads-to-sqlite.html
RDF → SQLite reference
Type mapping
| Value kind | in RDF | in SQLite |
|---|---|---|
| Int | "1234"^^xsd:int | INTEGER |
| Bigint | "9007199254740993"^^xsd:long | INTEGER |
| Decimal | "1234.56"^^xsd:decimal | NUMERIC |
| Float | "1.234e10"^^xsd:double | REAL |
| Text | plain literal without a datatype | TEXT |
| Long text | plain literal; newlines allowed inside | TEXT |
| Date | "2026-09-18"^^xsd:date | TEXT |
| Datetime | "2026-09-18T14:30:00Z"^^xsd:dateTime | TEXT |
| Binary | "base64..."^^xsd:base64Binary | BLOB |
| Boolean | "true"^^xsd:boolean | INTEGER |
| JSON | a literal, or reified as its own sub-graph | TEXT |
Dialect differences
RDF is a file format and SQLite is a database server, so the target has to be told the types the file never carried - the rows below are where the two sides diverge.
| Property | in RDF | in SQLite |
|---|---|---|
| port | — | (file-based) |
| identifiers | XML attribute quoting; entities for reserved characters | "double quotes" or [brackets] |
| row limit | — | LIMIT n |
| dates | xsd:dateTime typed literals | TEXT (no date type) |
| long text | — | TEXT |
| binary | xsd:base64Binary typed literals | BLOB |
| separator | XML elements (rdf:Description / rdf:resource) | — |
| encoding | Declared in the XML declaration | — |
| typing | Every value is a resource or a typed literal | — |
| shape | Graph of triples; there are no rows or columns | Tables of rows and columns |
| ceiling | Whole document is usually parsed into memory | — |
Command line
| Side | Command |
|---|---|
| SQLite | sqlite3 .dump |
| SQLite (load) | .import (sqlite3) |
Convert your data online, free
Free in-browser converters for CSV, Excel, JSON, XML and SQL: Withdata Online Data Conversion. Large files, batch conversion or scheduling? See the offline desktop apps, or browse all data conversion tools.