Links and Link Model
Let's move on to the next important Type: Link. Links are how you connect Things together in Querki -- the easy way to say, "This Thing is related to that Thing in this particular way". A Link is a "hard pointer" to another Thing: it always points to a specific Thing that actually exists in the Space. (As opposed to Tags, which we'll talk about next.)
To illustrate Links, I'm going to create the next useful Model in our Subway Game: Character. Whereas an Archetype is just an element of a character, a sort of one-dimensional slice, a Character is going to be something that players actually play.
I begin to create the Character Model using Design a Model, as usual:
I've added Summary, the same way I did for Archetype. Now I want to reuse that Notes Property that I created for Archetype, the field that is for GM eyes only. Fortunately, once I've created a Property, Querki makes it available to everything else in the Space, as we now see in the Add Existing Property drop-down:
What I really care about now, though, is for my Character to point to the Archetypes that it was built from. So let's create an Archetypes Property, which is a Set of Links:
When I create that, it shows me the Property Editor as usual:
Here's something new: the Link Model meta-Property. Link Model is crucial for making your Querki Space easy to use.
When you create a Link Property, that can link to any Thing in the Space. That's powerful, but usually pretty inconvenient: it means that Querki will offer you lots of Things to choose from whenever you're adding a Link, most of which you don't care about. Usually, you want your Property to point only to Instances of a specific Model, so that you're not wasting time with all the stuff you don't care about. So while Link Model is optional -- you don't have to set it -- you usually should do so.
So let's set the Link Model of our new Archetypes Property:
Okay, let's try that out. From my new Character Model, I'll create the beginnings of a Character based on the Spy Archetype:
Querki knows that the Archetypes Property is only allowed to point to Instances of Archetype, since I set the Link Model. So when I start typing in there, it prompts me with Archetypes that match what I'm typing. (It actually offers me "Spy" as soon as I type the initial "s".)
Now I've created a Character using my Archetype. Can I have my Archetype list the Characters that are using it? Sure, that's easy -- this is what the _refs
function is for.
I go back to my Archetype Model, which has that Default View I've already worked on. I add another line to the Default View:
Okay, so we have another QL expression here:
**Used in:** [[Archetypes._refs -> _commas]]
The only bit that's new here is
_refs. This function receives a Thing, combines that with the named Property, and produces all of the Things that refer to
this Thing through that Property. In this case, it will produce all of the Things that refer to this Archetype (since this is the Default View, the context is the Archetype we're looking at) through the Archetypes Property.
So this QL expression just says, "List all of the Things that point to me via the Archetypes Property, as a comma-separated list". I go back to my Spy, and sure enough it now looks like this:
This nicely illustrates the way I recommend working in Querki. Instead of spending a huge amount of effort trying to nail down every detail in advance, and getting the design perfect before you create your Space, Querki is deliberately designed around the idea of iterative development -- trying stuff out, tweaking it, enhancing it, and constantly evolving your Space and making it better.
The recommended process is:
- Start with one or two very simple Models
- Create some Instances
- Set up the initial Default Views
- Iterate -- add more Models and more Properties, tweaking the Default Views as you go
Doing things this way usually gets you something working much faster than trying to puzzle it all out in advance, and often produces better results.
Also, one of the really satisfying things about Querki is the way you can see your changes in action immediately -- indeed, if you have two windows open, you can try out your changes and see the results almost instantly, just by pressing the Refresh button (
) on your Instance.