Help:Maintenance script "dumpRDF.php"

From semantic-mediawiki.org
Jump to: navigation, search
dump­RDF.php
Allows to do an RDF export of existing triples
Further Information
Provided by: Semantic MediaWiki
Added: 2.0.0
Removed: still in use
Location (path): ./extensions/Semantic­MediaWiki/maintenance/
Table of Contents

The "dumpRDF.php" maintenance script allows to export RDF triples.

This maintenance script deprecated the former "SMW_dumpRDF.php" script starting with Semantic MediaWiki 2.0.0Released on 4 August 2014 and compatible with MW 1.19.0 - 1.24.x. while options and usage at that time remain the same. It is strongly encouraged to make the transition to this new script to take advantage of the new features added since and because the old one will will be removed with the release of Semantic MediaWiki 3.0.0Released on an unknown date and compatible with MW 1.27.0 - 1.30.x. in early 2018.

Usage

php dumpRDF.php [--file|--categories|--classes|--concepts|--types|--individuals|--page|--properties|--d|--e]
NoteNote: This only shows the script specific parameters.

Parameters

Generic parameters

Parameter Description
--help (-h) Display this help message
--quiet (-q) Whether to supress non-error output
--conf: Location of "LocalSettings.php", if not default
--wiki For specifying the wiki ID
--globals Output globals at the end of processing for debugging
--memory-limit Set a specific memory limit for the script, "max" for no limit or "default" to avoid changing it
--server: The protocol and server name to use in URLs, e.g. https://www.semantic-mediawiki.org. This is sometimes necessary because server name detection may fail in command line scripts.

Script dependant parameters

Parameter Description
--dbuser The DB user to use for this script
--dbpass The password to use for this script

Script specific parameters

Parameter Description
--file (-o) <filename> Export into output file, stdout is used if omitted; file output is generally better and strongly recommended for large wikis.
--categories Export only categories.
--concepts Export only Concepts.
--classes Export only concepts and categories.
--properties Export only properties.
--types Export only data types.
--individuals Export only pages that are no categories, properties, or types.
--page <pagelist> being used as a separator. Options -e, -file, -d are ignored if --page is given. Available since Semantic MediaWiki 2.1.0Released on 19 January 2015 and compatible with MW 1.19.0 - 1.24.x..1
-d <delay> Wait for this many milliseconds after processing an article. Useful for limiting server load.
-e <each> Retire after the given number of exported entities.


If Semantic MediaWiki is not installed in its standard path then the "MW_INSTALL_PATH" environment variable must be set. See README in the maintenance directory.

Examples

The following command exports all pages into the given file with a delay of 50 ms between every exported item.
php dumpRDF.php --file MyWiki.rdf -d 50
The following command exports the pages "Page 1", "Page 2" and "Page 3".
php dumpRDF.php --page "Page 1|Page 2|Page 3"

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:620