2012-12-26

Created page with "{{SMW admin TOC}} Semantic MediaWiki offers a number of '''configuration options''' that site administrators may modify according to the particular needs of their wiki. T..."

New page

{{SMW admin TOC}}

[[Semantic MediaWiki]] offers a number of '''configuration options''' that site administrators may modify according to the particular needs of their wiki. This page explains all options of [[SMW 1.7.0]] and higher. All available options can also be found in the file [https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticMediaWiki.git;a=blob;f=SMW_Settings.php SMW_Settings.php] of your current version. To change any configuration setting, copy the according assignment into your LocalSettings.php, after including SMW as described in [[Help:Installation|installation]]. Do not change SMW_Settings.php directly, as your changes would be overwritten in software upgrades.

== Налаштування при встановленні ==

The following settings relate to the basic installation of SMW.

{| class="wikitable"

! Parameter

! Description

|-

| ${{a|smwgNamespaceIndex}}

| If you already have custom namespaces on your site, insert

$smwgNamespaceIndex = ???;

into your LocalSettings.php ''before'' including SemanticMediaWiki.php (formerly SMW_Settings.php). The number ??? must be the smallest even namespace number that is not in use yet. However, it must not be smaller than 100.

'''Default:''' 100

|-

| ${{a|smwgEnableUpdateJobs}}

|SMW defers some tasks until after a page was edited by using the MediaWiki job queueing system (see the manual on [[mws:Manual:Job_queue|job queues]]). For example, when the type of a property is changed, all affected pages will be scheduled for (later) update. If a wiki generates too many jobs in this way, the following setting can be used to disable jobs. Note that this will cause some parts of the semantic data to get out of date, so that manual modifications or the use of SMW_refreshData.php might be needed.

'''Default:''' true

|-

| ${{a|smwgLinksInValues}}

|Should SMW accept inputs like
[[property::Some [[link]] in value]]
? If enabled, this may lead to PHP crashes (!) when very long texts are used as values. This is due to limitations in the library PCRE that PHP uses for pattern matching. The provoked PHP crashes will prevent requests from being completed – usually clients will receive server errors ("invalid response") or be offered to download "index.php". It might be okay to enable this if such problems are not observed in your wiki.

'''Default:''' false

|-

| ${{a|smwgUseCategoryHierarchy}}

|Should SMW consider MediaWiki's subcategory hierarchy in querying? If set to true, subcategories will always be interpreted like subclasses. For example, if A is a subcategory of B then a query for all elements of B will also yield all elements of A. If this setting is disabled, then subclass relationships can still be given explicitly by using the property [[Property:Subcategory of]] on some category page. Only if the setting is false will such annotations be shown in the [[Factbox]] (if enabled).

'''Default:''' true

|-

| ${{a|smwgCategoriesAsInstances}}

|Should category pages that use some
[[Category:Foo]]
statement be treated as elements of the category Foo? If disabled, then it is not possible to make category pages elements of other categories. See also the above setting $smwgUseCategoryHierarchy.

'''Default:''' true

|-

| ${{a|smwgNamespacesWithSemanticLinks}}

| Overwriting the following array, you can define for which namespaces the semantic links and annotations are to be evaluated. On other pages, annotations can be given but are silently ignored. This is useful since, e.g., talk pages usually do not have attributes and the like. In fact, is is not obvious what a meaningful attribute of a talk page could be. Pages without annotations will also be ignored during full OWL/RDF export, unless they are referred to from another article.

'''Default:'''

|-

| ${{a|smwgDefaultNumRecurringEvents}}

| This is a setting for recurring events, created with the [[Help:Recurring events|#set_recurring_event]] parser function. This setting defines the default number of instances defined by this parser function, if no end date is set.

'''Default:''' 100

|-

| ${{a|smwgMaxNumRecurringEvents}}

| This is a setting for recurring events, created with the [[Help:Recurring events|#set_recurring_event]] parser function. This setting defines the maximum number that can be defined by this parser function, regardless of an end date.

'''Default:''' 500

|-

| ${{a|smwgPageSpecialProperties}}

|List of enabled page-related special properties. The setting was introduced in [[SMW 1.7.0]]. Other possible settings are:

*array( '_CDAT' ) (corresponds to special property [[Property:Creation date|Creation date]])

*array( '_NEWP' ) (corresponds to special property [[Property:Is a new page|Is a new page]])

*array( '_LEDT' ) (corresponds to special property [[Property:Last editor is|Last editor is]])

*array( '_MDAT', '_CDAT', /* ... */ ) - multiple used

*array( ) - none used

See the help page on [[Help:$smwgPageSpecialProperties|$smwgPageSpecialProperties]] for detailed information to set this parameter.

'''Default:''' array( '_MDAT' ) (corresponds to special property [[Property:Modification date|Modification date]])

|}

== Налаштування інтерфейсу ==

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

{{#ask:[[has configuration::Interface settings]]

|?=Parameter

|?Has description=Description

|?Has default=Default

|?Has minimum version=Introduced

|?Has maximum version=Deprecated

|mainlabel=-

|format=broadtable

|headers=plain

|link=subject

|class=sortable wikitable smwtable

|offset=

|limit=

}}

{| class="wikitable smw"

! Parameter

! Description

|-

| ${{a|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

|-

| ${{a|smwgShowFactboxEdit}}

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

'''Default:''' SMW_FACTBOX_NONEMPTY

|-

| ${{a|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

|-

| ${{a|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

|-

| ${{a|smwgSearchByPropertyFuzzy}}

|Should the search by property special page display nearby results when there are only few results with the exact value? Switch this off if this page has performance problems.

'''Default:''' true

|-

| ${{a|smwgTypePagingLimit}}

|Number of results shown in the listings on pages in the namespace Type.

'''Default:''' 200

|-

| ${{a|smwgConceptPagingLimit}}

|Number of results shown in the listings on pages in the namespace Concept.

'''Default:''' 200

|-

| ${{a|smwgPropertyPagingLimit}}

|Number of results shown in the listings on pages in the namespace Property. Uses a smaller value since these lists need more space.

'''Default:''' 25

|-

| ${{a|smwgMaxPropertyValues}}

| Number of values that are shown for each page in the listing on property pages. If increased to higher values, it might be useful to reduce $smwgPropertyPagingLimit to avoid performance impacts when showing property pages.

'''Default:''' 3

|-

| ${{a|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

|}

== Налаштування запитів ==

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.

{{#ask:[[has configuration::Query settings]][[has configuration::Basic settings]]

|?=Parameter

|?Has description=Description

|?Has default=Default

|?Has minimum version=Introduced

|?Has maximum version=Deprecated

|mainlabel=-

|format=broadtable

|headers=plain

|link=subject

|class=sortable wikitable smwtable

|offset=

|limit=

}}

{| class="wikitable smw"

! Parameter

! Description

|-

| ${{a|smwgQSubpropertyDepth}}

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

'''Default:''' 10

|-

| ${{a|smwgQSortingSupport}}

| Should sorting of query results be possible?

'''Default:''' true

|-

| ${{a|smwgQRandSortingSupport}}

| Enables or disables the random sorting of query results.

'''Default:''' true

|-

| ${{a|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

|-

| ${{a|smwgQComparators}}

|List of [[Help:Selecting_pages#Property_values:_wildcards_and_comparators|comparator characters]] supported by queries, separated by '
|
'. Possible entries for this list are

*
(greater than or equal)

*
> (greater than)

* ≤ (smaller than or equal - note that this is an [[wp:en:Extended_ascii|extended ASCII character]] and may show up differently, e.g. as â¤)

* ≥ (greater than or equal - note that this also is an extended ASCII character and may show up like â¥)

* ! (unequal to)

* ~ (matching a pattern with '*' as wildcard, only for datatype [[Help:Type String|String]])

* !~ (not matching a pattern with '*' as wildcard, only for datatype [[Help:Type String|String]])

If unsupported comparators are used, they are treated as part of the queried value. The behaviour of the comparators
varies depending on the setting for [[#smwStrictComparators|$smwStrictComparators]].

'''Default:''' '

|!~|!|~|≤|≥|
>
'

|-

| ${{a|smwStrictComparators}}

| Enables or disables [[Help:Selecting_pages#Property_values:_wildcards_and_comparators|strict treatment]] of comparator symbols.

'''Default:''' false

|-

| ${{a|smwgIgnoreQueryErrors}}

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

'''Default:''' true

|}

=== Налаштування вбудованих запитів та Special:Ask ===

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.

{{#ask:[[has configuration::Query settings]][[has configuration::Inline queries]]

|?=Parameter

|?Has description=Description

|?Has default=Default

|?Has minimum version=Introduced

|?Has maximum version=Deprecated

|mainlabel=-

|format=broadtable

|headers=plain

|link=subject

|class=sortable wikitable smwtable

|offset=

|limit=

}}

=== Налаштування запитів-понять ===

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:

# 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 [[Help:Concept caching|Concept caching]] for details on how to exploit this.

# 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.

{| class="wikitable smw"

! Parameter

! Description

|-

| ${{a|smwgQConceptCaching}}

|Which concepts should be displayed only if available from [[Help:Concept caching|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

|-

| ${{a|smwgQConceptMaxSize}}

|Same as $smwgQMaxSize but for concepts.

'''Default:''' 20

|-

| ${{a|smwgQConceptMaxDepth}}

|Same as $smwgQMaxDepth but for concepts.

'''Default:''' 8

|-

| ${{a|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

|-

| {{a|$smwgQConceptCacheLifetime}}

|This setting defines the cache life time in minutes. If a [[Help:concept caching|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)

|}

=== Налаштування для запитів formatting/display ===

{| class="wikitable smw"

! Parameter

! Description

|-

| ${{a|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:''' 'all'

|-

| ${{a|smwgQDefaultLimit}}

| Default number of rows returned in a query. Can be increased with limit=... in
#ask
.

'''Default:''' 50

|-

| ${{a|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:'''

|}

== Налаштування експорту ==

=== RSS експорт ===

{{#ask:[[has configuration::RSS export]]

|?=Parameter

|?Has description=Description

|?Has default=Default

|?Has minimum version=Introduced

|?Has maximum version=Deprecated

|mainlabel=-

|format=broadtable

|headers=plain

|link=subject

|class=sortable wikitable smwtable

|offset=

|limit=

}}

=== OWL/RDF експорт ===

{| class="wikitable smw"

! Parameter

! Description

|-

| ${{a|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

|-

| ${{a|smwgExportBacklinks}}

|Should incoming properties be part of OWL/RDF export?

'''Default:''' true

|-

| ${{a|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 [[Help:Pretty URIs|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 та RDF налаштування ===

See also the help page [[Help:Using_SPARQL_and_RDF_stores#Configuring_SMW|on configuring SWM for use with SPARQL and RDF stores]].

{{#ask:[[has configuration::Store settings]]

|?=Parameter

|?Has description=Description

|?Has default=Default

|?Introduced with=Introduced

|?Deprecated with=Deprecated

|mainlabel=-

|format=broadtable

|headers=plain

|link=subject

|class=sortable wikitable smwtable

|offset=

|limit=

}}

{| class="wikitable smw"

! Parameter

! Description

|-

| ${{a|smwgSparqlDatabase}}

|Configure SPARQL database connection for Semantic MediaWiki. This is used when SPARQL-based features are enabled, e.g. when using 'SMWSparqlStore' as the [[#smwgDefaultStore|$smwgDefaultStore]]. The default setting uses a generic SPARQL connector that is based on recent SPARQL documents. However there are settings available for use with specific connectors:

* 'SMWSparqlDatabase4Store' for use with [[Help:Using SPARQL and RDF stores#4Store|4Store]]

* 'SMWSparqlDatabaseVirtuoso' for use with [[Help:Using SPARQL and RDF stores#Virtuoso|Virtuoso]]

'''Default:''' 'SMWSparqlDatabase'

|-

| ${{a|smwgSparqlQueryEndpoint}}

|Configure SPARQL database connection for Semantic MediaWiki. This is used when SPARQL-based features are enabled. Endpoint (service URL) for queries (reading queries like SELECT). This endpoint is neccessary.

'''Default:'''
'http://localhost:8080/sparql/'

|-

| ${{a|smwgSparqlUpdateEndpoint}}

|Configure SPARQL database connection for Semantic MediaWiki. This is used when SPARQL-based features are enabled. Endpoint (service URL) for updates (SPARQL Update queries). Can be omitted if not supported.

'''Default:'''
'http://localhost:8080/update/'

|-

| ${{a|smwgSparqlDataEndpoint}}

|Configure SPARQL database connection for Semantic MediaWiki. This is used when SPARQL-based features are enabled. Endpoint (service URL) for data (SPARQL HTTP Protocol for Graph Management) Can be omitted if not supported.

'''Default:'''
'http://localhost:8080/data/'

|-

| ${{a|smwgSparqlDefaultGraph}}

|The default graph is similar to a database name in relational databases. It can be set to any URI (e.g. the main page URI of your wiki with "#graph" appended). Leaving the default graph URI empty only works if the store is configured to use some default graph or if it generally supports this. Different wikis should normally use different default graphs unless there is a good reason to share one graph.

'''Default:'''
''

|}

=== Інші налаштування ===

{| class="wikitable smw"

! Parameter

! Description

|-

| ${{a|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 languages/SMW_LanguageXX.php to find what IDs to use for datatpyes 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 [[Help:Type Page|Page]])

|-

| ${{a|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

|-

| ${{a|smwgAdminRefreshStore}}

| If the following is set to true, the wiki data can be [[Help:Repairing SMW's data|repaired]] using the interface on the page ''Special:SMWAdmin''. Setting this option to false does not stop ongoing repair processes.

'''Default:''' true

|-

| ${{a|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|SMW 1.6.0]].

'''Default:''' false

|}

{{docinfo

| master page = Help:Configuration

| master rev = {{REVISIONID}}

| master link = internal

| status = effective

| progress = 100

| priority = 1

| category = Manual

| author = Леонід Українець

| editor = {{REVISIONUSER}}

| support = Jeroen De Dauw

| minversion = 1.7.0

| lang = uk

| desc =

| return =

| nowarn

}}

[[Categoty::Посібник користувача]]

Show more