Semanticmediawiki: Use of the `InternalParseBeforeLinks` hook

Created on 18 Apr 2020  路  6Comments  路  Source: SemanticMediaWiki/SemanticMediaWiki

Someone pointed me towards [0] "Deprecate InternalParseBeforeLinks hook".

[1] clarifies the task that is expected to be carried out by the hook which has been an integral part of Semantic MediaWiki since the 1.0 [2] (Dec 31, 2007) release. Removing the hook will mean Semantic MediaWiki will no longer work as designed and any wiki that deploys the software will more or less break.

Aside from breaking entire wikis, I'm guessing that around 50% of the tests (~4000 tests) will break as well.

And no, the parser function #set is no equivalent replacement for the [[Foo::Bar]] syntax.

TODO: investigate whether SemanticMediaWiki can use alternatives.

I'm ears but tests are to remain untouched and have to work as before otherwise the situation remains unchanged and will mostly likely break wikis in their present form.

[0] https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/589463/
[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/commit/47e1af9e77f59714b9897bbd96954522e6d4e0b4
[2] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/1.0/includes/SMW_GlobalFunctions.php#L141

mediawiki

Most helpful comment

Just noticed that in the recent Wikimedia Tech Talk[0] it was mentioned that InternalParseBeforeLinks will not be implemented in Parsoid and no similar functionality will be provided. The presentation also assumes that SMW _can probably use parser hooks instead_.

I just thought it was worth noting here.

[0] https://youtu.be/lS1xPkERWCM?t=2146

All 6 comments

And no, the parser function #set is no equivalent replacement for the [[Foo::Bar]] syntax.

Indeed is not and there is currently no direct replacement. Not being able to use the in-text annotation syntax [[Foo::Bar]] will affect 99,99 % of all wikis using SMW.

Given the insulting and disgraceful comments I personally received from some people regarding the syntax changes concerning the list format rework that came with SMW 3.0 I am not expecting to receive friendlier comments regarding what may lay ahead here in case ...

Personally I think that a) a solution should be found to keep in-text annotations work for existing users and b) an alternative parser function should be provided for starters of new wikis to avoid in-text annotations using the existing syntax.

an alternative parser function should be provided for starters of new wikis to avoid in-text annotations using the existing syntax.

There isn't really one because each call to a {{#foo: ... }} parser function is expensive and cannot be compared with parsing an entire "raw" text that replaces the specific annotation syntax. Processing a text with hundreds of embedded {{#foo: ... }} or simply parsing a text in one go from top do down to filter the [[Foo::Bar]] syntax is an order of magnitude and the reason why {{#foo: ... }} cannot replace [[...::...]].

The discussion whether a template is preferred or required to make structured information available to a text body is orthogonal to this issue.

Moreover we have to note that {{#foo: bar=baz }} appears to be rather clumsy compared to [[Bar::Baz]].

I am not saying that will be a big fan but I think it will still be good to have it in some use cases.

The discussion whether a template is preferred or required to make structured information available to a text body is orthogonal to this issue.

This is indeed a technical discussion and not a philosophical one.

Question: @mwjames does this also affect {{#ask: [[Foo::Bar]] }} syntax?
EDIT: there are also the "invisible" [[SMW::off]] and [[SMW::on]].

@mwjames does this also affect {{#ask: [[Foo::Bar]] }} syntax?

As for {{#ask: [[Foo::Bar]] }} here [[Foo::Bar]] is part of the {{ ... }} context and is parsed differently.

EDIT: there are also the "invisible" [[SMW::off]] and [[SMW::on]].

Context that relies on those markers will be affected.

Just noticed that in the recent Wikimedia Tech Talk[0] it was mentioned that InternalParseBeforeLinks will not be implemented in Parsoid and no similar functionality will be provided. The presentation also assumes that SMW _can probably use parser hooks instead_.

I just thought it was worth noting here.

[0] https://youtu.be/lS1xPkERWCM?t=2146

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SteveRMann picture SteveRMann  路  4Comments

akuckartz picture akuckartz  路  3Comments

mwjames picture mwjames  路  3Comments

djoris picture djoris  路  4Comments

seth2740 picture seth2740  路  3Comments