Page MenuHomePhabricator

URI generation in RDF export partly lacks port information
Closed, InvalidPublic

Description

Here is a sample RDF export from a server that publishes HTTP to port 90:

<!ENTITY wiki 'http://mc28gla/HUB/index.php?title=Special:URIResolver/'>

<!ENTITY property 'http://mc28gla/HUB/index.php?title=Special:URIResolver/Property-3A'>

<!ENTITY wikiurl 'http://mc28gla:90/HUB/index.php?title='>

Apparently, the URIs of "wiki" and "property" are generated in a way that does not take into account the port number. This should be improved.

Note that the RDF is not incorrect because of this. It simply uses identifiers (URIs) that cannot be used for retrieving further data (i.e. the exported RDF is no longer "linked").


Version: unspecified
Severity: minor

Details

Reference
bz19141

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:39 PM
bzimport set Reference to bz19141.

Workaround: One can use the $smwgNamespace setting in LocalSettings to provide the correct base URI manually. See http://semantic-mediawiki.org/wiki/Help:Configuration#smwgNamespace.

Thinking about this problem again, I note that it is not a bug but expected behavior that can easily be customized: The main purpose of URIs is to provide unique identifiers for wiki pages. This is why they should not depend on the way in which the wiki is called. However, the port number can only be determined automatically based on the current request. So if the wiki was reachable via multiple ports, then the URIs would be different depending on how the wiki is accessed.

In order to solve this problem, SMW does not automatically generate the base URI but rather lets the user set it explicitly: it is the single parameter given to "enableSemantics()" in LocalSettings.php. In order to get port numbers in URIs, it is enough to add the port number to this parameter.