Extension talk:Semantic MediaWiki

About this board

The best way for getting support for Semantic MediaWiki is to post to its user mailing list. Comments made below are not very well monitored by the developers. There are various options for making yourself heard:

  • If you have a usage question, please post them to the SMW support mailing lists (archives).
  • If you found a bug or want to propose a new feature, please file it at GitHub. Bugs and requests are regularly considered by core developers and have a great impact on the future development of SMW.
  • If you want to contribute to the development, please contact the development community at the SMW developers' mailing list (archives).

When asking for help or describing bugs, do not forget to provide necessary details about your configuration, version details for all relevant components, information about other extensions that are used, and, if possible, a URL where the problem can be seen. See the help page on reporting bugs for detailed information.

The below talk page is most useful for comments regarding the wiki page, but of course you may do as you like (it's a wiki, after all).

previous talk on this page

Semantic MediaWiki was installed and enabled but is missing an appropriate upgrade key.

Linxixixi (talkcontribs)

I installed Semantic according to the installation manual, but when I visit my site I get this error: Semantic MediaWiki was installed and enabled but is missing an appropriate upgrade key.


Semantic MediaWiki:

4.0.2 (smw:2020-04-18)





Why do I see this page?

Semantic MediaWiki's internal database structure has changed and requires some adjustments to be fully functional. There can be several reasons including:

Changes to the list of fixed properties and may require additional table(s)

Changes to the overall table structure or indices requirements

Changes to the selected storage or query engine

Changes to the required entity collation

How can I fix this error?

An administrator (or any person with administrator rights) has to run either MediaWiki's update.php or Semantic MediaWiki's setupStore.php maintenance script.

You may also consult the following pages for further assistance:

Installation instructions

Troubleshooting help page

How can I solve it please?

The mediawiki version I'm using is 1.38.2

Reply to "Semantic MediaWiki was installed and enabled but is missing an appropriate upgrade key."

Records and Result format table

Summary by Dominik Maus

Use anonymous subobjects.

Dominik Maus (talkcontribs)

Greetings everyone,

I set multiple records of the same type on a single page, and try to #show them as format=table. The table is created just fine, but the #show does not create separate table rows. For each of the records, it appends as a newline in the first table row.

I did the following:

{{#set:NeedsResource=Travertine Slab;5}}
{{#set:NeedsResource=Marble Slab;1}}
{{#show: {{FULLPAGENAME}}
|?NeedsResource.Resource = Name
|?NeedsResource.NeedMin = Name
|format = table}}

I want the query to put each of the sets into a separate table row but can't seem to find a way to do so.

Any hints are very welcome!


Dominik Maus (talkcontribs)

Installation details:

MW 1.35.0

SMW 3.2.1

SRF 3.2.0

Cavila (talkcontribs)

I keep getting Caught exception of type Flow\Exception\NoParserException when attempting to reply. Here's another try.

To store objects with their own property/value pairs, you should be using #subobject, not #set. See https://www.semantic-mediawiki.org/wiki/Help:Adding_subobjects. Or alternatively, place each set on its own page, if that works for you.

Dominik Maus (talkcontribs)

I've tried the subobject approach, but it enlists everything in one single table row aswell. Own page is a no-go. I want to set multiple properties of the same name for the same page, which works, just not the query results.

Cavila (talkcontribs)

When I add subobjects and query them, e.g.

{{#ask: [[-Has subobject::{{FULLPAGENAME}}]] |?NeedsResource }}

I do get two distinct rows.

Just for clarity, I'm asuming there's a semicolon because you've defined the property as being one of data type "Record", right?

Dominik Maus (talkcontribs)

Yes that is correct, I wanted it to be a record with a few subproperties.

If I do this one:

{{#subobject: test
{{#subobject: test

{{#ask: [[-Has subobject::{{FULLPAGENAME}}]] |?test}}

there is only a single row:

Cavila (talkcontribs)

I see, the problem is that you've given them identical names (test), which translates to a single subobject rather than two. You can either give them distinct names (e.g. test1 and test2) or leave that part blank, in which case SMW defaults to anonymous, hash-based identifiers.

Dominik Maus (talkcontribs)

Oh nice, the anonymous did the trick! Thanks!

Semantics for updated/new subobjects not available after page edit

Summary last edited by Kghbln 08:23, 7 May 2022 3 months ago

It was an internal configuration issue. Also tracked on GitHub.

Mourawi (talkcontribs)

Migrated to :

  • MW 1.35.6
  • SMW: 4.0.1
  • Page Forms: 5.4

Observing issues with processing of subobjects (#subobject tag).

Data pages are created with Page Forms forms (with 'embed in field' option). Content of created/updated pages look good (all subobject templates are defined properly).

However, after saving edited page, the subobject query on these pages shows an 'old' content of subobjects (before edit). The updated content of subobjects is properly displayed only AFTER the page is REFRESHED (seems like subobjects creation/updates are deferred and not available just after edit). Obviously it is not desired from the user perspective.

How to fix that ?

PS. The same code worked fine (as we would expect, with updated subobjects properly displayed just after edit) before our migration: with MW 1.34.4, SMW 3.1.6, Page Forms: 4.9.5 ... also with Semantic Internal Object extension.

This post was hidden by Mourawi (history)
Mourawi (talkcontribs)

It was an internal configuration issue.

Tenbergen (talkcontribs)

I just tried to set up MW1.37 on my test wiki, and with SMW installed it broke pretty hard. This page says support is only up to 1.35.x. What are the plans to start supporting modern versions of Mediawiki? How far behind does an extension need to be before Extension status should be set to "unmaintained"?

Tenbergen (talkcontribs)

I also posted this question in the SMW mailing list and the suggestion was to get the master dev version:

  1. edit composer.local.json from "mediawiki/semantic-media-wiki": "*" to "mediawiki/semantic-media-wiki": "dev-master",
  2. run composer update --no-dev

That's not a long term solution, but it got me up and running, so sharing it here.

Gachangi (talkcontribs)

I downgraded to composer 2.1.3 and "mediawiki/semantic-media-wiki": "~4.0" nd worked. Composer 2.2.6 release 4-feb-22 seemed to break my installation of SMW.

Reply to "Unmaintained?"

Semantic MediaWiki and Wikibase - renaming the namespace 'property'

MW Kappa (talkcontribs)

In our wiki (MW 1.35.5) we are running the extensions Semantic MediaWiki (4.0.0) and Wikibase. Semantic MediaWiki and Wikibase both add a namespace called property. This results in a conflict. The documentation of the extension Semantic Wikibase proposes to rename either the Wikibase property namespace or the Semantic MediaWiki property namespace (https://github.com/ProfessionalWiki/SemanticWikibase#semantic-wikibase) (4.2.2022). However, the solution suggested there did not work for us. We therefore would like

  1. to share our experience with the solution suggested for Semantic Wikibase
  2. to share our solution of renaming the Semantic MediaWiki property namespace
  3. to ask the Semantic MediaWiki community, whether there is a better solution which can be coded in the LocalSettings file rather than in the extension's core

Semantic Wikibase: suggestion for renaming the Wikibase property namespace or the Semantic MediaWiki property namespace

The suggested solution at https://github.com/ProfessionalWiki/SemanticWikibase#semantic-wikibase is:

"Renaming the Wikibase property namespace:

$wgExtraNamespaces[WB_NS_PROPERTY] = 'WikibaseProperty';
$wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'WikibaseProperty_talk';

Renaming the SMW property namespace:

$wgExtensionFunctions[] = function() {
    $GLOBALS['wgExtraNamespaces'][SMW_NS_PROPERTY] = 'SemanticProperty';
    $GLOBALS['wgExtraNamespaces'][SMW_NS_PROPERTY_TALK] = 'SemanticProperty_talk';

You can choose what to rename these namespaces to."

The problems we encountered with this solution are:

  • If the Wikibase namespace is renamed the properties will not be transferred into the triple store database (Blazegraph).
  • If the Semantic MediaWiki namespace is renamed with the variable $wgExtensionFunctions the renaming does not take effect in all places where it should. One example: the page 'Special:RecentChanges' lists a property 'highest point (P1)'. When hovering over the associated link, the message correctly shows 'Property:P1'. A click on this link, however, leads to a non-existing page 'SemanticProperty:P1'.

Another solution for renaming the Semantic MediaWiki property namespace

Our current solution is

  • entry in LocalSettings.php
 $wgExtraNamespaces[102] = "SemanticProperty";
 $wgExtraNamespaces[103] = "SemanticProperty_talk";
 wfLoadExtension( 'SemanticMediaWiki' );
 enableSemantics( 'localhost' );
  • renaming the namespace in $IP/extensions/SemanticMediaWiki/src/NamespaceManager.php
public static function getCanonicalNames() {
		$canonicalNames = [
			# SMW_NS_PROPERTY      => 'Property',			// original version
			# SMW_NS_PROPERTY_TALK => 'Property_talk',		// original version
			SMW_NS_PROPERTY      => 'SemanticProperty',		// renaming
			SMW_NS_PROPERTY_TALK => 'SemanticProperty_talk',	// renaming
			SMW_NS_CONCEPT       => 'Concept',
			SMW_NS_CONCEPT_TALK  => 'Concept_talk',
			SMW_NS_SCHEMA        => 'smw/schema',
			SMW_NS_SCHEMA_TALK   => 'smw/schema_talk',
			SMW_NS_RULE          => 'Rule',
			SMW_NS_RULE_TALK     => 'Rule_talk'
		return $canonicalNames;


We dislike the intervention in the core of the extension. Does anybody have a better suggestion? We would appreciate comments on our experience and approach. MW Kappa (talk) 15:39, 4 February 2022 (UTC)

Reply to "Semantic MediaWiki and Wikibase - renaming the namespace 'property'"

SemanticMW for MediaWiki 1.36.1

Mdyug (talkcontribs)

when will there be an update SemanticMW for MediaWiki 1.36.1 with installation instructions? I'm thinking - delete my site and install the 1.35.x version of MW, or maybe wait a little when the update SMW comes out for 1.36.1 ? Please tell me if an update is planned in the next 2-3 months or not?

Reply to "SemanticMW for MediaWiki 1.36.1"

Semantic Mediawiki on a fresh 1.35.0 MW

OnodOfTheNorth (talkcontribs)

I'm attempting to install semantic media wiki but I'm having trouble with composer and making a working composer.local.json file. has anyone managed to get a working SMW instance working using the instructions on SMW website? if so could you give me a detailed instructions including the composer instructions. using composers website and SMW has either given me DB error messages or just failed to add the extension at all. any help would be appreciated.

Jongfeli (talkcontribs)

A little more information would be helpful, like what os, db and php versions you are using. This means are you using supported versions of this software and do you have shell access. It should be no problem getting Semantic Mediawiki (SMW) running. First step is to get a clean Mediawiki site running with all extensions disabled when possible. Then "install" SMW using the documentation on the SMW website. Below our composer.local.json but you should start with only adding SMW.

    "require": {
		"mediawiki/semantic-media-wiki": "~3.2",
		"mediawiki/semantic-result-formats": "~3.2",
		"mediawiki/sub-page-list": "*"

	"extra": {
		"merge-plugin": {
			"include": [
Reply to "Semantic Mediawiki on a fresh 1.35.0 MW"

Change propagation not working

Kafir55 (talkcontribs)

We are running MW 1.35 and SMW 3.2.2. Our users just stumbled into a problem when they create category or subcategory pages with a [[category:myname]] tag. This seems to trigger a "change propagation" job. The problem is the job never completes and the page becomes hopelessly locked from further edits. In the MW exception log I see messages like the following:

2021-05-18 20:26:07 ocwikidev mediawiki: [YKQixs046bus0GlZuCCtDgAAAAc] [no req]   RuntimeException from line 70 of /home/appl/mediawiki-1.35.1/extensions/SemanticMediaWiki/src/Utils/File.php: /tmp/smw_chgprop_admr20ciahq0_0.tmp is not readable.

#0 /home/appl/mediawiki-1.35.1/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/ChangePropagationDispatchJob.php(352): SMW\Utils\File->read()

#1 /home/appl/mediawiki-1.35.1/extensions/SemanticMediaWiki/src/MediaWiki/Jobs/ChangePropagationDispatchJob.php(199): SMW\MediaWiki\Jobs\ChangePropagationDispatchJob->dispatchFromFile()

#2 /home/appl/mediawiki-1.35.1/includes/jobqueue/JobRunner.php(372): SMW\MediaWiki\Jobs\ChangePropagationDispatchJob->run()

#3 /home/appl/mediawiki-1.35.1/includes/jobqueue/JobRunner.php(333): JobRunner->doExecuteJob()

The /tmp directory is readable and writable by anyone, so I'm not sure why it is complaining here. Is there some way to redirect that path to someplace other than /tmp? Any other ideas as to how I can resolve this situation for our users?

Thanks in advance,

Reply to "Change propagation not working"

SMW and Cargo compatibility

Summary by Kghbln

Possible without issues.

Lakelimbo (talkcontribs)


Currently I use Cargo on my wiki, but I'm planning to switch to Semantic MediaWiki soon. However, I have quite a lot of data on Cargo already and it would take some time to switch everything to SMW. Because of this, I wonder if it's possible to have Cargo and SMW installed at the same time without any compatibility issues.


Kghbln (talkcontribs)

I do not have first hand experience here but it should be possible without problems.

FreedomFighterSparrow (talkcontribs)

I'm running both and have no issues.

Upgrading mediawik 1.31.8 to 1.35.1 and SMW 3.2.3

Legaulph (talkcontribs)
MediaWiki 1.35.1
PHP 7.4.15 (apache2handler)
MySQL 8.0.23
Semantic MediaWiki 3.2.3
Semantic Extra Special Properties 2.1.0

When running php maintenance\update.php I'm getting the following error. Importing from sesp.groups.json ...

 ... smw/schema:Group:Extra special properties ...               [FAILED]
     ├ smw-schema-error-input-schema, property-group-schema.v1
     └ smw-schema-error-violatio ... lue found, but an object is required
 ... smw/schema:Group:Exif special properties ...                [FAILED]
     ├ smw-schema-error-input-schema, property-group-schema.v1
     └ smw-schema-error-violatio ... lue found, but an object is required
 ... done.

Importing from smw.groups.json ...

 ... smw/schema:Group:Schema properties ...PHP Notice:  Undefined index: implicit in D:\Bitnami\wampstack\apps\mediawiki\includes\user\UserGroupManager.php on line 267

Notice: Undefined index: implicit in D:\Bitnami\wampstack\apps\mediawiki\includes\user\UserGroupManager.php on line 267

 ... smw/schema:Group:Predefined properties ...PHP Notice:  Undefined index: implicit in D:\Bitnami\wampstack\apps\mediawiki\includes\user\UserGroupManager.php on line 267

Notice: Undefined index: implicit in D:\Bitnami\wampstack\apps\mediawiki\includes\user\UserGroupManager.php on line 267

 ... done.

Importing from smw.vocab.json ...

 ... MediaWiki:Smw import skos ...                          [EXISTS,SKIP]
 ... MediaWiki:Smw import foaf ...                          [EXISTS,SKIP]
 ... MediaWiki:Smw import owl ...                           [EXISTS,SKIP]
 ... Property:Foaf:knows ...                                [EXISTS,SKIP]
 ... Property:Foaf:name ...                                 [EXISTS,SKIP]
 ... Property:Foaf:homepage ...                             [EXISTS,SKIP]
 ... Property:Owl:differentFrom ...                         [EXISTS,SKIP]
 ... done.


Reply to "Upgrading mediawik 1.31.8 to 1.35.1 and SMW 3.2.3"
Return to "Semantic MediaWiki" page.