MediaWiki REL1_35
|
Helper class to produce RDF representation of categories. More...
Public Member Functions | |
__construct (RdfWriter $writer) | |
getDumpURI () | |
Get URI of the dump for this particular wiki. | |
labelToUrl ( $titleLabel) | |
Make URL from title label. | |
setupPrefixes () | |
Setup prefixes relevant for the dump. | |
writeCategoryData ( $categoryName, $isHidden, $pages, $subcategories) | |
Write out the data for single category. | |
writeCategoryLinkData ( $fromName, $toName) | |
Write RDF data for link between categories. | |
Public Attributes | |
const | FORMAT_VERSION = "1.1" |
Current version of the dump format. | |
const | OWL_URL = 'https://www.mediawiki.org/ontology/ontology.owl' |
OWL description of the ontology. | |
Private Member Functions | |
titleToUrl (Title $title) | |
Convert Title to link to target page. | |
Private Attributes | |
RdfWriter | $rdfWriter |
const | ONTOLOGY_PREFIX = 'mediawiki' |
Prefix used for Mediawiki ontology in the dump. | |
const | ONTOLOGY_URL = 'https://www.mediawiki.org/ontology#' |
Base URL for Mediawiki ontology. | |
const | SPECIAL_DUMP = 'Special:CategoryDump' |
Special page for Dump identification. | |
Helper class to produce RDF representation of categories.
Definition at line 24 of file CategoriesRdf.php.
CategoriesRdf::__construct | ( | RdfWriter | $writer | ) |
Definition at line 52 of file CategoriesRdf.php.
CategoriesRdf::getDumpURI | ( | ) |
Get URI of the dump for this particular wiki.
Definition at line 128 of file CategoriesRdf.php.
References NS_MAIN, and titleToUrl().
CategoriesRdf::labelToUrl | ( | $titleLabel | ) |
Make URL from title label.
string | $titleLabel | Short label (without namespace) of the category |
Definition at line 111 of file CategoriesRdf.php.
References NS_CATEGORY, and titleToUrl().
CategoriesRdf::setupPrefixes | ( | ) |
Setup prefixes relevant for the dump.
Definition at line 59 of file CategoriesRdf.php.
|
private |
Convert Title to link to target page.
Title | $title |
Definition at line 120 of file CategoriesRdf.php.
References $title, and PROTO_CANONICAL.
Referenced by getDumpURI(), labelToUrl(), writeCategoryData(), and writeCategoryLinkData().
CategoriesRdf::writeCategoryData | ( | $categoryName, | |
$isHidden, | |||
$pages, | |||
$subcategories | |||
) |
Write out the data for single category.
string | $categoryName | Category name |
bool | $isHidden | Hidden category? |
int | $pages | Page count (note this includes only Wiki articles, not subcats or files) |
int | $subcategories | Subcategory count |
Definition at line 87 of file CategoriesRdf.php.
References $title, NS_CATEGORY, and titleToUrl().
CategoriesRdf::writeCategoryLinkData | ( | $fromName, | |
$toName | |||
) |
Write RDF data for link between categories.
string | $fromName | Child category name |
string | $toName | Parent category name |
Definition at line 72 of file CategoriesRdf.php.
References NS_CATEGORY, and titleToUrl().
|
private |
Definition at line 50 of file CategoriesRdf.php.
const CategoriesRdf::FORMAT_VERSION = "1.1" |
Current version of the dump format.
Definition at line 40 of file CategoriesRdf.php.
Referenced by DumpCategoriesAsRdf\addDumpHeader().
|
private |
Prefix used for Mediawiki ontology in the dump.
Definition at line 28 of file CategoriesRdf.php.
|
private |
Base URL for Mediawiki ontology.
Definition at line 32 of file CategoriesRdf.php.
const CategoriesRdf::OWL_URL = 'https://www.mediawiki.org/ontology/ontology.owl' |
OWL description of the ontology.
Definition at line 36 of file CategoriesRdf.php.
Referenced by DumpCategoriesAsRdf\addDumpHeader().
|
private |
Special page for Dump identification.
Used as head URI for each wiki's category dump, e.g.: https://en.wikipedia.org/wiki/Special:CategoryDump
Definition at line 46 of file CategoriesRdf.php.