Help:Configuration

From HackerspaceWiki
Jump to: navigation, search

SMW admin manual

Download

Installation

Configuration

Concept caching

Troubleshooting

Repairing SMW's data

Extensions

Basic extensions

Semantic extensions

SPARQL endpoint

SMW user manual

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.4.0. All available options can also be found in the file 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 installation. Do not change SMW_Settings.php directly, as your changes would be overwritten in software upgrades.

Installation settings[edit]

The following settings relate to the basic installation of SMW.

Parameter Description
$smwgSMWBetaCompatible SMW has changed a lot since version 0.1 and some additional settings are needed to preserve old functions on sites that have been using beta versions of SMW (any version prior to 1.0). Sites still using obsolete SMW beta

features should set the following to "true". All others can safely keep the default here.

Setting this option to true has the following effect:

  • The obsolete namespace "Relation" will still be created (maybe some sites have content there).
  • Statements like [[property::*]] in queries will be interpreted as printout statements (like ?property in the current ask query syntax).

This option must be set before including this file, or otherwise the old Relation namespaces will not be available.

Default: false

$smwgNamespaceIndex If you already have custom namespaces on your site, insert
  $smwgNamespaceIndex = ???;

into your LocalSettings.php before including 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

$smwgEnableUpdateJobs SMW defers some tasks until after a page was edited by using the MediaWiki job queueing system (see http://www.mediawiki.org/wiki/Manual:Job_queue). 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 (Special:Statistics and "showJobs.php" can be used to check that), 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

$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

$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:

$smwgNamespacesWithSemanticLinks = array(
	              NS_MAIN => true,
	              NS_TALK => false,
	              NS_USER => true,
	         NS_USER_TALK => false,
	           NS_PROJECT => true,
	      NS_PROJECT_TALK => false,
	             NS_IMAGE => true,
	        NS_IMAGE_TALK => false,
	         NS_MEDIAWIKI => false,
	    NS_MEDIAWIKI_TALK => false,
	          NS_TEMPLATE => false,
	     NS_TEMPLATE_TALK => false,
	              NS_HELP => true,
	         NS_HELP_TALK => false,
	          NS_CATEGORY => true,
	     NS_CATEGORY_TALK => false,
	     SMW_NS_PROPERTY  => true,
	SMW_NS_PROPERTY_TALK  => false,
	          SMW_NS_TYPE => true,
	     SMW_NS_TYPE_TALK => false,
	       SMW_NS_CONCEPT => true,
	  SMW_NS_CONCEPT_TALK => false,
);


Interface settings[edit]

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.

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

$smwgBrowseShowInverse Should the browse view for incoming links show the incoming links via its inverses, or shall they be displayed on the other side?

Default: false

$smwgBrowseShowAll Should the browse view always show the incoming links as well, and more of the incoming values?

Default: true

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

Default: true

$smwgTypePagingLimit Number results shown in the listings on pages in the namespace Type.

Default: 200

$smwgConceptPagingLimit Number results shown in the listings on pages in the namespace Concept.

Default: 200

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

Default: 25

Query settings[edit]

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
$smwgQEnabled Activates or deactivates all query related features and interfaces.

Default: true

$smwgQMaxLimit Maximal number of results ever retrieved, even when using special query pages.

Default: 10000

$smwgQSubcategoryDepth Restrict level of sub-category inclusion (steps within category hierarchy). Use 0 to disable hierarchy-inferencing in queries

Default: 10

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

Default: 10

$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. Possible values are:
  • SMW_EQ_FULL Evaluate redirects as equality between page names in all cases.
  • SMW_EQ_SOME Evaluate redirects as equality between page names, with possible performance-relevant restrictions depending on the storage engine. This is equivalent to SMW_EQ_FULL for the default storage engine of SMW 1.2 and above!
  • SMW_EQ_NONE Never evaluate redirects as equality between page names.

Note that changing this option may only take effect after recreating all data in the database. See Repairing SMW for details.

Default: SMW_EQ_SOME

$smwgQSortingSupport Should sorting of query results be possible?

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

$smwgQComparators List of comparator characters supported by queries, separated by '|'. Possible entries for this list are
  • < (smaller than)
  • > (greater than)
  •  ! (unequal to)
  • ~ (pattern with '*' as wildcard, only for Type:String)

If unsupported comparators are used, they are treated as part of the queried value.

Default: '<|>|!'


Settings for inline queries and Special:Ask[edit]

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.

Parameter Description
$smwgQMaxSize Maximal number of conditions in queries. Use format=debug in inline queries for example sizes.

Default: 12

$smwgQMaxDepth Maximal property depth of queries, e.g. [[rel::<q>[[rel2::Test]]</q>]] has depth 2. Use format=debug in inline queries for example depth.

Default: 4

$smwgQFeatures This setting defines which query features should be available by default. Available types of features are:
  • SMW_PROPERTY_QUERY for conditions of the form [[property::...]],
  • SMW_CATEGORY_QUERY for conditions of the form [[Category:...]],
  • SMW_CONCEPT_QUERY for conditions of the form [[Concept:...]],
  • SMW_NAMESPACE_QUERY for conditions of the form [[Namespace:+]],
  • SMW_CONJUNCTION_QUERY for combinations of multiple conditions in one query,
  • SMW_DISJUNCTION_QUERY for queries using OR or ||.

These features are combined in a list, separated by |. Examples:

  • $smwgQFeatures = SMW_CATEGORY_QUERY | SMW_CONJUNCTION_QUERY; to allow only category intersections
  • $smwgQFeatures = SMW_CONCEPT_QUERY; to allow only concept queries (possibly cached)
  • $smwgQFeatures = SMW_ANY_QUERY & ~SMW_DISJUNCTION_QUERY; to allow anything but disjunctions

Default: SMW_PROPERTY_QUERY | SMW_CATEGORY_QUERY | SMW_CONCEPT_QUERY | SMW_NAMESPACE_QUERY | SMW_CONJUNCTION_QUERY | SMW_DISJUNCTION_QUERY (allow all basic features)

$smwgQMaxInlineLimit Maximal number of rows ever printed in a single inline query on a single page, even if a setting limit=... is given.

Default: 500

$smwgQPrintoutLimit Maximal number of supported printouts (added columns in result table, ?-statements).

Default: 100


Settings for concept queries[edit]

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 Help: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 responably. 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*26 (1 day)


Settings for query formatting/display[edit]

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: 'all'

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

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',
	'embedded'   => 'SMWEmbeddedResultPrinter',
	'template'   => 'SMWTemplateResultPrinter',
	'count'      => 'SMWListResultPrinter',
	'debug'      => 'SMWListResultPrinter',
	'rss'        => 'SMWRSSResultPrinter',
	'icalendar'  => 'SMWiCalendarResultPrinter',
	'vcard'      => 'SMWvCardResultPrinter',
	'csv'        => 'SMWCsvResultPrinter'
);

