Last modified: 2014-09-23 19:36:36 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 T29445, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27445 - When SMW_QueryPrinter maxRecursionDepth >2, properties can get inherited via embed queries
When SMW_QueryPrinter maxRecursionDepth >2, properties can get inherited via ...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Markus Krötzsch
http://sandbox.semantic-mediawiki.org...
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-16 07:44 UTC by Alex
Modified: 2014-09-23 19:36 UTC (History)
1 user (show)

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


Attachments
Patch to enable different "classes" of recursion via SMW_QueryPrinter.php: Semantic and non-Semantic (2.50 KB, patch)
2011-02-16 07:44 UTC, Alex
Details

Description Alex 2011-02-16 07:44:59 UTC
Created attachment 8149 [details]
Patch to enable different "classes" of recursion via SMW_QueryPrinter.php: Semantic and non-Semantic

An example appears in the link above, but this may introduce new issues because maxRecursionDepth on that wiki appears to be set to 2. (It also demonstrates how to circumvent maxRecursionDepth to accomplish infinite recursion. This may be expected behavior because the way I did it to get around maxRecursionDepth seems to be a very foolish way to do things, but users can be unpredictable, so you may want to look into this...). 

In any case, based on the following, properties get inherited via embed queries when maxRecursionDepth is set to >2 (MW 1.16.2, SMW 1.5.5.1; also observed for MW >1.15, SMW >1.5). maxRecursionDepth must be set to at least 3 for this to work: 

--Page 1--
[[Property::Page 1's value]]
{{#ask: [[Subpage of::page 1]]
|format=embedded
|embedonly=true
}}

--Page 2--
[[Property::Page 2's value]]
<noinclude>[[Subpage of::Page 1| ]]</noinclude>
{{#ask: [[subpage of::Page 2]]
|format=embedded
|embedonly=true
}}

--Page 3--
[[Property::Page 3's value]]
<noinclude>[[Subpage of::Page 2| ]]</noinclude>
{{#ask: [[Subpage of::Page 3]]
|format=embedded
|embedonly=true
}}

--Page 4--
[[Property::Page 4's value]]
<noinclude>[[Subpage of::Page 3| ]]</noinclude>
{{#ask: [[Subpage of::Page 4]]
|format=embedded
|embedonly=true
}}

Desired/expected result: Page 1 displays all content from pages 1-4, but holds only its own semantic data. Subpages display all content from lower subpages, but each page holds only its own semantic data. 

Actual result: Page 1 displays all content from pages 1-4, but holds semantic data from all pages; Page 2 displays pages 2-4, but also holds property values for pages 2-4, page 3 displays pages 3-4, but also holds values for 3 and 4, and only page 4 holds values for itself alone. This appears to run counter to the comment at the bottom of http://semantic-mediawiki.org/wiki/Help:Embedded_format that "SMW will take care that embedded articles do not import their semantic annotations, so these need not be treated specifically."

Similar bug: https://bugzilla.wikimedia.org/show_bug.cgi?id=26658 ({{#set: values always inherited). 

The attached patch creates two levels of recursion: The first, maxRecursionDepth, so that properties never get inherited beyond maxRecursionDepth unless the user specifically causes that to happen (e.g., by using an array to set property values via a query against the embedded page; absent the ability to switch semantics on/off inside a query, I think that is a good way to go because it prevent accidental property inheritance). The second, maxRecursionDepthNonSemantic, displays embedded page content with live links down to 10 levels of recursion so users can click to navigate, but the associated semantic data is not parsed, thus, properties are not inherited via embed queries. 

Using this patch and setting maxRecursionDepth to 1 in LocalSettings.php obtains the desired result, above. 

Access to a private system demonstrating this can be provided on request. Unfortunately, this patch does not address the issue in bug 26658.
Comment 1 p858snake 2011-04-30 00:10:12 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 2 Sumana Harihareswara 2011-12-23 18:15:37 UTC
Alex, I've added the "need-review" keyword to indicate patch awaits review, and pinged a SMW developer to ask him to review the patch.

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


Navigation
Links