Previous Entry Share Next Entry
Release fixing Optional Text and Display Name
jducoeur wrote in querki_project
Small release today, although the beginning of some important fixes. Just one significant item:

Optional Text (and Numbers) now work right: this fixes one of the more maddening problems with the system, which has been true for a long time.
Tangent: ExactlyOne vs. Optional -- one of the central concepts of Querki has always been that every Property has not just a Type, but also a Collection -- how *many* of this value the Property potentially contains. ExactlyOne is a somewhat radical concept, actually: most programming languages and database simply assume that having precisely one value is the default state of the world, and that anything else is a weird exception. The notion that you actually have to *say* that a Property is ExactlyOne seems slightly strange, but the fact that every value is, by definition, a Collection is part of how the QL language can be so conceptually concise.

Optional means, as it says, that a value for this Property is Optional -- that there can be zero or one values in it. I suspect most folks haven't started using it much, but honestly, I prefer to have *most* of my values be Optional. Unless I know that there *must* always be a value in a field, Optional is more appropriate.
The problem is, much of Querki is about Text Properties, and Optional Text has, bluntly, never worked. You can declare a Property to be Optional Text, but there was no way to say "this has value None". None is special -- it means, "No, really, there is nothing here", and is *not* the same thing as a blank line. (Which is still Text, just empty text.)

There is no *visible* change today, but there's a terribly important *behaviour* change: when you give an empty value for an Optional Text in the Editor, it becomes None on the way in. This means that there is in principle no way to say that you *want* an empty string value in an Optional Text, but that's rarely if ever what you do want. This means that expressions like this now work:
[[My Optional Text Property -> ""The value is ____""]]
That will show the line if the contents of My Optional Text Property is non-empty, and omit it entirely if it is blank.

(Note that this is largely an *Editor* change, and doesn't affect existing Things. But once you edit them, this will take effect.)

While I was at it, I did the same for Numbers -- it is now legal to blank an Optional Number input, which means None.

The *important* result of this is that it is now officially legal to have a completely empty Display Name. (Which is Optional Plain Text.) If you leave Display Name blank, that means that its value is None, and the system is now smart enough to default down to Name, and thence to OID, in that case. It is still illegal to have an empty Name (although you can simply delete the Name Property entirely if you don't want one, and it's going to mostly go away soon), and it is still illegal to have a Display Name made up of just spaces.

I hope this proves helpful to everyone. I think the new behaviour of Optional Text is likely to prove generally more intuitive than the way things have worked heretofore; it's certainly more consistent with The Querki Way...


Log in

No account? Create an account