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

Property annotation error message-"0" has not been listed as valid URI

Lotusccong (talkcontribs)

MW - 1.39.3

SMW- 4.1.1

PHP- 7.4.33

Page Forms- 5.6.1

Page Schemas - 0.7.1

I have created a Page form with various fields with semantic properties.

My questions are as below -

1. How to know this error message applies to which property annotation?

2. Does this error message valid?  I don't see any annotation using the invalid URI scheme .

3. If we don't want to display the warning message on the page,  I set the $smwgParserFeatures configuration as below


  • SMW_PARSER_NONE – Disables query features related to the parsing of annotations on pagesIt still showed the warning message, with SMW_PARSER_NONE, it should stop show the warning message ?

When I set to SMW_PARSER_INL_ERROR , it doesn't show the warning, right after the problematic input in annotations.

Lotusccong (talkcontribs)

I managed to fixed the above issues as below -

  1. Just add the SMW_PARSER_INL_ERROR in $smwgParserFeatures.
  2. The invalid URI scheme message is due to the datatype of URL is set to hide in Page Schemas even you have the valid URI. It seems that you meed to set Display this field always or Display if not empty to avoid this error message.
  3. Just need to disable SMW_PARSER_INL_ERROR. you can check the processing error from Browse property.
Reply to "Property annotation error message-"0" has not been listed as valid URI"

wfLoadExtension( SemanticMediaWiki' ); Causes White Screen

Summary by Kghbln

Use wfLoadExtension( 'SemanticMediaWiki' );. Note the second quotation mark. (talkcontribs)

I'm having trouble after adding wfLoadExtension(SemanticMediaWiki'); to my LocalSettings.php file. When I try to view my site, I just get a white screen. When I remove the LoadExtension(), keeping just enableSemantics, the site can be accessed, but SemanticMediawiki isn't found.

Anyone run into this?

Jongfeli (talkcontribs)

