RDF2XML: Exporting RDF Data to XML (or to RDF)

The common export functionality of RDF data as RDF/XML (including the Striped RDF/XML variant) results in some RDF/XML serialization of a (base) graph. It does not allow to specify a target DTD structure, or to restruct to a graph fragment or certain properties. The RDF2XML tool allows a controlled export of RDF data: The method is as follows: Export of the graph is done by a controlled depth-first traversal. RDF2XML is experimental.

Common Usage:

RDF2XML as command line tool takes the following parameters:
java -jar rdf2xml.jar <input-rdf> <meta-rdf>
        <root node URI> <namespace uri>
        <striped-dtd-url> <stripped-dtd-url>
        [-of <output-file-name>]
Example: the example is based on the Mondial database. Sample calls:
java -jar ../rdf2xml.jar germany.n3 mondial-meta.n3
 http://www.semwebtech.org/mondial/10/countries/D/
 http://www.semwebtech.org/mondial/10/meta#
 file:mondial-striped.dtd [file:mondial-stripped.dtd]
 [-of bla.xml]

java -jar ../rdf2xml.jar mondial-europe.n3 export-germany.n3
 http://www.semwebtech.org/mondial/10/meta#relevantMondial
 http://www.semwebtech.org/mondial/10/meta#
 file:mondial-striped.dtd file:mondial-stripped.dtd
 -of bla.xml
(the latter may take some time - depending on the computer 1-3 hours. This is not specific to rdf2xml, but any application involving a reasoner and the rather large ABox of Mondial takes time)

Usage in MARS:

RDF2XML has been implemented mainly as it is needed in the MARS framework for transforming rules in RDF representation into XML markup (which can then be processed by the ECA engine). There, it is used as an embedded Java class. Nevertheless, for development and demos, there is a command line interface tailored to MARS (i.e., when using MARS languages that are listed with their DTDs in the LSR (Languages and Services Registry)). It works only when your computer has internet connection, as it must access the online LSR.
 java -jar rdf2xml.jar <rdf input filename> <root node URI> 
         [<startLangURI> [<stripedDTDURI> [<strippedDTDURI>]]]
Sample call
java -jar ../rdf2xml.jar <some-of-the-rdf-rule-files.rdf> foo://bla/theRule