Jump to content
MediaWiki

Manual:categoryChangesAsRdf.php

From mediawiki.org
Languages:
MediaWiki file: categoryChangesAsRdf.php
Location: maintenance/
Source code: master1.45.11.44.31.43.6
Classes: CategoryChangesAsRdf

Details

[edit ]

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

Options/Arguments

[edit ]
Option Description Required? Default value
--output Output file. Will be overwritten. Optional stdout (console)
--start Starting timestamp (inclusive), in ISO or MediaWiki format Required
--end Ending timestamp (exclusive), in ISO or MediaWiki format Required


Usage

[edit ]
phpmaintenance/run.phpcategoryChangesAsRdf[--output|--start|--end]
In MediaWiki version 1.43.6 and earlier, you must invoke maintenance scripts using php maintenance/scriptName.php instead of php maintenance/run.php scriptName.

On standard console

[edit ]
Terminal
$ php maintenance/run.php categoryChangesAsRdf --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://example.com/wiki/index.php/Category:A> a mediawiki:Category ;
	rdfs:label "A" ;
	mediawiki:pages "2"^^xsd:integer ;
	mediawiki:subcategories "0"^^xsd:integer .
<https://example.com/wiki/index.php/Category:B> a mediawiki:Category ;
	rdfs:label "B" ;
	mediawiki:pages "1"^^xsd:integer ;
	mediawiki:subcategories "1"^^xsd:integer .
<https://example.com/wiki/index.php/Category:AC> a mediawiki:Category ;
	rdfs:label "AC" ;
	mediawiki:pages "0"^^xsd:integer ;
	mediawiki:subcategories "1"^^xsd:integer .
<https://example.com/wiki/index.php/Category:A> mediawiki:isInCategory <https://example.com/wiki/index.php/Category:AC> .
<https://example.com/wiki/index.php/Category:AC> mediawiki:isInCategory <https://example.com/wiki/index.php/Category:B> .
};
DELETE {
 <https://example.com/wiki/index.php/Special:CategoryDump> schema:dateModified ?o .
}
WHERE {
 <https://example.com/wiki/index.php/Special:CategoryDump> schema:dateModified ?o .
};
INSERT DATA {
 <https://example.com/wiki/index.php/Special:CategoryDump> schema:dateModified "2021-11-26T00:00:00Z"^^xsd:dateTime .
}

Saving output as file

[edit ]
Terminal
$ php maintenance/run.php categoryChangesAsRdf --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://example.com/wiki/index.php/Category:A> a mediawiki:Category ;
	rdfs:label "A" ;
	mediawiki:pages "2"^^xsd:integer ;
	mediawiki:subcategories "0"^^xsd:integer .
<https://example.com/wiki/index.php/Category:B> a mediawiki:Category ;
	rdfs:label "B" ;
	mediawiki:pages "1"^^xsd:integer ;
	mediawiki:subcategories "1"^^xsd:integer .
<https://example.com/wiki/index.php/Category:AC> a mediawiki:Category ;
	rdfs:label "AC" ;
	mediawiki:pages "0"^^xsd:integer ;
	mediawiki:subcategories "1"^^xsd:integer .
<https://example.com/wiki/index.php/Category:A> mediawiki:isInCategory <https://example.com/wiki/index.php/Category:AC> .
<https://example.com/wiki/index.php/Category:AC> mediawiki:isInCategory <https://example.com/wiki/index.php/Category:B> .
};
DELETE {
 <https://example.com/wiki/index.php/Special:CategoryDump> schema:dateModified ?o .
}
WHERE {
 <https://example.com/wiki/index.php/Special:CategoryDump> schema:dateModified ?o .
};
INSERT DATA {
 <https://example.com/wiki/index.php/Special:CategoryDump> schema:dateModified "2021-11-26T00:00:00Z"^^xsd:dateTime .
}

See also

[edit ]

AltStyle によって変換されたページ (->オリジナル) /