Help:Configuration

From semantic-mediawiki.org
Jump to: navigation, search
SMW admin manual
Installation
Configuration
Concept caching
Fixed properties
Using SPARQL and RDF stores
SPARQLStore
Pretty URIs
Troubleshooting
Repairing SMW's data
Extensions
Basic extensions
Semantic extensions
SMW user manual
Table of Contents

Semantic MediaWiki offers a number of configuration parameters that site administrators may modify according to the particular needs of their wiki. This page explains all configuration parameters for Semantic MediaWiki. All available configuration parameters can also be found in the file "DefaultSettings.php" (as of Semantic MediaWiki 2.4.0). To change the setting of any configuration parameter, copy the respective assignment into your "LocalSettings.php" file, after including Semantic MediaWiki as described in installation. Do not change the "DefaultSettings.php" file directly, as your changes would be overwritten in software upgrades.

Installation settings

The following settings relate to the basic installation of Semantic MediaWiki.

Parameter Description Default Version
$smwgAdminFeatures Sets which administrative features may be used via special page "SemanticMediaWiki"
see documentation
2.5.0+
$smwgAdminRefreshStore Sets whether it is possible to set up the database tables or to initiate the repairing or updating of all semantic data of wiki using the interface on special page "SMWAdmin"
true
1.3.0+
$smwgDefaultNumRecurringEvents Sets the default number of recurring events if no end date is set
100
1.4.3+
$smwgDefaultStore Sets the storage backend to be used for the semantic data (SQL or SPARQL).
SMWSQLStore3
1.0+
$smwgEditProtectionRight Sets the user right required to edit pages which are edit protected with special property "Is edit protected"
false
2.5.0+
$smwgEnableUpdateJobs Defers some tasks until after a page was edited by using the job queue.
true
1.2.0+
$smwgEnabledEditPageHelp Sets whether help information on the edit page is displayed
true
2.1.0+
$smwgEnabledSpecialPage Enables Semantic MediaWiki specific annotation and content processing for special pages
array( 'Ask' );
1.9.0+
$smwgFallbackSearchType Sets the search engine to fall back to in case SMWSearch is used as custom search engine but is unable to interpret the search term as an semantic query.
null
2.1+
$smwgFixedProperties Sets user defined properties to have a dedicated table for them.
array();
1.9.0+
$smwgLinksInValues Sets whether internal links may be stored within property values.
false
1.3.0+
$smwgMaxNumRecurringEvents Sets the maximum number of recurring events that can be defined regardless of a given end date
500
1.4.3+
$smwgNamespace URI-namespace of exported URIs
empty
0.7+
$smwgNamespaceIndex Sets the first namespace index to be used.
100
0.7+
$smwgNamespacesWithSemanticLinks Defines for which namespaces the semantic links and annotations are to be evaluated.
array( … );
0.7+
$smwgOnDeleteAction Moves the update process for when a page / property and its value assignments are deleted to the job queue.
array( … );
1.9.0.1+
$smwgPageSpecialProperties Sets the page related special properties to be used.
array( '_MDAT' );
1.7.0+
$smwgPropertyLowUsageThreshold Sets a threshold value for when a property is being highlighted as "hardly being used" on special page "Properties".
5
1.9.0+
$smwgPropertyZeroCountDisplay Sets whether properties with a usage count of zero should be shown on special page "Properties"
true
1.9.0+
$smwgQEnabled Activates or deactivates all query related features and interfaces
true
1.0+
$smwgQueryProfiler Enables/Disables specific monitorable profile data
array( … );
1.9.0+
$smwgShowHiddenCategories Sets whether or not to omit categories marked with the HIDDENCAT behaviour switch from the annotation process.
true
1.9.0+


Cache settings

The following settings are relevant for the caching behaviour of Semantic MediaWiki, such as special pages, factboxes etc.

Parameter Description Default Version
$smwgAutoRefreshOnPageMove Sets whether or not to refresh semantic data in the store when a page was moved.
true
1.9.0+
$smwgAutoRefreshOnPurge Sets whether or not to refresh semantic data in the store when a page is manually purged.
true
1.9.0+
$smwgCacheType Sets which object cache Semantic MediaWiki should use to track temporary changes.
CACHE_ANYTHING
1.9.0+
$smwgCacheUsage Controls the caching behaviour or special pages related to Semantic MediaWiki.
array( ... );
1.9.0+
$smwgFactboxCacheRefreshOnPurge Sets whether or not a cached factbox should be invalidated on an action=purge event.
true
1.9.0+
$smwgFactboxUseCache Sets whether or not a factbox content should be stored in cache.
true
1.9.0+


