SMW Sandbox:Setup information

De Semantic MediaWiki - Sandbox

Révision datée du 15 avril 2018 à 20:57 par Kghbln (discussion | contributions) (form)

Welcome to the sandbox of the SMW project. It primarily allows to test features provided by Semantic MediaWiki as well as related semantic extensions. However a vast set of additional useful extensions is installed to provide a great testing experience in conjunction with Semantic MediaWiki.

This wiki is designed to always run on the latest release candidate or stable version of MediaWiki core as well as the installed extensions, except for most of the semantic extensions which run on master. This page shows some of the setup information. See also the update log for MediaWiki core on this wiki.

composer.local.json

{
    "require": {
        "elasticsearch/elasticsearch": "~6.0",
        "jeroen/mediawiki-github": "@dev",
        "mediawiki/bootstrap": "@dev",
        "mediawiki/bootstrap-components": "@dev",
        "mediawiki/chameleon-skin": "@dev",
        "mediawiki/graph-viz": "@dev",
        "mediawiki/lingo": "@dev",
        "mediawiki/mermaid": "@dev",
        "mediawiki/maps": "@dev",
        "mediawiki/page-forms": "~4",
        "mediawiki/parser-hooks": "@dev",
        "mediawiki/simple-batch-upload": "~1.0",
        "mediawiki/summary-cards": "@dev",
        "mediawiki/validator": "@dev",
        "mediawiki/whats-nearby": "@dev",
        "mediawiki/semantic-breadcrumb-links": "@dev",
        "mediawiki/semantic-cite": "@dev",
        "mediawiki/semantic-compound-queries": "@dev",
        "mediawiki/semantic-external-query-lookup": "@dev",
        "mediawiki/semantic-extra-special-properties": "@dev",
        "mediawiki/semantic-forms-select": "@dev",
        "mediawiki/semantic-glossary": "@dev",
        "mediawiki/semantic-interlanguage-links": "@dev",
        "mediawiki/semantic-media-wiki": "@dev",
        "mediawiki/semantic-meta-tags": "@dev",
        "mediawiki/semantic-notifications": "@dev",
        "mediawiki/semantic-result-formats": "@dev",
        "mediawiki/semantic-scribunto": "@dev",
        "mediawiki/semantic-watchlist": "@dev",
        "phpoffice/phpspreadsheet": "~1"
    },
    "extra": {
        "merge-plugin": {
            "include": [
                "extensions/Elastica/composer.json",
                "extensions/SyntaxHighlight_GeSHi/composer.json"
            ]
        }
    },
    "config": {
        "preferred-install": "source",
        "optimize-autoloader": true
    }
}

LocalSettings.php

Semantic extensions

$wgSearchType = 'SMWSearch';

## Semantic MediaWiki
// Composer
enableSemantics( $smwSemanticName );
$smwgDefaultStore = 'SMWElasticStore';
$smwgElasticsearchEndpoints = [
    [
        'host' => '217.197.83.171',
        'port' => 9200,
        'scheme' => 'http'
        ],
    'localhost:9200'
    ];
$smwgElasticsearchProfile = __DIR__ . '/elasticsearchprofile.json';
$smwgAdminFeatures = ( $smwgAdminFeatures & ~SMW_ADM_REFRESH );
$smwgNamespacesWithSemanticLinks[NS_EXTRA] = true;
$smwgPageSpecialProperties = array_merge(
    $smwgPageSpecialProperties, [
        '_CDAT',
        '_NEWP',
        '_LEDT',
        '_MEDIA',
        '_MIME'
        ]
    );
$smwgFixedProperties = [
    'Has_text_fixed',
    'Has_page_fixed'
    ];
