Discuss Help:Configuration parameter "$smwgNamespacesWithSemanticLinks"
|Thread title||Replies||Last modified|
|Talk Namespace with semantic links||3||11:59, 31 March 2015|
|Not returning properties and/or categories in custom namespaces||14||02:16, 22 May 2014|
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)
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;
enableSemanticscall 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.
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.
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.
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
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?
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";
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.