Tags

While Links are really useful, as a way to point from one Thing to another, you often want to operate more flexibly than that, without having to create Things for every concept. In particular, you often want to organize your Space in lots of different ways, categorizing your Things so that you can find them. That's why Querki also provides the lighter-weight notion of Tags as another major type.
A Tag is basically a name -- a name that can point to an actual Thing, but doesn't have to do so. The benefit of Tags is that you can make them up when you want them, and only create the Thing under that name later. (Or never.) You'll find that turning a Tag into a Thing is sometimes useful, but sometimes not.
For example, let's add another Archetype to our Subway Game. This one will be a Handler for our Spy to work with:
3y2848u/638e5108e7949a136a5644e41bbb61e310b48269.png
I want a way to keep track of the fact that these Archetypes are intended to work together. Let's call that a Faction -- we'll have lots of Factions in our game, representing the various alliances among characters. So let's create a Model for Faction:
3y2848u/c30b5eb43980c8eedd4c9ffbd2f84772cbd0c56c.png
I'm not going to give this Model anything other than a name right now -- I just need the Model to exist. Now, I edit the Archetype Model, and create a Factions Property:
3y2848u/434501228cd5531ebde3c4ff7c110efbd6a10563.png
As I did with Links, I'm going to create this as a Set, which makes sense -- a given Archetype can belong to a bunch of Factions. I press the "Create" button, and the Property Editor shows up:
3y2848u/1010684be99394963130b4a69f8aa65c2ddd38e9.png
Notice that the Link Model meta-Property shows up again. Link Model is almost as useful for Tags as for Links -- it says that this Property is a specific kind of Tag, and should be distinguished from other Tags. So I set it to the Faction Model, indicating that all Tags I define in the Factions Property are intended to be names of instances of Faction, even if those instances don't exist yet.
Of course, I want to be able to see the Factions for my Archetypes, so let's go to the Default View again, and add Factions there:
3y2848u/cbcd314f5501411c820e9a8d758d9da5fe8bbe20.png
Nothing complicated there -- we're just displaying the Factions for this Archetype, comma-separated.
Okay, let's try using it. I go to the Spy Archetype, edit it, and add "Russians" as a faction:
3y2848u/1ef86f7fd8f4657951a9baee9084bfa0313870c3.png
Querki prompts me to say that it hasn't seen "Russians" as a Faction before, but that's okay -- Tags don't need to exist yet. (Whereas if this was a Link Property, Querki would prevent me from using an unknown name.) I press Enter, say Done, and my Spy now has a Faction:
3y2848u/d45710319ddb671cdb93684e31e3e6110b5f2a7d.png
Okay, let's do the same thing with Handler. I edit the new Handler Archetype the same way, but now Querki knows about the Russians Faction, so it prompts me:
3y2848u/3a53bc9913c4be05fbe2750b5497e72f54f7688.png
I press Enter to accept the prompted Tag, say Done, and now my Handler also has the same Faction:
3y2848u/4749b2a5a4f805bd4618d63f7a16048e73b2795a.png
Now comes the cool bit. I click on "Russians", and get taken to the page for the Russians, even though that isn't a real Thing --
3y2848u/f2afa7e64b077f9673c4952d96b477d6ab839c02.png
This is the real power of Tags: you can create Tags quickly and easily, and they immediately become a page tying together the Things that use that Tag.
Note that the Russians page even knows that it is based on Faction, since that is the way the name has been used. Can I turn it into a real Faction? Yep -- I just press the Edit button, and I get the usual Instance Editor:
3y2848u/cb282da418b28ae1a4a863ef43c6ed73e2e0630c.png
Technically, we call this reifying the Tag. ("Reifying" means turning something abstract into something real.) To begin with, it even starts us with a Default View, which shows how these Tag pages work. The _tagRefs function receives a name (from a Tag or Thing), and produces all of the Things that use that name in Tag Properties. (_tagRefs and _refs are very similar, and will probably get combined somewhere down the line, but for now they work a bit differently.)
I could just press Done, and the page would look just like it did before, except as a real Faction. But let's put some content in the Default View, just to show we can:
3y2848u/2b89ad116d1ab32a4407b1ee0f2cdaa8b898e147.png
I press Done, and as expected, the Russians are now a real Faction:
3y2848u/285e8d4dc5f38dc55a250430803d792f9f0d7552.png
One last point on Tags. Remember how the Handler has a reference to Spycatcher, which is showing up in red?
3y2848u/4749b2a5a4f805bd4618d63f7a16048e73b2795a.png
That's because I put in a reference to a Thing that doesn't yet exist, by saying [[Spycatcher]]. I can still click on it, though, and I get:
3y2848u/26d621f5f5c8e4ddb28b6355cdf015f7796509e9.png
Look familiar? If we use a name that doesn't exist, that's a Tag, and works pretty much the same. However, since it isn't in a Property, Querki doesn't know that we intend for it to mean an Archetype, so it shows up as a "Tag based on Simple Thing". And at this point, references from text like this don't show up in _tagRefs. (We'll probably add the ability to track references like this, but it'll be a way down the line -- it's a harder problem.) The important point, though, is that it is entirely legal to use a QL expression to point to a Thing you haven't created yet, and then go back and create it later.