$smwgQDefaultLimit = 200;
$smwgQMaxLimit = 1000;
$smwgQMaxInlineLimit = 1000;
$smwgPropertyZeroCountDisplay = false;
$smwgPropertyLowUsageThreshold = 3;
$smwgQueryProfiler = SMW_QPRFL_DUR | SMW_QPRFL_PARAMS;
$smwgQueryResultCacheType = CACHE_ANYTHING;
$smwgQFilterDuplicates = true;
$smwgEnabledQueryDependencyLinksStore = true;
$smwgQueryDependencyAffiliatePropertyDetectionList = [
    '_DTITLE'
    ];
$smwgEnabledHttpDeferredJobRequest = SMW_HTTP_DEFERRED_SYNC_JOB;
$smwgDVFeatures = $smwgDVFeatures | SMW_DV_PVUC;
$smwgFieldTypeFeatures = SMW_FIELDT_CHAR_NOCASE | SMW_FIELDT_CHAR_LONG;
$smwgEnabledFulltextSearch = true;
$smwgEditProtectionRight = 'smw-pageedit';
$smwgParserFeatures = ( $smwgParserFeatures & SMW_PARSER_UNSTRIP & SMW_PARSER_LINV );
$smwgPropertyReservedNameList = array_merge(
    $smwgPropertyReservedNameList, [
        'Code',
        'smw-property-reserved-code'
        ]
    );
$smwgJobQueueWatchlist = [
    'SMW\UpdateJob',
    'SMW\ParserCachePurgeJob',
    'SMW\FulltextSearchTableUpdateJob',
    'SMW\ChangePropagationUpdateJob'
    ];
$smwgDefaultLoggerRole = 'developer';

## Semantic Breadcrumb Links
// Composer

## Semantic Cite
// Composer

## Semantic Compound Queries
// Composer

## Semantic Drilldown
// https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/2944
// $sdgNamespaceIndex = 112;
// require 'extensions/SemanticDrilldown/SemanticDrilldown.php';
// $sdgShowCategoriesAsTabs = true;

## Semantic External Query Lookup
// Composer
$smwgQuerySources = [
	'smworg' => 'SMWExternalQueryLookup',
	];
$seqlgExternalRepositoryEndpoints = [
	'smworg' => [
		'https://www.semantic-mediawiki.org/w/index.php/$1',
		'https://www.semantic-mediawiki.org/w/api.php',
		true
		]
	];

## Semantic Extra Special Properties
wfLoadExtension( 'SemanticExtraSpecialProperties' );
$sespSpecialProperties = [
    '_CUSER',
    '_EUSER',
    '_EXIFDATA',
    '_NREV',
    '_NTREV',
    '_PAGEID',
    '_PAGELGTH',
    '_REVID',
    '_SUBP',
    '_USERBLOCK',
    '_USEREDITCNT',
    '_USERGROUP',
    '_USERREG',
    '_USERRIGHT',
    '_VIEWS'
    ];
$sespUseAsFixedTables = true;
$wgSESPExcludeBots = true;

## Semantic Forms Select
wfLoadExtension( 'SemanticFormsSelect' );

## Semantic Glossary
wfLoadExtension( 'SemanticGlossary' );
$wgexLingoPage = 'Glossaire';
$wgexLingoUseNamespaces[NS_SPECIAL] = false;

## Semantic Image Annotator
wfLoadExtension( 'SemanticImageAnnotator' );

## Semantic Interlanguage Links
// Composer

## Semantic Meta Tags
// Composer
$smtgTagsProperties = [
	'keywords' => 'Meta element keywords',
	'description' => 'Meta element description'
	];
$smtgTagsStrings = [
	'og:site_name' => 'Semantic MediaWiki - Sandbox',
	'og:image' => 'https://sandbox.semantic-mediawiki.org/w/SMWSandBoxLogo.png',
	'og:image:type' => 'image/png',
	'og:image:width' => '142',
	'og:image:height' => '142'
	];

## Semantic Notifications
// Composer

## Semantic Rating
wfLoadExtension( 'SemanticRating' );