Interface settings

The following settings are relevant for the general appearance of various wiki pages in Semantic MediaWiki, as well as for browsing interfaces such as Special:Browse.

Parameter Description Default Version
$smwgBrowseShowAll Sets whether the browse view for incoming links on special page special page "Browse" should show the incoming links by default or not
true
1.3.0+
$smwgBrowseShowInverse Sets whether the browse view for incoming links on special page special page "Browse" should show the incoming links in an inverse view or not
false
1.3.0+
$smwgConceptPagingLimit Sets the number of listings shown in the namespace "Concept"
200
1.3.0+
$smwgMaxPropertyValues Sets the number of values that are shown for each page in the listing on pages in the namespace "Property"
3
1.4.3+
$smwgPropertyPagingLimit Sets the number of results shown in the listings on pages in the namespace "Property"
25
0.7+
$smwgSearchByPropertyFuzzy Sets whether the "Search by property" special page should display nearby results.
array( '_num', '_txt', '_dat' );
1.1.0+
$smwgTypePagingLimit Sets the number of listings shown in the namespace "Type"
200
0.7+


Parameter Description
$smwgShowFactbox This setting allows you to select in which cases you want to have a factbox appear below an article. Note that the Magic Words __SHOWFACTBOX__ and __NOFACTBOX__ can be used to control Factbox display for individual pages. Other options for this setting include:
  • $smwgShowFactbox = SMW_FACTBOX_NONEMPTY; show only those factboxes that have some content
  • $smwgShowFactbox = SMW_FACTBOX_SPECIAL; show only if special properties were set
  • $smwgShowFactbox = SMW_FACTBOX_HIDDEN; hide always
  • $smwgShowFactbox = SMW_FACTBOX_SHOWN; show always, buggy and not recommended

Default: SMW_FACTBOX_HIDDEN

$smwgShowFactboxEdit Same as $smwgShowFactbox but for edit mode and same possible values.

Default: SMW_FACTBOX_NONEMPTY

$smwgToolboxBrowseLink Should the toolbox of each content page show a link to browse the properties of that page using Special:Browse? This is a useful way to access properties and it is somewhat more subtle than showing a Factbox on every page.

Default: true

$smwgInlineErrors Should warnings be displayed in wikitexts right after the problematic input? This affects only semantic annotations, not warnings that are displayed by inline queries or other features.

Default: true

$smwgMaxNonExpNumber The maximal number that SMW will normally display without using scientific exp notation. The default is rather large since some users have problems understanding exponents. Scientific applications may prefer a smaller value for concise display.

Default: 1000000000000000

Query settings

Settings for inline queries and for semantic queries in general. This can especially be used to prevent overly high server-load by complex queries. The following settings affect all queries, wherever they occur.

Parameter Description Default Version
$maxRecursionDepth Sets the recursion depth for a template output
2
1.4.0+
$smwStrictComparators Sets whether the ">" and "<" comparators should be strict or not.
false
1.5.3+
$smwgAutoRefreshSubject Sets whether or not to refresh the pages on which semantic data is stored.
true
1.5.6+
$smwgCategoriesAsInstances Sets whether a category statement should be treated as an element of the category.
true
1.5.0+
$smwgQComparators Sets the list of comparator characters supported by queries for use in a regex.
see documentation
1.0+
$smwgQDefaultLimit Default number of rows returned in a query. Can be increased with limit=... in #ask.
50
1.0+
$smwgQEqualitySupport Should redirects between page names be considered as equality between the described objects? This is usually appropriate for cases where data is given for a page at all.
SMW_EQ_SOME
1.0+
$smwgQFeatures Defines which query features should be available by default.
see documentation
1.2.0+
$smwgQMaxDepth Maximal property depth of queries
4
1.0+
$smwgQMaxInlineLimit Sets the maximal number of rows ever printed in a single inline query on a single page, even if a setting limit=... is given.
500
1.0+
$smwgQMaxLimit Sets the maximal number of results ever retrieved, even when using special query pages.
10000
1.0+
$smwgQMaxSize Maximal number of conditions in queries.
12
1.0+
$smwgQPrintoutLimit Maximal number of supported printouts (added columns in result table, ?-statements).
100
1.0+
$smwgQSubcategoryDepth Sets the maximum level of sub-category inclusion (steps within category hierarchy).
10
1.0+
$smwgQUpperbound Sets the upper bound of the offset used for the maximal number of rows ever printed in a single inline query on a single page.
5000
2.1+
$smwgQuerySources Use another query back-end for Semantic MediaWiki.
empty
1.8.0+
$smwgUseCategoryHierarchy Sets whether Semantic MediaWiki should consider MediaWiki's subcategory hierarchy in querying.
true
1.5.0+


