Skip to content

Commit 0256d07

Browse files
authored
Update KnowledgeGraph.php
1 parent 7463f4a commit 0256d07

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

includes/KnowledgeGraph.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* @author thomas-topway-it for KM-A
88
*/
99

10-
// use MediaWiki\Extension\KnowledgeGraph\Aliases\Category as CategoryClass;
11-
use MediaWiki\Extension\KnowledgeGraph\Aliases\Title as TitleClass;
10+
use MediaWiki\Category\Category;
1211
use MediaWiki\MediaWikiServices;
12+
use MediaWiki\Title\Title;
1313
use MediaWiki\Revision\SlotRecord;
1414
use SMW\MediaWiki\Specials\SearchByProperty\PageRequestOptions;
1515

@@ -255,15 +255,15 @@ public static function parserFunctionKnowledgeGraph( Parser $parser, ...$argv )
255255
// property-related options
256256
foreach ( $values as $val ) {
257257
if ( preg_match( '/^property-options(\?(.+))?=(.+)/', $val, $match ) ) {
258-
$title_ = TitleClass::makeTitleSafe( \SMW_NS_PROPERTY, $match[2] );
258+
$title_ = Title::makeTitleSafe( \SMW_NS_PROPERTY, $match[2] );
259259
if ( $title_ ) {
260260
$propertyOptions[$title_->getText()] = $match[3];
261261
}
262262
}
263263
}
264264

265265
foreach ( $params['nodes'] as $titleText ) {
266-
$title_ = TitleClass::newFromText( $titleText );
266+
$title_ = Title::newFromText( $titleText );
267267
if ( $title_ && $title_->isKnown() ) {
268268
if ( !isset( self::$data[$title_->getFullText()] ) ) {
269269
self::setSemanticDataFromApi( $title_, $params['properties'], 0, $params['depth'] );
@@ -274,7 +274,7 @@ public static function parserFunctionKnowledgeGraph( Parser $parser, ...$argv )
274274
$graphOptions = [];
275275
if ( !empty( $params['graph-options'] ) ) {
276276
// , NS_KNOWLEDGEGRAPH
277-
$title_ = TitleClass::newFromText( $params['graph-options'], NS_MEDIAWIKI );
277+
$title_ = Title::newFromText( $params['graph-options'], NS_MEDIAWIKI );
278278

279279
if ( $title_ && $title_->isKnown() ) {
280280
// $graphOptions = json_decode( self::getWikipageContent( $title_ ), true );
@@ -283,7 +283,7 @@ public static function parserFunctionKnowledgeGraph( Parser $parser, ...$argv )
283283
}
284284

285285
foreach ( $propertyOptions as $property => $titleText ) {
286-
$title_ = TitleClass::newFromText( $titleText, NS_MEDIAWIKI );
286+
$title_ = Title::newFromText( $titleText, NS_MEDIAWIKI );
287287
if ( $title_ && $title_->isKnown() ) {
288288
// $propertyOptions[$property] = json_decode( self::getWikipageContent( $title_ ), true );
289289
$propertyOptions[$property] = self::getWikipageContent( $title_ );
@@ -594,15 +594,15 @@ public static function articlesInCategories( $category, $limit, $offset ) {
594594
);
595595
$ret = [];
596596
foreach ( $res as $row ) {
597-
$title_ = TitleClass::newFromID( $row->pageid );
597+
$title_ = Title::newFromID( $row->pageid );
598598
if ( $title_ ) {
599599
$ret[] = $title_;
600600
}
601601
}
602602
return $ret;
603603

604604
// *** this does not work with numerical offset
605-
// $cat = CategoryClass::newFromName( str_replace( ' ', '_', $category ) );
605+
// $cat = Category::newFromName( str_replace( ' ', '_', $category ) );
606606
// $iterator_ = $cat->getMembers( $limit, $offset );
607607
// $ret = [];
608608
// while ( $iterator_->valid() ) {

0 commit comments

Comments
 (0)