Jump to content

User:Reversedragon/LocalSettings.php: Difference between revisions

From Philosophical Research
link other namespace pages
link Properties list
Line 105: Line 105:
];
];
</pre>
</pre>
Allows sorting [[Philosophical Research:Properties/Numeric|Properties]] into sections, etc.

Revision as of 06:33, 21 January 2025

Info on namespace configuration (debug), etc. Not the entire LocalSettings.php, only the interesting parts.

Wikibase.example.php (unchanged)

call_user_func( function() {
	$baseNs = 120;

	define( 'WB_NS_ITEM', $baseNs );
	define( 'WB_NS_ITEM_TALK', $baseNs + 1 );
	define( 'WB_NS_PROPERTY', $baseNs + 2 );
	define( 'WB_NS_PROPERTY_TALK', $baseNs + 3 );
} );

LocalSettings.php

// Define constants for my additional namespaces.
define("NS_ITEM", 0);
define("NS_TEMPLATE", 10);
define("NS_PROPERTY", WB_NS_PROPERTY);
define("NS_LEXEME", 146);
define("NS_ONTOLOGY", 270);
define("NS_ONTOLOGY_TALK", 271);

// Combine talk pages
define("NS_ITEM_TALK", NS_ONTOLOGY_TALK);
define("NS_PROPERTY_TALK", NS_ONTOLOGY_TALK);
define("NS_LEXEME_TALK", NS_ONTOLOGY_TALK);
// define("NS_FILE_TALK", NS_HELP_TALK);
// define("NS_TEMPLATE_TALK", NS_HELP_TALK);

// Add namespaces.
$wgExtraNamespaces[NS_ONTOLOGY] = "Ontology";
$wgExtraNamespaces[NS_ONTOLOGY_TALK] = "Ontology_talk";

$wgNamespacesWithSubpages[NS_ONTOLOGY] = false;
$wgNamespacesWithSubpages[NS_ONTOLOGY_TALK] = true;

// $wgNamespaceContentModels[NS_ITEM] = "wikibase-item";
// $wgNamespaceContentModels[NS_LEXEME] = "wikibase-lexeme";

$wgContentNamespaces = [ NS_ITEM, NS_PROJECT, 12, NS_LEXEME, NS_ONTOLOGY ];  // Main, Philosophical Research, Help, Lexeme, Ontology
$wgNamespaceAliases = [ 'Q' => NS_ITEM, 'P' => NS_PROPERTY, 'L' => NS_LEXEME, 'T' => NS_TEMPLATE, 'ONT' => NS_ONTOLOGY ];

// Interwiki
$wgLocalInterwikis = [ 'r' ];
$wgLocalDatabases = [ 'research' ];
$wgWBRepoSettings['siteLinkGroups'] = [ 'research', 'wikidata' ];
$wgWBRepoSettings['localClientDatabases'] = [ 'r' => 'research', 'd' => 'wikidata' ];

$wgWBClientSettings['entitySources'] = [
	'research' => [
		'repoDatabase' => 'research',
		'baseUri' => 'https://research.moraleconomy.au/entity',
		'entityNamespaces' => [
			'item' => 0,
			'property' => 122,
		],
		'rdfNodeNamespacePrefix' => 'r',
		'rdfPredicateNamespacePrefix' => '',
		'interwikiPrefix' => 'r'
	],
	'wikidata' => [
		'repoDatabase' => 'wikidata',
		'baseUri' => 'http://www.wikidata.org/entity',
		'entityNamespaces' => [
			'item' => 0,
			'property' => 120,
		],
		'rdfNodeNamespacePrefix' => 'd',
		'rdfPredicateNamespacePrefix' => '',
		'interwikiPrefix' => 'd'
	]
];

// $wgWBClientSettings['otherProjectsLinks'] = [ 'research', 'wikidata' ];

$wgWBRepoSettings['formatterUrlProperty'] = 'P26';
// $wgWBRepoSettings['propertyOrderUrl'] = $wgServer. $wgScriptPath . '/index.php?title=MediaWiki:Wikibase-SortedProperties&action=raw&sp_ver=1';

$wgWBRepoSettings['statementSections'] = [
	'item' => [
		'statements' => null,
		'guide' => [
			'propertyIds' => [ 'P27' ],  'type' => 'propertySet'
		]
		'events' => [
			'propertyIds' => [ 'P9', 'P10', 'P11', 'P12', 'P17' ],  'type' => 'propertySet'
		],
		'components' => [
			'propertyIds' => [ 'P6' ],  'type' => 'propertySet'
		],
		'bibliography' => [
			'propertyIds' => [ 'P2' ],  'type' => 'propertySet'
		]
	],
	'property' => [
		'statements' => null,
		'guide' => [
			'propertyIds' => [ 'P27' ],  'type' => 'propertySet'
		]
    ]
];

Allows sorting Properties into sections, etc.