Manual:categoryChangesAsRdf.php

From mediawiki.org
This page is a translated version of the page Manual:CategoryChangesAsRdf.php and the translation is 75% complete.
Other languages:

詳細

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

オプション/引数

オプション 説明 必須かどうか 既定値
--output Output file. Will be overwritten. 省略可能 stdout (console)
--start Starting timestamp (inclusive), in ISO or MediaWiki format 必須
--end Ending timestamp (exclusive), in ISO or MediaWiki format 必須

使用法

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 .
}

関連項目