Discuss Con­figu­ration para­meter "$smwgNamespacesWithSemanticLinks"

From semantic-mediawiki.org
Help talk:$smwgNamespacesWithSemanticLinks


Thread titleRepliesLast modified
Talk Namespace with semantic links312:59, 31 March 2015
Not returning properties and/or categories in custom namespaces1403:16, 22 May 2014

Talk Namespace with semantic links

I disagree with the statement "In fact, is is not obvious what a meaningful property of a talk page could be." For instance it could be used to tag proposals for enhancements of articles / wiki pages if it is not clear whether these changes should be committed to the page directly (the wiki way), e.g. because it currently does not comply with the site guidelines. -- Anyhow, I use a semantic "recently-change" #ask query in my SMW, and I would like to see Talk Pages on that list as well. However, even though NS_TALK is set to true both in the initial $GLOBALS['smwgNamespacesWithSemanticLinks'] array and in an extra $wgNamespacesToBeSearchedDefault[NS_TALK] = true; statement (both are after the enableSemantics()-statement), the edit page keeps telling me I cannot use semantic annotations, and consequently the talk pages do not show up in my recently-changed-#ask-query. I start to wonder whether this works at all. Has anybody seen or get to work semantic annotations in SMW talk namespace? Oleander Hans (talk)

Oleander Hans (talk)13:15, 30 March 2015

Well, if you look long enough for a meaningful reason you will find one. Reality has it that everything seems possible, so I will remove this sentence.

About your issue. I just tested on my test wiki by adding
$smwgNamespacesWithSemanticLinks[NS_TALK] = true;
after the enableSemantics call and indeed properties may now be set and they also pop up in my query results. Also the help message at the top tells me that I may now add annotations to the talk pages in main talk. There must be something else in the water at your end since I cannot confirm your findings.
[[kgh]] (talk)16:31, 30 March 2015

It eventually turned out our admin had moved the wiki directory to a new location while leaving the old copy in place. Thus I was editing a localsettings.php to no effect... Sorry for the false alarm, and thank you for the (as always) kind and patient response.

Oleander Hans (talk)12:59, 31 March 2015

That was written long ago, when properties belonged to the pages' subjects, not the pages themselves; and a talk page has no subject. Now than several special properties like Modification date are introduced, this is not the case.

Alexander Mashintalk03:51, 31 March 2015

Not returning properties and/or categories in custom namespaces

I've been trying to get results across a number of namespaces and am at my wit's end.

What I've done:

  • Set $smwgNamespaceIndex = 100; in LocalSettings.php BEFORE including SMW
  • Edited my SMW_Settings.php to add
NS_BLOG => true,
NS_FOO => true,
  • Run the repair and upgrade options on Special:SMWAdmin.

The query reads:

It picks up both of those categories in the main namespace, as well as in other namespaces like User and Help, but will not pick up anything in Blog or Foo.


Aerrin99 (talk)18:54, 9 April 2013

You have to enable your cusom namespace to also store semantic annotations, e.g. with $smwgNamespacesWithSemanticLinks[NS_BLOG] = true;. Do this after you invoked the Semantic MediaWiki extension. Please never edit settings files but the LocalSettings.php file. Otherwise you are destined to run into trouble. Cheers

[[kgh]] (talk)12:41, 20 April 2013

Doing that (after reverting my SMW_Settings.php) results in an error:

Notice: Use of undefined constant NS_BLOG - assumed 'NS_BLOG' in /home/xmm/public_html/w/LocalSettings.php on line 218 Warning: Cannot modify header information - headers already sent by (output started at /home/xmm/public_html/w/LocalSettings.php:218) in /home/xmm/public_html/w/includes/WebResponse.php on line 38 Warning: Cannot modify header information - headers already sent by (output started at /home/xmm/public_html/w/LocalSettings.php:218) in /home/xmm/public_html/w/includes/WebResponse.php on line 38

Any idea why?

Aerrin99 (talk)18:38, 30 April 2013

Seems like you did something wrong with the definition of your namespace. See custom namespaces. Something like the following should be in your LocalSettings.php before the inclusion of extensions:

## Define namespaces
define( "NS_BLOG", 1030 );
define( "NS_BLOG_TALK", 1031 );

## Name namespaces
$wgExtraNamespaces[NS_BLOG] = "Blog";
$wgExtraNamespaces[NS_BLOG_TALK] = "Blog_talk";
[[kgh]] (talk)19:35, 30 April 2013

Thanks! I've tracked down the problem, I think - unfortunately not how to fix it.

The issue is that the namespaces in question are Wikilog namespaces. The extension requires me to use

Wikilog::setupNamespace( 100, 'Blog', 'Blog_talk' );

to set up the namespace. If I try it the proper way, the semantic asks work, but the wikilogs aren't wikilogs. If I try it the wikilog way, the semantic asks don't work.

I've tried moving things around to have wikilog define its namespaces before smw is included, but it doesn't seem to make a difference.

Aerrin99 (talk)20:43, 30 April 2013