Want to parse RDF file and save to MariaDB? Want to schedule and automate this importing task?
To import Xml format RDF file (.rdf, .owl) to MariaDB, https://www.withdata.com/blog/rdftomariadb/mariadb-import-rdf.html
To import RDF Turtle file (.ttl, .n3) to MariaDB, https://www.withdata.com/blog/rdftomariadb/ttl-to-mariadb.html
To import RDF N-Triples file (.nt, .ntriples) to MariaDB, https://www.withdata.com/blog/rdftomariadb/n-triples-to-mariadb.html
To import RDF N-Quads file (.nq, .nquads) to MariaDB, https://www.withdata.com/blog/rdftomariadb/n-quads-to-mariadb.html
RDF → MariaDB reference
Type mapping
| Value kind | in RDF | in MariaDB |
|---|---|---|
| Int | "1234"^^xsd:int | INT |
| Bigint | "9007199254740993"^^xsd:long | BIGINT |
| Decimal | "1234.56"^^xsd:decimal | DECIMAL(p,s) |
| Float | "1.234e10"^^xsd:double | DOUBLE |
| Text | plain literal without a datatype | VARCHAR(n) |
| Long text | plain literal; newlines allowed inside | LONGTEXT |
| Date | "2026-09-18"^^xsd:date | DATE |
| Datetime | "2026-09-18T14:30:00Z"^^xsd:dateTime | DATETIME |
| Binary | "base64..."^^xsd:base64Binary | LONGBLOB |
| Boolean | "true"^^xsd:boolean | TINYINT(1) |
| JSON | a literal, or reified as its own sub-graph | JSON |
Dialect differences
RDF is a file format and MariaDB 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 MariaDB |
|---|---|---|
| port | — | 3306 |
| identifiers | XML attribute quoting; entities for reserved characters | `backtick` |
| row limit | — | LIMIT n |
| dates | xsd:dateTime typed literals | DATETIME, TIMESTAMP, DATE, TIME |
| long text | — | TINYTEXT / TEXT / MEDIUMTEXT / LONGTEXT |
| binary | xsd:base64Binary typed literals | BLOB / TINYBLOB / LONGBLOB |
| 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 |
|---|---|
| MariaDB | mariadb-dump |
| MariaDB (load) | mariadb-import, or LOAD DATA INFILE |
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.