Last modified: 2014-08-14 16:01:03 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.
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.
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.
Cool, Has this code been updated in the latest SD? If so lets mark this as fixed :-D
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.
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.