Want to parse RDF file and save to MongoDB collection?
Try Withdata FileToMongo, a RDF to MongoDB converter for Windows, MacOS, and Linux, Import RDF to MongoDB, Easy and Fast.
- Can run in GUI mode, Step by Step, just a few mouse clicks.
- Can run in Command line, for Scheduled Tasks and Streams.
- Support all MongoDB deployment types: standalone, replica set, sharded cluster, and MongoDB Atlas.
Download Withdata FileToMongo
Windows 64 bit
Windows 32 bit
Linux .deb (For Debian, Ubuntu) 64 bit
Linux .rpm (For Red Hat, Fedora, SUSE) 64 bit
MacOS 64 bit
Import RDF file to MongoDB
Click “1 File To 1 Collection” at task dialog.
Select “Import File Type” with “XML”, and select “Source File From” with “File”.
1. Open RDF file.
2. Config target MongoDB collection.
3. Preview data will be in MongoDB collection.
4. Import.
See importing results in MongoDB collection
Import RDF to MongoDB in command line
Save “RDF to MongoDB” session, then you can:
- Convert RDF to MongoDB in Windows command line.
- Convert RDF to MongoDB in Linux command line.
- Convert RDF to MongoDB in macOS command line.
Set scheduled tasks for importing RDF to MongoDB
You can schedule and automate this “RDF to MongoDB” conversion task by:
- Save session and create .bat (Windows) or .sh (Linux/macOS) file for “RDF to MongoDB” conversion.
- Set scheduled task for “RDF to MongoDB” conversion.
More about Withdata FileToMongo – RDF to MongoDB Converter
Download Withdata FileToMongo
Windows 64 bit
Windows 32 bit
Linux .deb (For Debian, Ubuntu) 64 bit
Linux .rpm (For Red Hat, Fedora, SUSE) 64 bit
MacOS 64 bit
RDF → MongoDB reference
Type mapping
| Value kind | in RDF | in MongoDB |
|---|---|---|
| Int | "1234"^^xsd:int | NumberInt / int32 |
| Bigint | "9007199254740993"^^xsd:long | NumberLong / int64 |
| Decimal | "1234.56"^^xsd:decimal | Decimal128 |
| Float | "1.234e10"^^xsd:double | Double |
| Text | plain literal without a datatype | String |
| Long text | plain literal; newlines allowed inside | String |
| Date | "2026-09-18"^^xsd:date | ISODate |
| Datetime | "2026-09-18T14:30:00Z"^^xsd:dateTime | ISODate |
| Binary | "base64..."^^xsd:base64Binary | BinData |
| Boolean | "true"^^xsd:boolean | Bool |
| JSON | a literal, or reified as its own sub-graph | Embedded document or array |
Dialect differences
RDF is a file format and MongoDB 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 MongoDB |
|---|---|---|
| port | — | 27017 |
| identifiers | XML attribute quoting; entities for reserved characters | No identifier quoting - names are plain strings |
| row limit | — | .limit(n) / $limit aggregation stage |
| dates | xsd:dateTime typed literals | ISODate() / BSON date (millisecond epoch internally) |
| long text | — | String (BSON string, no length limit) |
| binary | xsd:base64Binary typed literals | BinData (BSON binary subtype) |
| 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 | Collections of documents with optional nesting |
| ceiling | Whole document is usually parsed into memory | — |
Command line
| Side | Command |
|---|---|
| MongoDB | mongoexport --collection=c --out=f.json |
| MongoDB (load) | mongoimport --collection=c --file=f.json |
FileToMongo without the manual work
For batch jobs, large files and scheduling use the FileToMongo converter — an offline desktop app for Windows, Linux and macOS. Free trial.
New to the format? Read what an RDF file is (and how it maps to rows and columns).