MediaWiki file: categoryChangesAsRdf.php
Location: maintenance/
Source code: master 1.40.0 1.39.4 1.35.11
Classes: CategoryChangesAsRdf

Details

categoryChangesAsRdf.php is a maintenance script that provides RDF representation of the recent changes to the category tree.

Options/Arguments

Option Description Required Default value
--outputOutput file. Will be overwritten.Optionalstdout (console)
--startStarting timestamp (inclusive), in ISO or MediaWiki formatRequired
--endEnding timestamp (exclusive), in ISO or MediaWiki formatRequired

Usage

php maintenance/categoryChangesAsRdf.php [ --output| --start| --end ]

On standard console

Terminal
$ php maintenance/categoryChangesAsRdf.php --start "20211012000000" --end "20211126000000"

prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix mediawiki: <https://www.mediawiki.org/ontology#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix schema: <http://schema.org/>
prefix cc: <http://creativecommons.org/ns#>
# Restores
# Additions
INSERT DATA {

<https://mediawikiexampledomain.com/wiki/index.php/Category:A> a mediawiki:Category ;
	rdfs:label "A" ;
	mediawiki:pages "2"^^xsd:integer ;
	mediawiki:subcategories "0"^^xsd:integer .

<https://mediawikiexampledomain.com/wiki/index.php/Category:B> a mediawiki:Category ;
	rdfs:label "B" ;
	mediawiki:pages "1"^^xsd:integer ;
	mediawiki:subcategories "1"^^xsd:integer .

<https://mediawikiexampledomain.com/wiki/index.php/Category:AC> a mediawiki:Category ;
	rdfs:label "AC" ;
	mediawiki:pages "0"^^xsd:integer ;
	mediawiki:subcategories "1"^^xsd:integer .

<https://mediawikiexampledomain.com/wiki/index.php/Category:A> mediawiki:isInCategory <https://mediawikiexampledomain.com/wiki/index.php/Category:AC> .

<https://mediawikiexampledomain.com/wiki/index.php/Category:AC> mediawiki:isInCategory <https://mediawikiexampledomain.com/wiki/index.php/Category:B> .

};
DELETE {
  <https://mediawikiexampledomain.com/wiki/index.php/Special:CategoryDump> schema:dateModified ?o .
}
WHERE {
  <https://mediawikiexampledomain.com/wiki/index.php/Special:CategoryDump> schema:dateModified ?o .
};
INSERT DATA {
  <https://mediawikiexampledomain.com/wiki/index.php/Special:CategoryDump> schema:dateModified "2021-11-26T00:00:00Z"^^xsd:dateTime .
}

Saving output as file

Terminal
$ php maintenance/categoryChangesAsRdf.php --output a.result --start "20211012000000" --end "20211126000000"

$ cat a.result

prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix mediawiki: <https://www.mediawiki.org/ontology#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix schema: <http://schema.org/>
prefix cc: <http://creativecommons.org/ns#>
# Restores
# Additions
INSERT DATA {

<https://mediawikiexampledomain.com/wiki/index.php/Category:A> a mediawiki:Category ;
	rdfs:label "A" ;
	mediawiki:pages "2"^^xsd:integer ;
	mediawiki:subcategories "0"^^xsd:integer .

<https://mediawikiexampledomain.com/wiki/index.php/Category:B> a mediawiki:Category ;
	rdfs:label "B" ;
	mediawiki:pages "1"^^xsd:integer ;
	mediawiki:subcategories "1"^^xsd:integer .

<https://mediawikiexampledomain.com/wiki/index.php/Category:AC> a mediawiki:Category ;
	rdfs:label "AC" ;
	mediawiki:pages "0"^^xsd:integer ;
	mediawiki:subcategories "1"^^xsd:integer .

<https://mediawikiexampledomain.com/wiki/index.php/Category:A> mediawiki:isInCategory <https://mediawikiexampledomain.com/wiki/index.php/Category:AC> .

<https://mediawikiexampledomain.com/wiki/index.php/Category:AC> mediawiki:isInCategory <https://mediawikiexampledomain.com/wiki/index.php/Category:B> .

};
DELETE {
  <https://mediawikiexampledomain.com/wiki/index.php/Special:CategoryDump> schema:dateModified ?o .
}
WHERE {
  <https://mediawikiexampledomain.com/wiki/index.php/Special:CategoryDump> schema:dateModified ?o .
};
INSERT DATA {
  <https://mediawikiexampledomain.com/wiki/index.php/Special:CategoryDump> schema:dateModified "2021-11-26T00:00:00Z"^^xsd:dateTime .
}

See also

  • Manual:DumpCategoriesAsRdf.php
  • Manual:DumpBackup.php
  • Manual:DumpRev.php
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.