I’ve been reading Declaring a new table to be populated - #56 by EphemeralHorror with great interest because I’ve been learning a lot about the power of relations, which as a beginner in Inform7 I had neglected so far.
As it happens, in the draft story I’m writing to learn about Inform7 I have developed an extensive table-based “book system”. This is basically a list of titles, authors and some other properties that is there purely for “scenery” purposes (you can find «a copy of This And That Book by Such And So Author»). Given the variety of the books I’ve had to basically devise a “subparser” to detect if the user is talking about said books, which works sufficiently well thanks to the fact that I only have to worry about a very specific subset of commands.
Reading the aforementioned thread made me think that maybe I can make the “book system” a bit more sophisticated (and hopefully get rid of the ad-hoc parsing) by using relationships instead, so I basically nerd-sniped myself into writing my first extension, which I’m calling “Artists and their Works”, and I’m starting to feel like I bit off more that I can chew.
One of my issues is when to use relations and when to use properties. For the relation artist >=> work, I opted for relations, which allows me to have both multiple works from the same authors and multiple authors for the same work (collaborative writing). So far, so good.
The next thing I intend to do is to separate the work in the abstract from its tangible incarnations, following the principle that a novel is not the book it is printed on, and that you might want to have multiple copies of the same work in the story. And this is where the problems begin.
The idea is that I would like story writers to be able to say «The interesting book is a copy of Lesser Known Novel in the Library» (where Library is a room and Lesser Known Novel is a previously defined work by some artist), but also «If the noun is a copy of Lesser Known Novel: ...» or get the list of visible copies of Lesser Known Novel.
For the writer-friendly syntax, the property seems to be the best choice, since it allows me to enforce that each incarnation must have a corresponding work (is there a way to enforce this with relations?), and I can define tell Inform7 that The verb to be a copy of means the work property and then do
The interesting book is a tangible work in the Library.
The interesting book is a copy of Lesser Known Novel.
which is a bit verbose, but almost as good as I would like (is it possible to do better?). However, this has the downside that I can’t use being a copy as a relation in conditionals or object descriptions. I can work around this by using a different verb, but it would be nice if I could use the same (I actually expected it to work automagically, TBH, from the information that being a copy of refers to the given property).
Moreover, I haven’t found in the documentation a way to allow this kind of syntax to set multiple properties at once. For example, if a tangible work can be original, my understanding is that I cannot define something that allows me to, say, write The interesting painting is the original Famous Painting and tell inform that not only the paining is a tangible work of the given Famous Painting, but also that it is original. Or did I miss it?
Am I asking too much of the source text parser?



