Différences entre les versions de « SMW Sandbox:Setup information »

De Semantic MediaWiki - Sandbox

(→‎Semantic extensions : 2018-03-31)
Balise : Éditeur de wikicode 2017
 
(96 versions intermédiaires par le même utilisateur non affichées)
Ligne 3 : Ligne 3 :
 
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 [[SMW Sandbox:Computer room|update log for MediaWiki core]] on this wiki.
 
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 [[SMW Sandbox:Computer room|update log for MediaWiki core]] on this wiki.
 
__TOC__
 
__TOC__
 +
{{Clear}}
 
== composer.local.json ==
 
== composer.local.json ==
  
 
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
 
{
 
{
 +
"minimum-stability": "dev",
 
"require": {
 
"require": {
 
"elasticsearch/elasticsearch": "~6.0",
 
"elasticsearch/elasticsearch": "~6.0",
"mediawiki/bootstrap": "@dev",
+
"jeroen/mediawiki-github": "@dev",
 
"mediawiki/bootstrap-components": "@dev",
 
"mediawiki/bootstrap-components": "@dev",
 
"mediawiki/chameleon-skin": "@dev",
 
"mediawiki/chameleon-skin": "@dev",
 +
"mediawiki/font-awesome": "@dev",
 +
"mediawiki/graph-viz": "@dev",
 
"mediawiki/lingo": "@dev",
 
"mediawiki/lingo": "@dev",
 
"mediawiki/mermaid": "@dev",
 
"mediawiki/mermaid": "@dev",
Ligne 17 : Ligne 21 :
 
"mediawiki/page-forms": "@dev",
 
"mediawiki/page-forms": "@dev",
 
"mediawiki/parser-hooks": "@dev",
 
"mediawiki/parser-hooks": "@dev",
"mediawiki/scribunto": "@dev",
+
"mediawiki/simple-batch-upload": "@dev",
 +
"mediawiki/sub-page-list": "@dev",
 
"mediawiki/summary-cards": "@dev",
 
"mediawiki/summary-cards": "@dev",
 
"mediawiki/validator": "@dev",
 
"mediawiki/validator": "@dev",
"mediawiki/whats-nearby": "@dev",
 
 
"mediawiki/semantic-breadcrumb-links": "@dev",
 
"mediawiki/semantic-breadcrumb-links": "@dev",
 
"mediawiki/semantic-cite": "@dev",
 
"mediawiki/semantic-cite": "@dev",
 
"mediawiki/semantic-compound-queries": "@dev",
 
"mediawiki/semantic-compound-queries": "@dev",
"mediawiki/semantic-external-query-lookup": "@dev",
 
 
"mediawiki/semantic-extra-special-properties": "@dev",
 
"mediawiki/semantic-extra-special-properties": "@dev",
 
"mediawiki/semantic-forms-select": "@dev",
 
"mediawiki/semantic-forms-select": "@dev",
 
"mediawiki/semantic-glossary": "@dev",
 
"mediawiki/semantic-glossary": "@dev",
 +
"mediawiki/semantic-image-caption": "@dev",
 
"mediawiki/semantic-interlanguage-links": "@dev",
 
"mediawiki/semantic-interlanguage-links": "@dev",
 
"mediawiki/semantic-media-wiki": "@dev",
 
"mediawiki/semantic-media-wiki": "@dev",
Ligne 34 : Ligne 38 :
 
"mediawiki/semantic-result-formats": "@dev",
 
"mediawiki/semantic-result-formats": "@dev",
 
"mediawiki/semantic-scribunto": "@dev",
 
"mediawiki/semantic-scribunto": "@dev",
"mediawiki/semantic-sifter": "@dev",
+
"mediawiki/semantic-tasks": "@dev",
"mediawiki/semantic-watchlist": "@dev",
+
"professional-wiki/id-generator": "@dev",
 +
"professional-wiki/modern-timeline": "@dev",
 
"phpoffice/phpspreadsheet": "~1"
 
"phpoffice/phpspreadsheet": "~1"
 
},
 
},
Ligne 41 : Ligne 46 :
 
"merge-plugin": {
 
"merge-plugin": {
 
"include": [
 
"include": [
"extensions/SyntaxHighlight_GeSHi/composer.json"
+
"extensions/Elastica/composer.json",
 +
"extensions/Mpdf/composer.json",
 +
"extensions/OATHAuth/composer.json",
 +
"extensions/TemplateStyles/composer.json",
 +
"extensions/SyntaxHighlight_GeSHi/composer.json",
 +
"extensions/VisualEditor/composer.json"
 
]
 
]
 
}
 
}
Ligne 57 : Ligne 67 :
  
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 +
### General settings
 +
$smwSemanticName = 'sandbox.semantic-mediawiki.org';
 +
 +
### Namespace settings (Semantic Cite)
 +
define( 'NS_CR', 2900 );
 +
define( 'NS_CR_TALK', 2901 );
 +
$wgExtraNamespaces[NS_CR] = 'CR';
 +
$wgExtraNamespaces[NS_CR_TALK] = 'CR_talk';
 +
 +
### Search settings
 +
use CirrusSearch\CirrusSearch;
 
$wgSearchType = 'SMWSearch';
 
$wgSearchType = 'SMWSearch';
 +
$smwgFallbackSearchType = function() {
 +
return new CirrusSearch();
 +
};
 +
 +
## ModernTimeline
 +
wfLoadExtension( 'ModernTimeline' );
 +
 +
## TitleIcon
 +
wfLoadExtension( 'TitleIcon' );
  
 
## Semantic MediaWiki
 
## Semantic MediaWiki
// Composer
+
enableSemantics( $smwSemanticName );
enableSemantics( sandbox.semantic-mediawiki.org );
+
$smwgConfigFileDir = $IP;
 +
// $smwgDefaultStore = 'SMWSQLStore3';
 
$smwgDefaultStore = 'SMWElasticStore';
 
$smwgDefaultStore = 'SMWElasticStore';
 
$smwgElasticsearchEndpoints = [
 
$smwgElasticsearchEndpoints = [
    [
+
[
        'host' => '217.197.83.171',
+
'host' => '127.0.0.1',
        'port' => 9200,
+
'port' => 6800,
        'scheme' => 'http'
+
'scheme' => 'http'
        ],
+
],
    'localhost:9200'
+
'localhost:6800'
    ];
+
];
$smwgElasticsearchConfig['settings']['data'] = [
+
$smwgElasticsearchProfile = __DIR__ . '/elasticsearch.profile.json';
    'index.mapping.total_fields.limit' => 9000
+
$smwgEnabledFulltextSearch = true;
    ];
+
$smwgEnabledQueryDependencyLinksStore = true;
$smwgElasticsearchConfig['query']['uri.field.case.insensitive'] = true;
+
$smwgPropertyZeroCountDisplay = false;
$smwgElasticsearchConfig['query']['debug.explain'] = true;
+
$smwgPropertyLowUsageThreshold = 3;
$smwgAdminRefreshStore = false;
+
$smwgAdminFeatures = ( $smwgAdminFeatures & ~SMW_ADM_REFRESH );
 +
$smwgNamespacesWithSemanticLinks[NS_TALK] = true;
 +
$smwgNamespacesWithSemanticLinks[NS_USER_TALK] = true;
 +
$smwgNamespacesWithSemanticLinks[NS_TEMPLATE] = true;
 +
$smwgNamespacesWithSemanticLinks[NS_CR] = true;
 
$smwgNamespacesWithSemanticLinks[NS_EXTRA] = true;
 
$smwgNamespacesWithSemanticLinks[NS_EXTRA] = true;
 +
$smwgNamespacesWithSemanticLinks[NS_NFL] = true;
 
$smwgPageSpecialProperties = array_merge(
 
$smwgPageSpecialProperties = array_merge(
    $smwgPageSpecialProperties, [
+
$smwgPageSpecialProperties, [
        '_CDAT',
+
'_ATTCH_LINK',
        '_NEWP',
+
'_CDAT',
        '_LEDT',
+
'_NEWP',
        '_MEDIA',
+
'_LEDT',
        '_MIME'
+
'_MEDIA',
        ]
+
'_MIME',
    );
+
'_TRANS'
 +
]
 +
);
 
$smwgFixedProperties = [
 
$smwgFixedProperties = [
    'Has_text_fixed',
+
'Has_text_fixed',
    'Has_page_fixed'
+
'Has_page_fixed'
    ];
+
];
$smwgQDefaultLimit = 200;
+
$smwgQDefaultLimit = 250;
$smwgQMaxLimit = 1000;
+
$smwgQMaxLimit = 4000;
$smwgQMaxInlineLimit = 1000;
+
$smwgQMaxInlineLimit = 2000;
$smwgPropertyZeroCountDisplay = false;
+
$smwgQueryProfiler = SMW_QPRFL_DUR | SMW_QPRFL_PARAMS;
$smwgPropertyLowUsageThreshold = 3;
+
$smwgMainCacheType = 'redis';
$smwgQueryProfiler = [
+
$smwgQueryResultCacheType = 'redis';
    'smwgQueryDurationEnabled' => true,
 
    'smwgQueryParametersEnabled' => true
 
    ];
 
$smwgQueryResultCacheType = CACHE_ANYTHING;
 
 
$smwgQFilterDuplicates = true;
 
$smwgQFilterDuplicates = true;
$smwgEnabledQueryDependencyLinksStore = true;
+
$smwgQSortFeatures = $smwgQSortFeatures | SMW_QSORT_UNCONDITIONAL;
$smwgQueryDependencyAffiliatePropertyDetectionlist = [
 
    '_DTITLE'
 
    ];
 
$smwgEnabledHttpDeferredJobRequest = SMW_HTTP_DEFERRED_SYNC_JOB;
 
$smwgOnDeleteAction = [
 
    'smwgDeleteSubjectAsDeferredJob' => true,
 
    'smwgDeleteSubjectWithAssociatesRefresh' => true
 
    ];
 
 
$smwgDVFeatures = $smwgDVFeatures | SMW_DV_PVUC;
 
$smwgDVFeatures = $smwgDVFeatures | SMW_DV_PVUC;
 
$smwgFieldTypeFeatures = SMW_FIELDT_CHAR_NOCASE | SMW_FIELDT_CHAR_LONG;
 
$smwgFieldTypeFeatures = SMW_FIELDT_CHAR_NOCASE | SMW_FIELDT_CHAR_LONG;
$smwgEnabledFulltextSearch = true;
+
$smwgParserFeatures = $smwgParserFeatures | SMW_PARSER_UNSTRIP | SMW_PARSER_LINV;
$smwgEditProtectionRight = 'smw-pageedit';
 
$smwgLinksInValues = SMW_LINV_OBFU;
 
 
$smwgPropertyReservedNameList = array_merge(
 
$smwgPropertyReservedNameList = array_merge(
    $smwgPropertyReservedNameList, [
+
$smwgPropertyReservedNameList, [
        'Code',
+
'Code',
        'smw-property-reserved-code'
+
'smw-property-reserved-code'
        ]
+
]
    );
+
);
 
$smwgJobQueueWatchlist = [
 
$smwgJobQueueWatchlist = [
    'SMW\UpdateJob',
+
'smw.update',
    'SMW\ParserCachePurgeJob',
+
'smw.updateDispatcher',
    'SMW\FulltextSearchTableUpdateJob',
+
'smw.parserCachePurge',
    'SMW\ChangePropagationUpdateJob'
+
'smw.fulltextSearchTableUpdate',
    ];
+
'smw.changePropagationDispatch',
 +
'smw.changePropagationUpdate',
 +
'smw.changePropagationClassUpdate',
 +
'smw.elasticIndexerRecovery',
 +
'smw.elasticFileIngest'
 +
];
 
$smwgDefaultLoggerRole = 'developer';
 
$smwgDefaultLoggerRole = 'developer';
 +
$smwgEditProtectionRight = 'smw-pageedit';
 +
$smwgSupportSectionTag = false;
 +
$smwgQuerySources = [
 +
'semanticmediawikiorg' => [
 +
'\SMW\Query\RemoteRequest',
 +
'url' => 'https://www.semantic-mediawiki.org/w/index.php',
 +
'cache' => 3600
 +
],
 +
'semantic-mw' => [
 +
'SMWExternalAskQueryLookup'
 +
]
 +
];
 +
$smwgPlainList = true;
 +
$smwgImportReqVersion = false;
 +
$smwgChangePropagationProtection = false;
 +
 +
## Semantic Approved Revs
 +
// https://github.com/SemanticMediaWiki/SemanticApprovedRevs/issues/14
 +
// https://github.com/SemanticMediaWiki/semantic-mediawiki.org/issues/87
 +
// wfLoadExtension( 'SemanticApprovedRevs' );
  
 
## Semantic Breadcrumb Links
 
## Semantic Breadcrumb Links
// Composer
+
wfLoadExtension( 'SemanticBreadcrumbLinks' );
  
 
## Semantic Cite
 
## Semantic Cite
// Composer
+
wfLoadExtension( 'SemanticCite' );
  
 
## Semantic Compound Queries
 
## Semantic Compound Queries
// Composer
+
wfLoadExtension( 'SemanticCompoundQueries' );
  
 
## Semantic Drilldown
 
## Semantic Drilldown
// https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/2944
+
$sdgNamespaceIndex = 112;
// $sdgNamespaceIndex = 112;
+
require 'extensions/SemanticDrilldown/SemanticDrilldown.php';
// require 'extensions/SemanticDrilldown/SemanticDrilldown.php';
+
$sdgShowCategoriesAsTabs = true;
// $sdgShowCategoriesAsTabs = true;
 
  
 
## Semantic External Query Lookup
 
## Semantic External Query Lookup
// Composer
+
// https://github.com/SemanticMediaWiki/SemanticExternalQueryLookup/issues/33
$smwgQuerySources = [
+
// https://github.com/SemanticMediaWiki/semantic-mediawiki.org/issues/86
'smworg' => 'SMWExternalQueryLookup',
+
// $seqlgExternalRepositoryEndpoints = [
];
+
// 'semantic-mw' => [
$seqlgExternalRepositoryEndpoints = [
+
// 'https://www.semantic-mediawiki.org/w/index.php/$1',
'smworg' => [
+
// 'https://www.semantic-mediawiki.org/w/api.php',
'https://www.semantic-mediawiki.org/w/index.php/$1',
+
// true
'https://www.semantic-mediawiki.org/w/api.php',
+
// ]
true
+
// ];
]
 
];
 
  
 
## Semantic Extra Special Properties
 
## Semantic Extra Special Properties
wfLoadExtension( 'SemanticExtraSpecialProperties' );
+
// https://github.com/SemanticMediaWiki/SemanticExtraSpecialProperties/issues/144
$sespSpecialProperties = [
+
// https://github.com/SemanticMediaWiki/semantic-mediawiki.org/issues/80
    '_CUSER',
+
// wfLoadExtension( 'SemanticExtraSpecialProperties' );
    '_EUSER',
+
// $sespgEnabledPropertyList = [
    '_EXIFDATA',
+
// '_CUSER',
    '_NREV',
+
// '_EUSER',
    '_NTREV',
+
// '_EXIFDATA',
    '_PAGEID',
+
// '_NREV',
    '_PAGELGTH',
+
// '_NTREV',
    '_REVID',
+
// '_PAGEID',
    '_SUBP',
+
// '_PAGELGTH',
    '_USERBLOCK',
+
// '_SUBP',
    '_USEREDITCNT',
+
// '_USERBLOCK',
    '_USERGROUP',
+
// '_USEREDITCNT',
    '_USERREG',
+
// '_USERGROUP',
    '_USERRIGHT',
+
// '_USERREG',
    '_VIEWS'
+
// '_USERRIGHT',
    ];
+
// '_VIEWS'
$sespUseAsFixedTables = true;
+
// ];
$wgSESPExcludeBots = true;
+
// $sespgUseFixedTables = true;
 +
// $sespgExcludeBotEdits = true;
 +
 
 +
## Semantic Image Caption
 +
// https://github.com/SemanticMediaWiki/SemanticImageCaption/issues/9
 +
// https://github.com/SemanticMediaWiki/semantic-mediawiki.org/issues/79
 +
// wfLoadExtension( 'SemanticImageCaption' );
  
 
## Semantic Forms Select
 
## Semantic Forms Select
Ligne 187 : Ligne 239 :
 
$wgexLingoPage = 'Glossaire';
 
$wgexLingoPage = 'Glossaire';
 
$wgexLingoUseNamespaces[NS_SPECIAL] = false;
 
$wgexLingoUseNamespaces[NS_SPECIAL] = false;
 
## Semantic Image Annotator
 
wfLoadExtension( 'SemanticImageAnnotator' );
 
  
 
## Semantic Interlanguage Links
 
## Semantic Interlanguage Links
// Composer
+
wfLoadExtension( 'SemanticInterlanguageLinks' );
  
 
## Semantic Meta Tags
 
## Semantic Meta Tags
// Composer
+
wfLoadExtension( 'SemanticMetaTags' );
 
$smtgTagsProperties = [
 
$smtgTagsProperties = [
 
'keywords' => 'Meta element keywords',
 
'keywords' => 'Meta element keywords',
'description' => 'Meta element description'
+
'description' => [
];
+
'Meta element description',
 +
function( OutputPage $outputPage ): string {
 +
global $wgLanguageCode;
 +
$title = $outputPage->getContext()->getTitle()->getText();
 +
$main_page = wfMessage( 'mainpage' )->inLanguage( $wgLanguageCode ?: 'fr' )->escaped();
 +
$site_name = wfMessage( 'pagetitle-view-mainpage' )->inLanguage( $wgLanguageCode ?: 'fr' )->escaped();
 +
$subtitle = $title !== $main_page ? wfMessage( 'tagline' )->inLanguage( $wgLanguageCode ?: 'fr' )->escaped () : '';
 +
return $title === $main_page ? $site_name : $title . '. ' . $subtitle;
 +
}
 +
],
 +
];
 
$smtgTagsStrings = [
 
$smtgTagsStrings = [
 
'og:site_name' => 'Semantic MediaWiki - Sandbox',
 
'og:site_name' => 'Semantic MediaWiki - Sandbox',
Ligne 207 : Ligne 266 :
 
'og:image:height' => '142'
 
'og:image:height' => '142'
 
];
 
];
 +
$smtgTagsPropertyFallbackUsage = true;
  
 
## Semantic Notifications
 
## Semantic Notifications
// Composer
+
wfLoadExtension( 'SemanticNotifications' );
  
 
## Semantic Rating
 
## Semantic Rating
Ligne 215 : Ligne 275 :
  
 
## Semantic Result Formats
 
## Semantic Result Formats
// Composer
+
wfLoadExtension( 'SemanticResultFormats' );
$srfgFirstDayOfWeek = 'Monday';
+
// $srfgFirstDayOfWeek = 'lundi'; // https://github.com/SemanticMediaWiki/SemanticResultFormats/issues/138
 
$srfgFormats = array_merge(
 
$srfgFormats = array_merge(
 
$srfgFormats, [
 
$srfgFormats, [
'filtered',
+
// 'process', // T238990
'process',
+
// 'graph', // T238990
'graph',
 
 
'incoming'
 
'incoming'
 
]
 
]
Ligne 227 : Ligne 286 :
  
 
## Semantic Scribunto
 
## Semantic Scribunto
// Composer
+
wfLoadExtension( 'SemanticScribunto' );
 
 
## Semantic Sifter
 
// Composer
 
 
 
## Semantic Text Annotator
 
wfLoadExtension( 'SemanticTextAnnotator' );
 
  
## Semantic Watchlist
+
## Semantic Tasks
// Composer
+
wfLoadExtension( 'SemanticTasks' );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Ligne 245 : Ligne 298 :
 
// Composer
 
// Composer
 
$egGitHubDefaultRepo = 'SemanticMediaWiki/SemanticMediaWiki';
 
$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
 
## Maps
// Composer
+
wfLoadExtension( 'Maps' );
 +
$egMapsDefaultService = 'leaflet';
 +
$egMapsDefaultGeoService = 'nominatim';
 
$egMapsEnableCategory = true;
 
$egMapsEnableCategory = true;
$egMapsGMaps3ApiKey = '??????????????????_????????????????????'; // obfuscated
 
  
 
## Page Forms
 
## Page Forms
 
wfLoadExtension( 'PageForms' );
 
wfLoadExtension( 'PageForms' );
 
$wgPageForms24HourTime = true;
 
$wgPageForms24HourTime = true;
$wgPageFormsRenameEditTabs = true;
 
 
$wgPageFormsRedLinksCheckOnlyLocalProps = true;
 
$wgPageFormsRedLinksCheckOnlyLocalProps = true;
 
$wgPageFormsAutocompleteOnAllChars = true;
 
$wgPageFormsAutocompleteOnAllChars = true;
Ligne 261 : Ligne 340 :
 
## Summary Card
 
## Summary Card
 
// Composer
 
// Composer
$sucgBackendParserCacheType = CACHE_MEMCACHED;
+
$sucgBackendParserCacheType = CACHE_NONE; // FIXME
 
$sucgEnabledNamespaceWithTemplate = [
 
$sucgEnabledNamespaceWithTemplate = [
 
NS_MAIN => 'SimpleSummaryCard',
 
NS_MAIN => 'SimpleSummaryCard',
Ligne 268 : Ligne 347 :
 
SMW_NS_PROPERTY => 'SimpleSummaryCard',
 
SMW_NS_PROPERTY => 'SimpleSummaryCard',
 
];
 
];
 
## WhatsNearby
 
// Composer
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Ligne 276 : Ligne 352 :
  
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 +
### Debug settings
 +
error_reporting( -1 );
 +
ini_set( 'display_errors', 1 );
 +
 
### Exception settings
 
### Exception settings
  
## Show exceptions
+
## Showing
 
$wgShowExceptionDetails = true;
 
$wgShowExceptionDetails = true;
$wgShowSQLErrors = true;
+
// $wgDebugToolbar = true;
$wgShowDBErrorBacktrace = true;
 
  
## Exception and event logging
+
## Logging
 +
// $wgDebugLogFile = "/var/log/mediawiki/{$wgDBname}-debug-all.log";
 +
// $wgDebugDumpSql = true;
 
$wgDebugLogGroups  = [
 
$wgDebugLogGroups  = [
'authentication' => "/var/log/mediawiki/{$wgDBname}-debug-authentication.log",
+
// 'authentication' => "/var/log/mediawiki/{$wgDBname}-debug-authentication.log",
 
'error' => "/var/log/mediawiki/{$wgDBname}-debug-error.log",
 
'error' => "/var/log/mediawiki/{$wgDBname}-debug-error.log",
 
'exception' => "/var/log/mediawiki/{$wgDBname}-debug-exception.log",
 
'exception' => "/var/log/mediawiki/{$wgDBname}-debug-exception.log",
'resourceloader' => "/var/log/mediawiki/{$wgDBname}-debug-resourceloader.log",
+
// 'resourceloader' => "/var/log/mediawiki/{$wgDBname}-debug-resourceloader.log",
'smw' => "/var/log/mediawiki/{$wgDBname}-debug-smw.log"
+
// 'smw' => "/var/log/mediawiki/{$wgDBname}-debug-smw.log",
 +
'smw-elastic' => "var/log/mediawiki/{$wgDBname}-debug-smw-elastic.log"
 
];
 
];
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
== elasticsearch.profile.json ==
 +
 +
<syntaxhighlight lang="json">
 +
{
 +
"settings": {
 +
"data": {
 +
"index.mapping.total_fields.limit": 12000
 +
}
 +
},
 +
        "indexer": {
 +
                "raw.text": true,
 +
                "experimental.file.ingest": false,
 +
                "throw.exception.on.illegal.argument.error": false
 +
        },
 +
        "query": {
 +
                "debug.explain": true,
 +
                "sort.property.must.exists": false,
 +
                "highlight.fragment.type": "unified",
 +
                "uri.field.case.insensitive": true
 +
        }
 +
}
 +
</syntaxhighlight>
 +
__NOGLOSSARY__
 +
[[Category:SMW Sandbox]]

Dernière version du 11 octobre 2021 à 09:42

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

{
	"minimum-stability": "dev",
	"require": {
		"elasticsearch/elasticsearch": "~6.0",
		"jeroen/mediawiki-github": "@dev",
		"mediawiki/bootstrap-components": "@dev",
		"mediawiki/chameleon-skin": "@dev",
		"mediawiki/font-awesome": "@dev",
		"mediawiki/graph-viz": "@dev",
		"mediawiki/lingo": "@dev",
		"mediawiki/mermaid": "@dev",
		"mediawiki/maps": "@dev",
		"mediawiki/page-forms": "@dev",
		"mediawiki/parser-hooks": "@dev",
		"mediawiki/simple-batch-upload": "@dev",
		"mediawiki/sub-page-list": "@dev",
		"mediawiki/summary-cards": "@dev",
		"mediawiki/validator": "@dev",
		"mediawiki/semantic-breadcrumb-links": "@dev",
		"mediawiki/semantic-cite": "@dev",
		"mediawiki/semantic-compound-queries": "@dev",
		"mediawiki/semantic-extra-special-properties": "@dev",
		"mediawiki/semantic-forms-select": "@dev",
		"mediawiki/semantic-glossary": "@dev",
		"mediawiki/semantic-image-caption": "@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-tasks": "@dev",
		"professional-wiki/id-generator": "@dev",
		"professional-wiki/modern-timeline": "@dev",
		"phpoffice/phpspreadsheet": "~1"
	},
	"extra": {
		"merge-plugin": {
			"include": [
				"extensions/Elastica/composer.json",
				"extensions/Mpdf/composer.json",
				"extensions/OATHAuth/composer.json",
				"extensions/TemplateStyles/composer.json",
				"extensions/SyntaxHighlight_GeSHi/composer.json",
				"extensions/VisualEditor/composer.json"
			]
		}
	},
	"config": {
		"preferred-install": "source",
		"optimize-autoloader": true
	}
}

LocalSettings.php

Semantic extensions

### General settings
$smwSemanticName = 'sandbox.semantic-mediawiki.org';

### Namespace settings (Semantic Cite)
define( 'NS_CR', 2900 );
define( 'NS_CR_TALK', 2901 );
$wgExtraNamespaces[NS_CR] = 'CR';
$wgExtraNamespaces[NS_CR_TALK] = 'CR_talk';

### Search settings
use CirrusSearch\CirrusSearch;
$wgSearchType = 'SMWSearch';
$smwgFallbackSearchType = function() {
	return new CirrusSearch();
};

## ModernTimeline
wfLoadExtension( 'ModernTimeline' );

## TitleIcon
wfLoadExtension( 'TitleIcon' );

## Semantic MediaWiki
enableSemantics( $smwSemanticName );
$smwgConfigFileDir = $IP;
// $smwgDefaultStore = 'SMWSQLStore3';
$smwgDefaultStore = 'SMWElasticStore';
$smwgElasticsearchEndpoints = [
	[
		'host' => '127.0.0.1',
		'port' => 6800,
		'scheme' => 'http'
		],
	'localhost:6800'
	];
$smwgElasticsearchProfile = __DIR__ . '/elasticsearch.profile.json';
$smwgEnabledFulltextSearch = true;
$smwgEnabledQueryDependencyLinksStore = true;
$smwgPropertyZeroCountDisplay = false;
$smwgPropertyLowUsageThreshold = 3;
$smwgAdminFeatures = ( $smwgAdminFeatures & ~SMW_ADM_REFRESH );
$smwgNamespacesWithSemanticLinks[NS_TALK] = true;
$smwgNamespacesWithSemanticLinks[NS_USER_TALK] = true;
$smwgNamespacesWithSemanticLinks[NS_TEMPLATE] = true;
$smwgNamespacesWithSemanticLinks[NS_CR] = true;
$smwgNamespacesWithSemanticLinks[NS_EXTRA] = true;
$smwgNamespacesWithSemanticLinks[NS_NFL] = true;
$smwgPageSpecialProperties = array_merge(
	$smwgPageSpecialProperties, [
		'_ATTCH_LINK',
		'_CDAT',
		'_NEWP',
		'_LEDT',
		'_MEDIA',
		'_MIME',
		'_TRANS'
		]
	);
$smwgFixedProperties = [
	'Has_text_fixed',
	'Has_page_fixed'
	];
$smwgQDefaultLimit = 250;
$smwgQMaxLimit = 4000;
$smwgQMaxInlineLimit = 2000;
$smwgQueryProfiler = SMW_QPRFL_DUR | SMW_QPRFL_PARAMS;
$smwgMainCacheType = 'redis';
$smwgQueryResultCacheType = 'redis';
$smwgQFilterDuplicates = true;
$smwgQSortFeatures = $smwgQSortFeatures | SMW_QSORT_UNCONDITIONAL;
$smwgDVFeatures = $smwgDVFeatures | SMW_DV_PVUC;
$smwgFieldTypeFeatures = SMW_FIELDT_CHAR_NOCASE | SMW_FIELDT_CHAR_LONG;
$smwgParserFeatures = $smwgParserFeatures | SMW_PARSER_UNSTRIP | SMW_PARSER_LINV;
$smwgPropertyReservedNameList = array_merge(
	$smwgPropertyReservedNameList, [
		'Code',
		'smw-property-reserved-code'
		]
	);
$smwgJobQueueWatchlist = [
	'smw.update',
	'smw.updateDispatcher',
	'smw.parserCachePurge',
	'smw.fulltextSearchTableUpdate',
	'smw.changePropagationDispatch',
	'smw.changePropagationUpdate',
	'smw.changePropagationClassUpdate',
	'smw.elasticIndexerRecovery',
	'smw.elasticFileIngest'
	];
$smwgDefaultLoggerRole = 'developer';
$smwgEditProtectionRight = 'smw-pageedit';
$smwgSupportSectionTag = false;
$smwgQuerySources = [
	'semanticmediawikiorg' => [
		'\SMW\Query\RemoteRequest',
		'url' => 'https://www.semantic-mediawiki.org/w/index.php',
		'cache' => 3600
		],
	'semantic-mw' => [
		'SMWExternalAskQueryLookup'
		]
	];
$smwgPlainList = true;
$smwgImportReqVersion = false;
$smwgChangePropagationProtection = false;

## Semantic Approved Revs
// https://github.com/SemanticMediaWiki/SemanticApprovedRevs/issues/14
// https://github.com/SemanticMediaWiki/semantic-mediawiki.org/issues/87
// wfLoadExtension( 'SemanticApprovedRevs' );

## Semantic Breadcrumb Links
wfLoadExtension( 'SemanticBreadcrumbLinks' );

## Semantic Cite
wfLoadExtension( 'SemanticCite' );

## Semantic Compound Queries
wfLoadExtension( 'SemanticCompoundQueries' );

## Semantic Drilldown
$sdgNamespaceIndex = 112;
require 'extensions/SemanticDrilldown/SemanticDrilldown.php';
$sdgShowCategoriesAsTabs = true;

## Semantic External Query Lookup
// https://github.com/SemanticMediaWiki/SemanticExternalQueryLookup/issues/33
// https://github.com/SemanticMediaWiki/semantic-mediawiki.org/issues/86
// $seqlgExternalRepositoryEndpoints = [
//	'semantic-mw' => [
//		'https://www.semantic-mediawiki.org/w/index.php/$1',
//		'https://www.semantic-mediawiki.org/w/api.php',
//		true
//		]
//	];

## Semantic Extra Special Properties
// https://github.com/SemanticMediaWiki/SemanticExtraSpecialProperties/issues/144
// https://github.com/SemanticMediaWiki/semantic-mediawiki.org/issues/80
// wfLoadExtension( 'SemanticExtraSpecialProperties' );
// $sespgEnabledPropertyList = [
//	'_CUSER',
//	'_EUSER',
//	'_EXIFDATA',
//	'_NREV',
//	'_NTREV',
//	'_PAGEID',
//	'_PAGELGTH',
//	'_SUBP',
//	'_USERBLOCK',
//	'_USEREDITCNT',
//	'_USERGROUP',
//	'_USERREG',
//	'_USERRIGHT',
//	'_VIEWS'
//	];
// $sespgUseFixedTables = true;
// $sespgExcludeBotEdits = true;

## Semantic Image Caption
// https://github.com/SemanticMediaWiki/SemanticImageCaption/issues/9
// https://github.com/SemanticMediaWiki/semantic-mediawiki.org/issues/79
// wfLoadExtension( 'SemanticImageCaption' );

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

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

## Semantic Interlanguage Links
wfLoadExtension( 'SemanticInterlanguageLinks' );

## Semantic Meta Tags
wfLoadExtension( 'SemanticMetaTags' );
$smtgTagsProperties = [
	'keywords' => 'Meta element keywords',
	'description' => [
		'Meta element description',
		function( OutputPage $outputPage ): string {
			global $wgLanguageCode;
			$title = $outputPage->getContext()->getTitle()->getText();
			$main_page = wfMessage( 'mainpage' )->inLanguage( $wgLanguageCode ?: 'fr' )->escaped();
			$site_name = wfMessage( 'pagetitle-view-mainpage' )->inLanguage( $wgLanguageCode ?: 'fr' )->escaped();
			$subtitle = $title !== $main_page ? wfMessage( 'tagline' )->inLanguage( $wgLanguageCode ?: 'fr' )->escaped () : '';
			return $title === $main_page ? $site_name : $title . '. ' . $subtitle;
		}
	],
];
$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'
	];
$smtgTagsPropertyFallbackUsage = true;

## Semantic Notifications
wfLoadExtension( 'SemanticNotifications' );

## Semantic Rating
wfLoadExtension( 'SemanticRating' );

## Semantic Result Formats
wfLoadExtension( 'SemanticResultFormats' );
// $srfgFirstDayOfWeek = 'lundi'; // https://github.com/SemanticMediaWiki/SemanticResultFormats/issues/138
$srfgFormats = array_merge(
	$srfgFormats, [
//		'process', // T238990
//		'graph', // T238990
		'incoming'
		]
	);

## Semantic Scribunto
wfLoadExtension( 'SemanticScribunto' );

## Semantic Tasks
wfLoadExtension( 'SemanticTasks' );

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
wfLoadExtension( 'Maps' );
$egMapsDefaultService = 'leaflet';
$egMapsDefaultGeoService = 'nominatim';
$egMapsEnableCategory = true;

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

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

Exception and event logging

### Debug settings
error_reporting( -1 );
ini_set( 'display_errors', 1 );

### Exception settings

## Showing
$wgShowExceptionDetails = true;
// $wgDebugToolbar = true;

## Logging
// $wgDebugLogFile = "/var/log/mediawiki/{$wgDBname}-debug-all.log";
// $wgDebugDumpSql = true;
$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",
	'smw-elastic' => "var/log/mediawiki/{$wgDBname}-debug-smw-elastic.log"
	];

elasticsearch.profile.json

{
	"settings": {
		"data": {
			"index.mapping.total_fields.limit": 12000
		}
	},
        "indexer": {
                "raw.text": true,
                "experimental.file.ingest": false,
                "throw.exception.on.illegal.argument.error": false
        },
        "query": {
                "debug.explain": true,
                "sort.property.must.exists": false,
                "highlight.fragment.type": "unified",
                "uri.field.case.insensitive": true
        }
}

__NOGLOSSARY__

Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.