I'm improving the SMW CSV query printer we're working on at CC (source is
in the CC_SMW_Extensions repository at code.creativecommons.org's git; if
we didn't announce it before, ask - I'm happy to write more about it
For our CSV printer, I figured - if a page has two values for a property,
they should show up in the same column of a spreadsheet joined by ","
rather than in separate columns. So I began to change the CSV Query
Printer to keep track of which property name it was printing.
However, in abstract SMWDataValue $object->m_property is *protected*. So
I can't read it. So my query printer can't tell what property it is
printing, and therefore can't specially handle this case.
Why is it protected? Can a get_property_name() method be added? Am I
handling this wrong?
When taxes are due, Americans tend to feel quite bled-white and blue.
I'm attaching a very short patch that creates getPropertyName() in the
This is useful for custom query printers that need to know the name of the
property they are reading (to, for example, detect properties with more
than one value, as the CSV query printer needs).
Permission is granted to re-use this under the same terms as the current
SMW codebase. Please commit!
Did I do an INCORRECT THING??
On Mon, 23 Jun 2008, Asheesh Laroia wrote:
> I'm attaching a very short patch that creates getPropertyName() in the
> SMW_DataValue.php file.
Please still commit this - it turns out to be useful for another extension
> This is useful for custom query printers that need to know the name of
> the property they are reading (to, for example, detect properties with
> more than one value, as the CSV query printer needs).
For what it's worth, I don't need the patch for CSV query printer in the
end - I fixed the bug based on a careful reading of QP_Table! (-:
When you try to make an impression, the chances are that is the
impression you will make.