RSS export[edit]

Parameter Description
$smwgRSSEnabled Should RSS be enabled at all? RSS as such does not cause more load than Special:Ask, but it might attract more users.

Default: true

$smwgRSSWithPages Should RSS feeds deliver whole pages or just link to them?

Default: true


OWL/RDF export[edit]

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

$smwgOWLFullExport While this setting is disabled, the OWL/RDF export will always be OWL DL ensuring broader re-usability. If the setting is enabled, constructions that are not allowed in OWL DL may occur if specified in the wiki.

Default: false

$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/id/FOAF. An example setting would be
$smwgNamespace = 'http://example.org/id/';

Default: unset


Other settings[edit]

The following settings usually need no modification.

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 languages/SMW_LanguageXX.php to find what IDs to use for datatpyes in your language. The default corresponds to "Type:Page".

Default: '_wpg' (corresponds to Type:Page)

$smwgDefaultStore Use another storage backend for Semantic MediaWiki.

Default: 'SMWSQLStore2'

$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

$smwgAdminRefreshStore If the following is set to true, the wiki data can be repaired using the interface on the page Special:SMWAdmin. Setting this option to false does not stop ongoing repair processes.

Default: true

This is currently needed to get the tables right. Ignore it.

This documentation page applies to all SMW versions from 1.4 to the most current version.
Other versions: 1.3 – 1.3, ≥ 1      

Help:Configuration en 1.4

Personal tools