Manual:categoryChangesAsRdf.php
From Linux Web Expert
MediaWiki file: categoryChangesAsRdf.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.41.1 • 1.40.3 • 1.39.7 |
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 |
---|---|---|---|
--output | Output file. Will be overwritten. | <translate> Optional</translate> | stdout (console) |
--start | Starting timestamp (inclusive), in ISO or MediaWiki format | <translate> Required</translate> | |
--end | Ending timestamp (exclusive), in ISO or MediaWiki format | <translate> Required</translate> |
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 . }