This document is part of the D2RQ documentation.

dump-rdf: Dumping the database to an RDF file

The dump-rdf tool uses D2RQ to dump the contents of the whole database into a single RDF file. This can be done with or without a D2RQ mapping file. If a mapping file is specified, then the tool will use it to translate the database contents to RDF. If no mapping file is specified, then the tool will use the default mapping of generate-mapping for the translation.


dump-rdf [-f format] [-b baseURI] [-o outfile.ttl]
        [--verbose] [--debug]

The filename of a D2RQ mapping file that contains a database mapping.

If no mapping file is provided, then the database connection must be specified on the command line using the same connection parameters as for the generate-mapping tool, and a default mapping will be used.

-f format
The RDF syntax to use for output. Supported syntaxes are “TURTLE”, “RDF/XML”, “RDF/XML-ABBREV”, “N3”, and “N-TRIPLE” (the default). “N-TRIPLE” works best for large databases.
-b baseURI
The base URI for turning relative URIs and URI patterns into absolute URIs.
-o outfile
Name of the destination file. Defaults to standard output.
Print extra progress log information.
Print all debug log information.


Dump using a mapping file

dump-rdf -f N-TRIPLE -b http://localhost:2020/ mapping-iswc.ttl > iswc.nt

Dump with default mapping

dump-rdf -u root -f RDF/XML-ABBREV -o iswc-dump.rdf jdbc:mysql:///iswc

This dumps to RDF/XML format and writes the output to a file iswc-dump.rdf.

Converting a SQL dump to RDF using a temporary in-memory database

dump-rdf -l db_dump.sql -o output.nt