Jump to content

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


#Ask with APOSTROPHE Fails miserbly.

1
Summary by MvGulik

Resolved (still weird SMW shit)

MvGulik (talkcontribs)

Anyone can explain why the following Keyword use:

1) With "{{#ask: [[MyProperty::{{PAGENAME}}]]|..}}" on page "My'page title" DON'T works (at all).
2) And "{{#ask: [[MyProperty::My'page title]]|..}}" will (always) work. (I of course need case 1 to work)

... And maybe a solid solution to this, other than switching the datatype to "text".

How to persist settings of 'rebuildElasticIndex.php'?

2
S0ring (talkcontribs)

Using MW 1.39.7 & SWM 4.1.3 and ES 7.10.2 for data storage in a Docker container, after restarting the container it necessary to run manually the rebuildElasticIndex.php script, there are always tasks in pending:

The installation of Semantic MediaWiki has classified the following tasks as incomplete and an administrator (or user with sufficient rights) is expected to resolve those tasks before users continue to create or alter content.

Tasks

   The ElasticStore has been selected as default store, yet the extension was unable to find any record that the rebuildElasticIndex.php script was executed, please run the script as instructed.

When $smwgDefaultStore parameter is set

$smwgDefaultStore = 'SMW\Elastic\ElasticStore';

the documentation https://www.semantic-mediawiki.org/wiki/Help:$smwgDefaultStore indicates to run the script manually:

If you change the setting for this configuration parameter, please ensure to run maintenance script "setupStore.php" followed by maintenance script "rebuildElasticIndex.php".

but is there any possibility to persist it?

S0ring (talkcontribs)

It seems the issue doesn't occur anymore, after container restart no tasks in pending (I just moved .smw.json to /usr/local/bin/smw, but it should't affect the index)

Reply to "How to persist settings of 'rebuildElasticIndex.php'?"

Can anyone explain to me what the smwexaminer permission does?

8
Summary by C.Syde65

Permission is specific to Fandom. And is not bundled with any of the public Semantic MediaWiki extensions.

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.

What does Semantic MedaiWiki do?

1
Novem Linguae (talkcontribs)

Maybe I'm a bit slow, but after reading this page, I'm still unsure exactly what Semantic MediaWiki does or how it works. Consider expanding the description, adding examples, and adding screenshots.

Reply to "What does Semantic MedaiWiki do?"

Wikicode generated by a LUA module

2
193.56.33.6 (talkcontribs)

Hello,


-I want to generate a part of my Wikicode in a template through a LUA module.


-I call so my LUA function which is in a template, the argument is a parameter of that template.

My module works fine by itself since it generates the right Wikicode i want when i call the template.

The module is supposed to add "|?{{{parameter}}}={{{parameter2}}}" to my #Ask request in my template.


-The issue is that this part of the Wikicode isn't interpreted at all.

The #Ask request works, but not the module part in it. However, if i add the module part of the code by hand, it works.

So here is my guess, LUA's generated code isn't reinterpreted inside a Wiki page.


-If anyone had a clue on how to fix this issue, which is not a bug since it's probably a wanted feature, i would be glad to hear it.


-Here are my spec :


MW : 1.36.3


PHP : 7.4.27


LUA : 5.1.5


SMW 3.2.3


Page Forms : 5.3.4


Thanks for your reading and for your upcoming answers.

Have a great day !

Cavila (talkcontribs)
Reply to "Wikicode generated by a LUA module"

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

2
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

$smwgParserFeatures = SMW_PARSER_NONE | SMW_PARSER_UNSTRIP|SMW_PARSER_LINV;

  • 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

2
Summary by Kghbln

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

173.239.211.44 (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

3
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,

71.161.89.242 (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?)

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

Warning
: foreach() argument must be of type array|object, null given in
/srv/sites/_wiki/includes/skins/BaseTemplate.php
on line
257

Warning
: foreach() argument must be of type array|object, null given in
/srv/sites/_wiki/includes/skins/BaseTemplate.php
on line
257

Warning
: foreach() argument must be of type array|object, null given in
/srv/sites/_wiki/skins/chameleon/src/ChameleonTemplate.php
on line
160

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

Thanks

___________________

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
Backtrace:
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.