Parameter Description
$smwgQSubpropertyDepth Restrict level of sub-property inclusion (steps within property hierarchy). Use 0 to disable hierarchy-inferencing in queries.

Default: 10

$smwgQSortingSupport Should sorting of query results be possible?

Default: true

$smwgQRandSortingSupport Enables or disables the random sorting of query results.

Default: true

$smwgQDefaultNamespaces Which namespaces should be searched by default? A value of NULL switches off default restrictions on searching, which is faster. An example value with namespaces would be array(NS_MAIN, NS_IMAGE).

Default: NULL

$smwgIgnoreQueryErrors Should queries be executed even if some errors were detected? A hint that points out errors is shown in any case.

Default: true

Settings for inline queries

The following settings affect inline queries and querying special pages, in particular Special:Ask. Essentially they should mirror the kind of queries that should immediately be answered by the wiki, using whatever computations are needed.


Settings for Special:Ask

The following settings affect querying special pages, in particular Special:Ask. The settings for inline queries mentioned above also affect queries on special pages.

Parameter Description Default Version
$smwgAutocompleteInSpecialAsk Sets whether or not the 'printouts' textarea should have autocompletion on property names.
true
1.5.2+


Settings for concept queries

Further settings for queries. The following settings affect queries that are part of concept pages. These are usually chosen to be less restricted than inline queries, since there are two other means for controlling their use:

  1. Concept queries that would not be allowed as normal queries will not be executed directly, but can use pre-computed results instead. This is the default. See Concept caching for details on how to exploit this.
  2. The whole Concept: namespace can be restricted (using some suitable MediaWiki extension) to an experienced user group that may create more complex queries resonably. Other users can employ thus defined concepts in their queries.
Parameter Description
$smwgQConceptCaching Which concepts should be displayed only if available from cache? Possible values are:
  • CONCEPT_CACHE_ALL show concept elements anywhere only if they are cached,
  • CONCEPT_CACHE_HARD show without cache if concept is not harder than permitted inline queries, or
  • CONCEPT_CACHE_NONE show all concepts even without any cache.

In any case, caches will always be used if available (but see $smwgQConceptCacheLifetime).

Default: CONCEPT_CACHE_HARD

$smwgQConceptMaxSize Same as $smwgQMaxSize but for concepts.

Default: 20

$smwgQConceptMaxDepth Same as $smwgQMaxDepth but for concepts.

Default: 8

$smwgQConceptFeatures Same as $smwgQFeatures but for concepts. Note that using concepts in concepts is currently not supported – do not enable it!

Default: SMW_PROPERTY_QUERY | SMW_CATEGORY_QUERY | SMW_NAMESPACE_QUERY | SMW_CONJUNCTION_QUERY | SMW_DISJUNCTION_QUERY

$smwgQConceptCacheLifetime This setting defines the cache life time in minutes. If a concept cache exists but is older than this, SMW tries to recompute it, and will only use the cache if this is not allowed due to settings above.

Default: 24 * 60 (= 1 day)

Settings for query formatting/display

Parameter Description
$smwgQDefaultLinking Which result columns in an inline query should be linked if not specified otherwise. Possible values are 'none', 'subject' (links only in first column), 'all'.

Default: 50

$smwgResultFormats This setting contains an array of all query result formats that the wiki supports. It is normally extended automatically by extensions that supply additional formats. However, it is also possible to set this array manually, e.g. to disable some formats. To disable a format, do unset($smwgResultFormats['template']); Disabled formats will be treated like if the format parameter had been omitted. The formats 'table' and 'list' are defaults that cannot be disabled. The format 'broadtable' should not be disabled either in order not to break Special:Ask.

Default:

array(
	'table' => 'SMWTableResultPrinter',
	'list' => 'SMWListResultPrinter',
	'ol' => 'SMWListResultPrinter',
	'ul' => 'SMWListResultPrinter',
	'broadtable' => 'SMWTableResultPrinter',
	'category' => 'SMWCategoryResultPrinter',
	'embedded' => 'SMWEmbeddedResultPrinter',
	'template' => 'SMWListResultPrinter',
	'count' => 'SMWListResultPrinter',
	'debug' => 'SMWListResultPrinter',
	'rss' => 'SMWRSSResultPrinter',
	'csv' => 'SMWCsvResultPrinter',
	'dsv' => 'SMWDSVResultPrinter',
	'json' => 'SMWJSONResultPrinter',
	'rdf' => 'SMWRDFResultPrinter'
);

