Last modified: 2012-11-01 18:12:24 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 T33344, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31344 - Records with duplicate properties show same value multiple times
Records with duplicate properties show same value multiple times
Status: RESOLVED DUPLICATE of bug 30482
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-04 12:37 UTC by Thomas Schweitzer
Modified: 2012-11-01 18:12 UTC (History)
2 users (show)

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


Attachments

Description Thomas Schweitzer 2011-10-04 12:37:17 UTC
I define the property "Property:Married To" like this:

[[has type::Record]]
[[has fields::Has Husband;Has Child;Has Child]]

As far as I know it is allowed to have the same property (e.g. Has Child) several times in a record, however, the order of annotations is not guaranteed.

Now an annotation in article "Mary":

[[Married To::Paul; Peter; John]]

This is rendered as:
Paul (Peter, Peter)

However, the expected value is:
Paul (Peter, John)

The fact box shows the property "Married to" but no values at all.

Furthermore, there seems to be a bug in the API of SMW. I try to retrieve all properties of a record like this:

$relationTitle = Title::newFromText($relationName, SMW_NS_PROPERTY);
$relationDI = SMWDIWikiPage::newFromTitle($relationTitle);
$fieldsProp = SMWDIProperty::newFromUserLabel("_LIST");
$fields = smwfGetStore()->getPropertyValues($relationDI, $fieldsProp);

$fields should now be an array with all properties of the record. This works well if there are no duplicate properties in the record. In the above example it returns only "Has Husband" and "Has Child". The second occurrence of "Has Child" is missing.


Best,
  Thomas
Comment 1 Thomas Schweitzer 2011-10-05 15:23:07 UTC
Please forget my comment about the API. $fields is a string that contains all properties i.e. "Has_Husband;Has_Child;Has_Child". So this is correct.

However, the first bug that I described is still valid.

Best,
  Thomas
Comment 2 Jeroen De Dauw 2011-11-02 22:47:42 UTC
What version of SMW? 1.6.1? trunk?

Markus, seems like a bug for you :)
Comment 3 Markus Krötzsch 2011-11-03 09:44:30 UTC
Yes, the duplicate values are clearly a problem that needs to be addressed. A possible temporal workaround for now is to use subobjects or to have two child properties.

(The issue that "The fact box shows the property "Married to" but no values at all." has already been fixed as Bug 31605)
Comment 4 Markus Krötzsch 2012-11-01 18:12:24 UTC
I think it is fair to say that duplicate properties are not supported by Records, and that this is not expected to change any time soon. #subobjects should provide a better alternative in this case.

*** This bug has been marked as a duplicate of bug 30482 ***

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


Navigation
Links