Last modified: 2011-05-26 20:49:34 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 T31041, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29041 - SMWSQLStore2::getPropertyValues() fails for some special properties
SMWSQLStore2::getPropertyValues() fails for some special properties
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Highest normal (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-18 20:39 UTC by Yaron Koren
Modified: 2011-05-26 20:49 UTC (History)
1 user (show)

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


Attachments

Description Yaron Koren 2011-05-18 20:39:34 UTC
I modified the Semantic Forms and Semantic Drilldown extensions to "work" with SMW 1.6, but they still don't actually work: calling SMWSQLStore2::getPropertyValues() fails when trying to get all values of a special property for a specific page. I think this might actually be two bugs in one: the first one is that the property object passed in to getPropertyValues(), of type SMWDIProperty, has to be initialized with a label (e.g., "Has filter"), and not an ID (e.g., "_SD_F"), as one would expect, for the querying to work at all. But even then, it only works for some special properties - I don't really understand why it works in some cases and not others.
Comment 1 Yaron Koren 2011-05-18 20:41:42 UTC
Set to "Highest" importance - this prevents a number of important SMW-based extensions from working.
Comment 2 Markus Krötzsch 2011-05-19 13:10:32 UTC
I need some more information to debug this. Please note that SMW itself is using many special properties, and would widely fail if this was a general problem. So it seems that only a few special properties are affected.

Some of the Semantic Forms properties currently have a problem with the datatype they are using, or that they are supposed to be using. Namely, there used to be a special data value "SimpleWikiPage" that represented pages but stored only their DBKey string. This is no longer supported in SMWSQLStore2 at the moment: either the data is a wiki page (then it consists of all the data related to a page) or it consists of a string only (then it must be a string or URI or similar). The problem might be in the internal assignment of SF special properties to special tables that can only keep string data.

I do not see how this would relate to the initialization issue that you mentioned. The property data item that you get by initializing from a special property label (using the static method) should be exactly the same that you get by initializing from the respective property key. However, if you provide the label as a key, then it will not be the same special property but rather a normal property named like the label of the special one. This would explain why the type problem does not occur in this case, since the property is then not treated in any special way.

Could you provide a list of the affected properties and their types?
Comment 3 Yaron Koren 2011-05-19 13:44:06 UTC
Hi - thanks for looking into this. The obvious special property to look at is the one I mentioned before - "Has filter" in Semantic Drilldown - because it's very easy to reproduce the problem, assuming you have Semantic Drilldown installed. (If you'd prefer to look at a problem in Semantic Forms, let me know.) That property is defined as type "_wpg", on line 154, here:

http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SemanticDrilldown/includes/SD_GlobalFunctions.php?revision=88214&view=markup

With this code, and the latest SMW, no filters show up when looking at Special:BrowseData. However, in line 21, here:

http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/SemanticDrilldown/includes/SD_Utils.php?revision=88214&view=markup

...if the SMWDIProperty() constructor is passed in the string "Has_filter", instead of the property ID ("_SD_F"), then the filters show up.
Comment 4 Markus Krötzsch 2011-05-26 07:35:55 UTC
I tried but cannot reproduce the problem yet. Here is what I did:

* Install SD from SVN
* Create a page "Drilldown test" with the text "[[has filter::Filter:Testfilter]]"
* Add the following to Localsettings:

$wgExtensionFunctions[] = 'runMyTests';
function runMyTests() {
	$store = smwfGetStore();
	$page = new SMWDIWikiPage( 'Drilldown_test', NS_MAIN, null );
	$property = new SMWDIProperty( '_SD_F' );
	debug_zval_dump( $store->getPropertyValues( $page, $property, null ) );
}

Debug output:

array(1) refcount(2){
  [0]=>
  object(SMWDIWikiPage)#36 (3) refcount(1){
    ["m_dbkey":protected]=>
    string(4) "Testfilter" refcount(1)
    ["m_namespace":protected]=>
    long(170) refcount(1)
    ["m_interwiki":protected]=>
    string(0) "" refcount(1)
  }
}

I can also see the "has filter" value in Special:Browse. The only place where "has filter" is currently missing is the RDF export -- this needs to be fixed. Currently extension builtin properties do not get a URI assigned. But this does not affect data retrieval in SMW.
Comment 5 Yaron Koren 2011-05-26 20:49:34 UTC
Aha! Thanks - that little script helped me to debug the issue. It turned out that I just needed to refresh all the semantic data; I didn't realize that a refresh was needed. After doing a full data refresh, it started to (mostly) work, and then I was able to debug the rest in SD. I'm marking this as "invalid".

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


Navigation
Links