Export settings

RSS export

Parameter Description Default Version
$smwgRSSEnabled Sets whether RSS is enabled or not
true
1.0 - 1.7.1
$smwgRSSWithPages Sets whether RSS feeds should deliver whole pages or just link to them
true
1.0 - 1.7.1


OWL/RDF export

Parameter Description
$smwgAllowRecursiveExport Can normal users request recursive export, i.e. an OWL/RDF export that includes a full export of all mentioned pages, and of all pages they mention, and so on. Recommended only for very small wikis.

Default: false

$smwgExportBacklinks Should incoming properties be part of OWL/RDF export?

Default: true

$smwgNamespace The URI-namespace of exported URIs. Will be set automatically if nothing is given, using the base URL provided to enableSemantics(). But in order to make pretty URIs you will need to set this to something nice and adapt your Apache configuration appropriately. This is done, e.g., on semanticweb.org, where URIs are of the form http://semanticweb.org/wiki/FOAF. An example setting would be
$smwgNamespace = 'http://example.org/id/';

Default: unset

Other settings

The following settings usually need no modification.

SPARQL and RDF store stettings

See also the help page on configuring Semantic MediaWiki for use with SPARQL and RDF stores.

Parameter Description Default Version
$smwgDefaultStore Sets the storage backend to be used for the semantic data (SQL or SPARQL).
SMWSQLStore3
1.0+
$smwgSparqlDataEndpoint Sets the endpoint (service URL) for data (SPARQL over HTTP service) on the SPARQL database.
http://localhost:8080/data/
1.6.0+
$smwgSparqlDatabase Defines the SPARQL custom database connectors
custom
1.6.0 - 1.9.2
$smwgSparqlDatabaseConnector Identifies a database connector that ought to be used together with the semantic data store.
custom
2.0+
$smwgSparqlDefaultGraph Sets the identifier (graph) of the SPARQL database.
''
1.7.0+
$smwgSparqlQFeatures Defines the SPARQL query features that are expected to be supported by the repository of the identifier (graph) of the SPARQL database.
see documentation
2.3.0+
$smwgSparqlQueryEndpoint Sets the endpoint (service URL) for querying (reading queries like SELECT) the SPARQL database.
http://localhost:8080/sparql/
1.6.0+
$smwgSparqlRepositoryConnectorForcedHttpVersion Explicitly force a CURLOPT_HTTP_VERSION for the endpoint communication
false
2.3.1+
$smwgSparqlUpdateEndpoint Sets the endpoint (service URL) for updating (update queries) the SPARQL database.
http://localhost:8080/update/
1.6.0+


Miscellaneous settings

Parameter Description Default Version
$smwgQTemporaryTablesAutoCommitMode Sets whether certain types of transactions may be performed that cannot be safely logged using global transaction identifiers (GTIDs).
false
2.5.0+


Parameter Description
$smwgPDefaultType Default property type. Undefined properties (those without pages or whose pages have no "has type" statement) will be assumed to be of this type. This is an internal type id. See the file /i18n/extra/XX.json to find what IDs to use for datatypes in your language. The default corresponds to "Type:Page". The English IDs are as follows:
  • '_wpg' → Page
  • '_str' → String
  • '_txt' → Text
  • '_cod' → Code
  • '_boo' → Boolean
  • '_num' → Number
  • '_geo' → Geographic coordinates
  • '_tem' → Temperature
  • '_dat' → Date
  • '_ema' → Email
  • '_uri' → URL
  • '_anu' → Annotation URI
  • '_tel' → Telephone number
  • '_rec' → Record
  • '_qty' → Quantity

Default: '_wpg' (corresponds to datatype Page)

$smwgTranslate Setting this to true allows to translate all the labels within Special:Browse given that they have interwiki links. This feature is currently disabled and cannot be activated with this setting.

Default: false

$smwgHistoricTypeNamespace If the following is set to true, you can still access the old namespaces Type (104) and Type_talk (105) which have been replaced by Special:Types and are thus obsolete starting with Semantic MediaWiki 1.6.0.

Default: false


,

This documentation page applies to all SMW versions from 1.7.0 to the most current version.
Other versions: 1.6.0 – 1.6.21.5.6 – 1.5.61.5.1 – 1.5.5[…]       Other languages: frukzh-hans

Help:Configuration en 1.7.0