Help:Semantic RDF export
Semantic MediaWiki generates machine-readable documents that have their basis in the semantic annotations of articles. These documents, or RDF exports, are in OWL/RDF format and are accessible via the special page Special:ExportRDF. This article explains how annotations are formally interpreted in the OWL ontology language, and how a suitable RDF serialisation is generated.
Using the export functionality
The Special Page
Users can easily access the generated RDF via the page Special:ExportRDF by entering a list of articles into the input field. The export will contain one OWL/RDF specification with various description blocks for exported elements. In addition to the requested articles, the export will also contain basic declarations for any further elements (such as mentioned instances, properties, and classes).
The special page has two checkboxes that further influence the set of exported articles:
- Recursive export. Every article usually has relations to various other articles. Normally, those other articles are just declared briefly such that tools can find further RDF specifications for them if desired. If a user checks this box, all information about the encountered objects will be exported right away. This process continues for all further objects, so such an export can be quite large.
- Backlinks. The RDF data model is based on directed graphs. When exporting an article, one usually exports only the statements within which the corresponding element occurs as a subject, and the exported document does not include incoming links. This restricts RDF browsers, since they cannot access all elements that have some relationship to something without retrieving the whole RDF first. For this reason, one can enable the export of backlinks. All articles that have relations to any of the exported articles then will also be exported.
CreationWiki's administration has not, so far, chosen to restrict the availability of these two checkboxes. But the administration reserves the privilege to restrict the availability of the above options, and to set default values cases where no parameters can be given (see below). The above options, especially in combination, can easily lead to the export of major parts of the wiki in RDF. This could create a performance issue as this wiki grows.
In addition to the form at Special:ExportRDF, one can also retrieve RDF by calling appropriate URLs directly. This is suitable for linking to RDF specifications directly. In its basic form, this is achieved by appending a (URL encoded version of an) article name to the URL of the export service. For instance, to obtain the RDF export from our article on Noah, one can link to
to get that RDF directly. Alternatively, one can specify the article name as a GET parameter "page" within the URL, e.g.
Additional GET parameters
In addition to title and page, ExportRDF has additional GET (query string) parameters.
- Backlinks can be enabled or disabled by setting "backlinks" to 1 or 0, respectively.
- Recursive export can be enabled or disabled by setting "recursive" to 1 or 0.
Both settings will be ignored if the administration elects to disable them. If no settings are given, site-wide default values apply. CreationWiki has enabled backlinks by default.
The default Content-Type of ExportRDF's output is application/xml (with charset=UTF-8). Content-Type of application/rdf+xml can be set by adding the "xmlmime=rdf" GET parameter; some processing tools require this RDF mimetype to process the output.
Exporting all data
(For administrative and developmental use only)
In addition to the wiki's Special:ExportRDF function, there is also a maintenance script that allows you to export all of the wiki's semantic data at once. The script is called SMW_dumpRDF.php and can be found in SMW's maintenance directory. CreationWiki has this script installed.
The script SMW_dumpRDF.php can generate full exports, or it can be restricted to certain elements of the schema, e.g. to export only the category hierarchy or only the attributes with their types. Details are described in the script itself.
The script can easily be run automatically as a cronjob to generate RDF dumps on a regular basis. CreationWiki has not elected to run such a dump regularly.
The exported data in detail
All RDF exports from CreationWiki have an ontology header and body. The header contains "boilerplate" data-type definitions from the World Wide Web Consortium (W3C) and a date (in ISO-8601 format) for the creation of the export.
The body lists all categories, and then all properties with their values. Categories and page property values are listed as "RDF resources"; other property values are listed as "RDF datatypes". Every RDF resource uses the special page Special:URIResolver to produce direct links to the resources named.
The body then continues with explanations, in either the Category or Property namespaces, for all exported properties. In this manner, users of RDF export may know exactly what they are receiving.
This page is part of the CreationWiki Semantic MediaWiki Help series - prepared to assist editors in becoming productive members of the CreationWiki community. Browse the Table of Contents