If you used the code above it will not work wfLoadExtension(SemanticMediaWiki'); You forgot a quotation mark.

It should be wfLoadExtension( 'SemanticMediaWiki' );

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, (talkcontribs)

Did you figure this out?

Kghbln (talkcontribs)
Reply to "Change propagation not working"

Special:SpecialPages Breaks With SMW 4.1.0 (and MW skins?)

Summary by Kghbln

Fix published with SMW 4.1.1

Z929669 (talkcontribs)

I was having these issues upgrading on a test server:

  • MW 1.39.1
  • PHP 8.0.20
  • MariaDB 10.5.16-MariaDB
  • SMW 4.1.0

... so I installed my working PRD wiki on the test server and confirmed things generally worked.

Here's my PRD server config where all is working nicely for a few years now:

  • MediaWiki 1.35.1 (204e59b)
  • PHP 7.4.16 (fpm-fcgi)
  • MariaDB 10.4.18-MariaDB
  • SMW 3.2.2

// NOTE: wfLoadExtension( 'SemanticMediaWiki' ); is NOT invoked in the PRD wiki, as it's not needed (contrary to some of the doc saying that it is as of SMW 3.2.2 I think) ______________________

Anyway, I installed MW from tarball and all extensions I use via Composer as usual, and Special:SpecialPages and Special:UserLogin were broken with only some benign PHP deprecated messages.

After troubleshooting many things, I decided to try again and establish that MW 1.39.1 was working 'okay' on the test server under Monobook skin. From here, I installed Chameleon 4.2.1, and all was dandy under that skin. Special:SpecialPages and Special:UserLogin worked fine.

Then I installed Page Forms 5.5.1 and SMW 4.1.0 and all seemed 'okay' until I went to Special:SpecialPages, which displayed nothing but my site header (as did Special:UserLogin). Here's my invocation in LocalSettings.php:

wfLoadExtension( 'SemanticMediaWiki' ); 
enableSemantics( 'myurl.org' ); 
$smwgNamespace = 'http://myurl.org/id/';

// NOTE: wfLoadExtension( 'SemanticMediaWiki' ); I learned that it must be invoked again now (back and forth I guess), so I did so.


I know it's SMW now, because this edit to LocalSettings.php resolves:

//wfLoadExtension( 'SemanticMediaWiki' ); 
enableSemantics( 'myurl.org' ); 
$smwgNamespace = 'http://myurl.org/id/';

... even though I get SMW errors elsewhere, and my Special Pages work. Needless to say, I'm looking for any suggestions to resolve.

Here's my PHP messages from Special Pages invoked ONLY when SMW is loaded:

: foreach() argument must be of type array|object, null given in
on line

: foreach() argument must be of type array|object, null given in
on line

: foreach() argument must be of type array|object, null given in
on line

... so looks like issues with MW skins in general and Chameleon included. I have not tested if these issues persist without the Chameleon skin, but that will be my next task when I have the will to push forward (but that seems redundant, given these warnings).



Tested under Monobook skin (Chameleon/Bootstrap disabled) produces the same problem and gives stack trace:

[3ee04010f39f3ec2a7447353] /wiki/Special:SpecialPages TypeError: SMW\MessageFormatter::__construct(): Argument #1 ($language) must be of type Language, StubUserLang given, called in /srv/sites/_wiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php on line 133
from /srv/sites/_wiki/extensions/SemanticMediaWiki/includes/formatters/MessageFormatter.php(48)
#0 /srv/sites/_wiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(133): SMW\MessageFormatter->__construct()
#1 /srv/sites/_wiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(178): SMW\ParserFunctionFactory->newAskParserFunction()
#2 /srv/sites/_wiki/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(421): SMW\ParserFunctionFactory->newShowParserFunction()
#3 /srv/sites/_wiki/includes/parser/Parser.php(3443): SMW\ParserFunctionFactory->SMW\{closure}()
#4 /srv/sites/_wiki/includes/parser/Parser.php(3126): Parser->callParserFunction()
#5 /srv/sites/_wiki/includes/parser/PPFrame_Hash.php(276): Parser->braceSubstitution()
#6 /srv/sites/_wiki/includes/parser/Parser.php(2955): PPFrame_Hash->expand()
#7 /srv/sites/_wiki/includes/parser/Parser.php(962): Parser->replaceVariables()
#8 /srv/sites/_wiki/includes/parser/Parser.php(4928): Parser->preprocess()
#9 /srv/sites/_wiki/includes/language/MessageCache.php(1308): Parser->transformMsg()
#10 /srv/sites/_wiki/includes/skins/Skin.php(1586): MessageCache->transform()
#11 /srv/sites/_wiki/includes/skins/Skin.php(1552): Skin->addToSidebarPlain()
#12 /srv/sites/_wiki/includes/skins/Skin.php(1495): Skin->addToSidebar()
#13 /srv/sites/_wiki/includes/skins/Skin.php(1527): Skin->{closure}()
#14 /srv/sites/_wiki/includes/skins/SkinTemplate.php(792): Skin->buildSidebar()
#15 /srv/sites/_wiki/includes/skins/SkinTemplate.php(229): SkinTemplate->getPortletsTemplateData()
#16 /srv/sites/_wiki/includes/skins/SkinMustache.php(88): SkinTemplate->getTemplateData()
#17 /srv/sites/_wiki/includes/skins/SkinMustache.php(58): SkinMustache->getTemplateData()
#18 /srv/sites/_wiki/includes/skins/SkinTemplate.php(177): SkinMustache->generateHTML()
#19 /srv/sites/_wiki/includes/OutputPage.php(2874): SkinTemplate->outputPage()
#20 /srv/sites/_wiki/includes/MediaWiki.php(922): OutputPage->output()
#21 /srv/sites/_wiki/includes/MediaWiki.php(562): MediaWiki->main()
#22 /srv/sites/_wiki/index.php(50): MediaWiki->run()
#23 /srv/sites/_wiki/index.php(46): wfIndexMain()
#24 {main}
Z929669 (talkcontribs)

I reported this also on the git. Apologies for the redundancy. Looks like Universal-Omega has a potential fix.

C.Syde65 (talkcontribs)

It says in the page's infobox that there's a permission titled (smw-curator) However the only permission that I'm aware of that comes with this extension is the (smw-admin) permission. Does the (smw-curator) permission actually exist and is unused? Or is the information regarding the (smw-curator) permission incorrect, and there's only a usergroup under the name 'Smwcurator'?

Kghbln (talkcontribs)

Yes, there is. See this docu. There is even an "smweditor" group that came in with this pull. Still undocumented on the wiki.

C.Syde65 (talkcontribs)

I'm not seeing the (smw-curator) permission on either of the pages you linked.

Kghbln (talkcontribs)

Ah, I mixed it with the user group. I am sorry for the confusion. Indeed there is no smw-curator permission. I just updated the docu here.

Can anyone explain to me what the smwexaminer permission does?

C.Syde65 (talkcontribs)

Recently I've discovered the existence of a permission titled (smwexaminer). However the permission doesn't have a short summary explaining what it does. And I want to be able to figure out what the permission does for my research. So that I can explain what the permission does in a short sentence. For example:

  • Access to administration tasks (Semantic MediaWiki) (smw-admin)

The permission can be found on the following Fandom wikis:

I have tried asking in several Discord Servers. Including the Fandom/Gamepedia Server, the Miraheze Server, and the MediaWiki Server. I have also tried asking here. But no one has been able to provide a satisfactory response. And it has been 12 days since I asked this question on the Semantic MediaWiki mailing list.

Here are a list of pages that might make it easier to answer my question:

And here is a link to a list of system messages associated with the permission:

My best guess is that the permission either allows access to entity examinations or perform entity examinations. If anyone doesn't know the answer to my question, I would appreciate it if someone could direct me to the place where I can find someone that can answer my question.

FreedomFighterSparrow (talkcontribs)

Hi, looking at the source code for v4 and v3.2, I can't find that anywhere at all...

C.Syde65 (talkcontribs)

Not sure what Semantic MediaWiki extension it comes from. All I've been able to dig up is that it comes from a Semantic MediaWiki extension.

Cavila (talkcontribs)

Good question. I honestly don't know though I would guess that it exists because assistance with entity examinations (https://www.semantic-mediawiki.org/wiki/Help:Entity_examinations) can be disabled/enabled in your user preferences and that this behaviour relies on user permissions. You may be better off asking your question over on Github.

FreedomFighterSparrow (talkcontribs)

None of the extensions under SMW's github have this in code: https://github.com/search?q=org%3ASemanticMediaWiki+smwexaminer

Or anywhere at all on github, really. The only SMW extension I could find on that wiki with no source code published is SemanticMediaWikiHelpers - so I suggest you ask the Wikia/Fandom guys about it.

C.Syde65 (talkcontribs)

It can't be a Fandom-specific permission. As it has been imported to Translatewiki.net in multiple languages. The permission wouldn't be sufficiently important enough to have various related system messages imported to Translatewiki.net in multiple languages otherwise. Those messages date from before the time the permission showed up on Fandom wikis. Plus if they were Fandom-specific then the messages would more likely be published in this namespace instead.

Cavila (talkcontribs)

But those system messages relate only to SMW's entity examination (see also https://github.com/SemanticMediaWiki/SemanticMediaWiki/tree/master/i18n). What you are referring to above is a user permission, which is likely to be a feature from another extension that hooks into SMW, maybe because someone thought not everyone should be allowed to see or use the examiner panel. FreedomFighterSparrow might well be correct in suspecting that it was implemented in the SemanticMediaWikiHelpers extension. So not Fandom-specific but probably Runescape/Gundam-specific.

C.Syde65 (talkcontribs)

Good point. I never thought of it like that. I guess I have no choice but to do what I've been neglecting to do for the past couple of weeks. Which is send a message to Fandom and ask them whether the permission is Fandom-specific. And whether it originates from the SemanticMediaWikiHelpers extension. Anything that's RuneScape/Gundam-specific is implicitly Fandom-specific. As they are Fandom wikis.

Reply to "Can anyone explain to me what the smwexaminer permission does?"

I want to upgrade to 1.39, will Semantic be compatable?

2003:D0:170C:1B59:4D2:D048:FC91:AB0C (talkcontribs)

I want to update my wiki to 1.39 when it comes out. I then want to install semantic mediawiki. Does this make sence? Or will the compatable version of semantic come out later and i should only update to 1.38 right now?

Devaroo (talkcontribs)

The current stable release of SMW officially supports MW 1.35.0 - 1.37.x (see Help:Compatibility). However, it was said in the SMW mailing list that using SMW with MW 1.38, while not officially supported yet, should work without too many issues. In the same email it was said that using SMW with 1.39 is rather adventurous and that SMW doesn't currently have a fixed date for officially supporting MW 1.39.

Reply to "I want to upgrade to 1.39, will Semantic be compatable?"

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 1 year 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.

Return to "Semantic MediaWiki" page.