## Semantic Result Formats
// Composer
$srfgFirstDayOfWeek = 'Monday';
$srfgFormats = array_merge(
	$srfgFormats, [
		'filtered',
		'process',
		'graph',
		'incoming'
		]
	);

## Semantic Scribunto
// Composer

## Semantic Text Annotator
wfLoadExtension( 'SemanticTextAnnotator' );

## Semantic Watchlist
// Composer

Selected other extensions

## GitHub
// Composer
$egGitHubDefaultRepo = 'SemanticMediaWiki/SemanticMediaWiki';
$egGitHubRepositoryWhitelist = [
    'JeroenDeDauw/GitHub',
    'JeroenDeDauw/Maps',
    'JeroenDeDauw/ParserHooks',
    'JeroenDeDauw/Validator',
    'oetterer/BootstrapComponents',
    'SemanticMediaWiki/SemanticBreadcrumbLinks',
    'SemanticMediaWiki/SemanticCite',
    'SemanticMediaWiki/SemanticCompoundQueries',
    'SemanticMediaWiki/SemanticExternalQueryLookup',
    'SemanticMediaWiki/SemanticExtraSpecialProperties',
    'SemanticMediaWiki/SemanticFormsSelect',
    'SemanticMediaWiki/SemanticGlossary',
    'SemanticMediaWiki/SemanticInterlanguageLinks',
    'SemanticMediaWiki/SemanticMediaWiki',
    'SemanticMediaWiki/SemanticMetaTags',
    'SemanticMediaWiki/SemanticNotifications',
    'SemanticMediaWiki/SemanticResultFormats',
    'SemanticMediaWiki/SemanticScribunto',
    'SemanticMediaWiki/SemanticSignup',
    'SemanticMediaWiki/SemanticWatchlist',
    'SemanticMediaWiki/SummaryCards',
    'SemanticMediaWiki/WhatsNearby'
    ];
$egGitHubCache = 'full';
$egGitHubCacheTime = 1200;

## Maps
// Composer
$egMapsEnableCategory = true;
$egMapsGMaps3ApiKey = '??????????????????_????????????????????'; // obfuscated

## Page Forms
wfLoadExtension( 'PageForms' );
$wgPageForms24HourTime = true;
$wgPageFormsRenameEditTabs = true;
$wgPageFormsRedLinksCheckOnlyLocalProps = true;
$wgPageFormsAutocompleteOnAllChars = true;
$wgPageFormsAutoCreateUser = 'AutoCreateBot';

## Summary Card
// Composer
$sucgBackendParserCacheType = CACHE_MEMCACHED;
$sucgEnabledNamespaceWithTemplate = [
	NS_MAIN => 'SimpleSummaryCard',
	NS_HELP => 'SimpleSummaryCard',
	NS_FILE => 'SimpleSummaryCard',
	SMW_NS_PROPERTY => 'SimpleSummaryCard',
	];

## WhatsNearby
// Composer

Exception and event logging

### Exception settings

## Show exceptions
$wgShowExceptionDetails = true;
$wgShowSQLErrors = true;
$wgShowDBErrorBacktrace = true;

## Exception and event logging
$wgDebugLogGroups  = [
	'authentication' => "/var/log/mediawiki/{$wgDBname}-debug-authentication.log",
	'error' => "/var/log/mediawiki/{$wgDBname}-debug-error.log",
	'exception' => "/var/log/mediawiki/{$wgDBname}-debug-exception.log",
	'resourceloader' => "/var/log/mediawiki/{$wgDBname}-debug-resourceloader.log",
	'smw' => "/var/log/mediawiki/{$wgDBname}-debug-smw.log"
	];

elasticsearchprofile.json

{
        "settings": {
                "data": {
                        "index.mapping.total_fields.limit": 9000
                }
        },
        "indexer": {
                "raw.text": true,
                "experimental.file.ingest": true
        },
        "query": {
                "special_search.highlight.fragment.type": "unified",
                "uri.field.case.insensitive": true,
                "debug.explain": true
        }
}
Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.