Page MenuHomePhabricator

<td> elements missing in HTML Table export of results
Closed, ResolvedPublic

Description

When exporting a result set of the Wikidata Query Service as HTML table (via Download -> HTML Table), the WDQS doesn't put HTML table cell elements (i.e. <td></td> tags) in the table row, when the cells are empty. This doesn't matter when columns with optional values are on the right side of the table, but when they are on the left or in the middle, the cells are not properly aligned in the columns anymore.

Example: The common example query of cats in wikidata, extended by the optional property of IMDB-ID, but in this case the IMDB-ID (which only 6 of the 128 cats have) is the left most column. When downloading the data as HTML table, the result renders like this:

cats_with_IMDB_pges.png (780×686 px, 73 KB)

Most of the rows are misaligned because the IMDB-ID is missing. Only in the cases where there is an IMDB-ID does the content of the row correspond to the table header.

Solution: the WDQS should create empty table cells (<td></td> tags) when there is no content for the corresponding result and not just ignore the current cell.

Event Timeline

Change 467907 had a related patch set uploaded (by Gerrit Patch Uploader; owner: Frog23):
[wikidata/query/gui@master] Fixes problem with WDQS HTML table export for cells without value

https://gerrit.wikimedia.org/r/467907

Change 467907 merged by jenkins-bot:
[wikidata/query/gui@master] Fixes problem with WDQS HTML table export for cells without value

https://gerrit.wikimedia.org/r/467907

Change 469831 had a related patch set uploaded (by WDQSGuiBuilder; owner: WDQSGuiBuilder):
[wikidata/query/gui-deploy@production] Merging from 871c1a3efabee66d17c53549d62fe90b9070b851:

https://gerrit.wikimedia.org/r/469831

Change 469831 merged by Smalyshev:
[wikidata/query/gui-deploy@production] Merging from 871c1a3efabee66d17c53549d62fe90b9070b851:

https://gerrit.wikimedia.org/r/469831

Frog23 claimed this task.

Yes, it works now. Thanks to everyone involved for approving and merging the patch.