Last modified: 2014-08-14 16:01:03 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 T23891, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21891 - Namespace usage inconsistency between the 'has default form' and 'has filter' special properties.
Namespace usage inconsistency between the 'has default form' and 'has filter'...
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
SemanticDrilldown (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Yaron Koren
:
Depends on: 21934
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-19 01:26 UTC by Dan Bolser
Modified: 2014-08-14 16:01 UTC (History)
2 users (show)

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


Attachments

Description Dan Bolser 2009-12-19 01:26:37 UTC
Why does the 'Has default form' special property (from SF) not require the 'Form:' namespace prefix, while the 'Has filter' special property (from SD) does require the 'Filter:' namespace?

This is inconsistent and confusing to users. Both forms should work with or without their respective namespaces.

Cheers,
Dan.
Comment 1 Markus Krötzsch 2009-12-23 17:38:41 UTC
The mentioned properties are not part of SMW. Reassigning the bug to Drilldown (but probably just to resolve as "WONTFIX" or "LATER").

The reason for the discrepancy is that SMW is aware of the Form namespace and provides a special handling for it, including a datatype implementation that allows users to omit the Form: prefix. This was done for reasons of peformance, since SMW can thus store form data in its special properties table that is faster to query (the form properties are queried very often since they are relevant to display page actions). For drilldown filters, this special handling is not needed. SMW's datatype managemen is currently not flexible enough to allow extensions to add new datatypes that are not stored in the attributes table (which would not be suitable for properties that refer to wiki pages). Changing SMW's datatype system to allow more control of storage options requires some more changes, so the matter can probably not be solved right now. I have added a bug (Bug 21934) for SMW to implement this better customisability.

Comment 2 Markus Krötzsch 2009-12-30 10:52:46 UTC
This problem can now be addressed by introducing a new custom extension datatype in Semantic Drilldown. Below is example code on how to do this. The code works in LocalSettings.php but obviously it should rather be split across multiple files in any given extension (use autoloading to let PHP locate the datatype class when given in a separate file).

Example on how to set up a custom wiki page type that enforces values to be in the Help namespace:

class MyHelpPageValue extends SMWWikiPageValue {
	public function __construct($typeid) {
		parent::__construct($typeid);
		$this->m_fixNamespace = NS_HELP;
	}
}

$wgHooks['smwInitDatatypes'][] = 'myinitDatatypes';

function myinitDatatypes() {
	SMWDataValueFactory::registerDatatype('___help', 'MyHelpPageValue', 'Helppage');
 	SMWDataValueFactory::registerDatatypeAlias('___help', 'Help page');
	return true;
}

The type in this example will be called "Helppage" in the wiki, and "Help page" will work as an alias. Please use "___" as a prefix for the type id to prevent clashes with future types used in SMW. Similar code can also be used for other custom types, where types that do not derive from SMWWikiPageValue are treated like Strings/Numbers. Custom types based on long strings (Text) are not supported.
Comment 3 Dan Bolser 2010-05-28 09:52:23 UTC
Cool, 

Has this code been updated in the latest SD?

If so lets mark this as fixed :-D
Comment 4 Dan Bolser 2011-09-30 09:25:08 UTC
I also noticed that the special property 'Subproperty of' is described as if it must be assigned using [[subproperty of::Property:x]] here:
http://semantic-mediawiki.org/wiki/Property:Subproperty_of


However, the Property ns is redundant, so I updated the docs.
Comment 5 Yaron Koren 2014-08-14 16:01:03 UTC
Now that the special properties have been deprecated in Semantic Drilldown v2.0 (replaced by #drilldowninfo), I think we can call this bug invalid... sorry it didn't get fixed before.

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


Navigation
Links