X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FCategoriesRdf.php;h=fc296d4c32469dbe6480f338cbbd0ae6f894b4dc;hb=cf2deaa7f40bd7333b1ca455bd611a56046a9d92;hp=463f6e846ba12ffd65c4ccc4904093a1aabd4606;hpb=58858df842f91d9ea1c9f9b6f3c767d8b204886b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/CategoriesRdf.php b/includes/CategoriesRdf.php index 463f6e846b..fc296d4c32 100644 --- a/includes/CategoriesRdf.php +++ b/includes/CategoriesRdf.php @@ -80,14 +80,23 @@ class CategoriesRdf { /** * Write out the data for single category. * @param string $categoryName Category name + * @param bool $isHidden Hidden category? + * @param int $pages Page count (note this includes only Wiki articles, not subcats or files) + * @param int $subcategories Subcategory count */ - public function writeCategoryData( $categoryName ) { + public function writeCategoryData( $categoryName, $isHidden, $pages, $subcategories ) { $title = Title::makeTitle( NS_CATEGORY, $categoryName ); $this->rdfWriter->about( $this->titleToUrl( $title ) ) ->say( 'a' ) ->is( self::ONTOLOGY_PREFIX, 'Category' ); + if ( $isHidden ) { + $this->rdfWriter->is( self::ONTOLOGY_PREFIX, 'HiddenCategory' ); + } $titletext = $title->getText(); $this->rdfWriter->say( 'rdfs', 'label' )->value( $titletext ); + $this->rdfWriter->say( self::ONTOLOGY_PREFIX, 'pages' )->value( $pages ); + $this->rdfWriter->say( self::ONTOLOGY_PREFIX, 'subcategories' )->value( $subcategories ); + // TODO: do we want files too here? Easy to add, but don't have use case so far. } /**