Last modified: 2014-02-01 09:57:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59823, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57823 - $smwgNamespace seems not to working in 1.9 beta-1
$smwgNamespace seems not to working in 1.9 beta-1
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
REL1_22-branch
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-02 00:25 UTC by Jaider Andrade Ferreira
Modified: 2014-02-01 09:57 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jaider Andrade Ferreira 2013-12-02 00:25:21 UTC
$smwgNamespace seems not to working in 1.9 beta-1

http://semantic-mediawiki.org/wiki/Help:Configuration#smwgNamespace

MediaWiki: 1.22.0rc3 (0e84337)
PHP: 5.4.17 (cgi-fcgi)

Semantic MediaWiki: 1.9 beta-1
Comment 1 MWJames 2013-12-02 00:38:19 UTC
Not sure what you means by that (In reply to comment #0)
> $smwgNamespace seems not to working in 1.9 beta-1

Looking at [1] which needs $smwgNamespace to be set correctly does not show any unusual behaviour, also unit tests [2] do work as expected.

[1] http://semantic-mediawiki.org/wiki/Demo:Berlin

[2] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/includes/NamespaceExaminerTest.php

PS: Without a specific example as to why it seems that $smwgNamespace doesn't work, it will be difficult to expand the discussion on this topic.
Comment 2 Jaider Andrade Ferreira 2013-12-02 00:55:25 UTC
Ok, you are right. I'm sorry. 
Well, let's see:

If I am not wrong, we can't see $smwgNamespace behavior on semantic-mediawiki.org because $smwgNamespace is not set to a different value (it is used the default).

We can see the different $smwgNamespace behavior in semanticweb.org:

http://semanticweb.org/wiki/Special:ExportRDF/Semantic_wiki 

where 

http://semanticweb.org/Special:URIResolver/Mariano_Rico 
becomes
http://semanticweb.org/id/Mariano_Rico

because $smwgNamespace is set to 'http://semanticweb.org/id/'.

What I am trying to say is that setting $smwgNamespace to a different value the RDF export continues to deliver 'http://.../Special:URIResolver/...

(sorry my English)
Comment 3 MWJames 2013-12-02 01:01:02 UTC
$smwgNamespace and the URL resolver (Special:URIResolver/) are not related to each other. See [1].

http://semantic-mediawiki.org/wiki/Help:Pretty_URIs
Comment 4 MWJames 2013-12-02 01:04:55 UTC
(In reply to comment #3)
> $smwgNamespace and the URL resolver (Special:URIResolver/) are not related to
> each other. See [1].
> 
> http://semantic-mediawiki.org/wiki/Help:Pretty_URIs

Sorry, I have redact my comments, I was talking about $smwgNamespacesWithSemanticLinks.
Comment 5 Jaider Andrade Ferreira 2013-12-02 01:18:09 UTC
So, could you confirm the bug? :)

It's an old (but gold) feature. 
I think it first appeared in SMW at 1.5.
http://semantic-mediawiki.org/wiki/Help:Configuration_1.5#smwgNamespace
Comment 6 MWJames 2013-12-02 01:42:55 UTC
The only thing I can confirm (based on the commit history) is that non of the core-developers have changed any feature related to Special:URIResolver or $smwgNamespace since 1.8 which makes it unlikely to be an issue of 1.9.

PS: I'm still not sure I understand the exact nature of this issue (what is being expected and was is the deviation of the expected behaviour).
Comment 7 Jaider Andrade Ferreira 2013-12-02 11:43:03 UTC
Ok. Without 
$smwgNamespace = 'http://any-site.org/id/';
in LocalSettings.php, the the Special:ExportRDF gives URIs like
http://any-site.org/wiki/Special:URIResolver/Rudolph,_Sebastian
and this is the default behavior. This is fine.

With
$smwgNamespace = 'http://any-site.org/id/';
in LocalSettings.php, the the Special:ExportRDF gives URIs like
http://any-site.org/id/Rudolph,_Sebastian

But now, having 
$smwgNamespace = 'http://any-site.org/id/';
the Special:ExportRDF continues providing URIs like
http://any-site.org/wiki/Special:URIResolver/Rudolph,_Sebastian

The problem is not in SMW 1.8 because semanticweb.org is using SMW 1.8 and they have Pretty URIs, as you noted in comment 3.

This feature is more important for those who uses triple stores, SPARQL endpoints and cares about linked data, URIs, etc.

As an old (and forgotten) feature, maybe Marcus could have a look at this issue. I think he wrote most part of the RDF export, right?
Comment 8 MWJames 2013-12-09 22:55:46 UTC
Please run 'composer update' to retrieve the latests 1.9-beta. We deployed a unit test [1] that verifies the $smwgNamespace setting at the time SMW is installed [2] on the continues integration platform.

[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/system/InstallationSettingsTest.php#L47

[2] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/build/travis/before_script.sh#L70
Comment 9 Jaider Andrade Ferreira 2013-12-10 00:13:31 UTC
Thanks for the unit test, MWJames!
But, looking my configuration again, I found out what was wrong.

Apparently, this:

$smwgNamespace = 'http://any-site.org/id/';
enableSemantics( 'any-site.org' );

Was causing the problem. The correct way is:

enableSemantics( 'any-site.org' );
$smwgNamespace = 'http://any-site.org/id/';

When I removed 

require_once( "$IP/extensions/Validator/Validator.php" );
include_once( "$IP/extensions/SemanticMediaWiki/SemanticMediaWiki.php" );

from LocalSettings.php (because installation with Composer doesn't need them), the "enableSemantics( 'any-site.org' );" and other config variables stayed there. So, later, when I put $smwgNamespace = 'http://any-site.org/id/';, I didn't realize  enableSemantics was below it.

So, I am so sorry for this. 
Hint: I think RELEASE-NOTES-1.9 should mention that enableSemantics( 'any-site.org' ); is not necessary anymore, right?
Comment 10 Jaider Andrade Ferreira 2013-12-10 00:22:42 UTC
I am wrong again.

enableSemantics( 'any-site.org' );

Is still necessary. Without it the URIs become

any-site.orgSome_Page
Comment 11 MWJames 2014-02-01 09:57:20 UTC
SMW 1.9 requires enableSemantics( ... ) to be the first necessary entry in LocalSettings, see [0, 1].

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/47#issuecomment-30224224

[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/docs/INSTALL.md#step-5

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links