Some questions about Types, Relations and Tags

Edit by @sambouwer: this was originally posted as reply to:


I’ll use this thread for the following questions/comments because it seems to be the appropriate place, sorry if not:

A) There is a built-in “City” relation, but it’s type is ‘tag’ and, if I use it, I can’t create a set of cities and relate each city to a country. So I created a “City” type of objects and a “City” relation of the ‘object’ type (for using it in my “Trip” object type). But when I go to a “Trip” object or object set, I can only choose the original ‘tag’ “City” relation, not the new ‘object’ one. Is this an intended behavior?

B) When I create a new “City” object (a custom object type I created, as mentioned above), I can create a relation to “Country”, but I cannot choose the nature of this relation. In this case, it should be a many-to-one relation (many cities exist in a country, but a city cannot belong to more than one country). How can this be done? Is this an additional (either accessory or independent) feature request?

C) Continuing on what was described in B above, since Anytype uses “sets” rather than “databases”, when I create a relation between “Cities” and “Countries”, I obviously want the set of Countries to automatically list all the Cities related to each Country (no reason to do this backlink manually, including the work of doing it and the risk of data inconsistency). Is this already included in what has been discussed in this thread? Is there an ETA for this to be released?

D) When I link “City” objects to a “Trip” object, I would like to have each Trip list the Countries based on the Cities linked. I assume this is a roll-up? Is this in the oven and is there an ETA?

E) Since we’re talking about back-linking, and since “relations” are a type of object themselves, I would love to see listed in each “relation” object the object types that are currently connected to it, i.e., the object types that are indeed using that relation right now. I know I can make a “set of relations” (thanks @isle9 for your reply in the other thread about it!), but that set shows all objects of each object type that uses that relation, not the list of object types that are configured to use that relation, i.e., if an object type does contain that relation but there is no object of that object type it doesn’t show in the “set of relations”. I don’t think this way of handling set of relations should be changed at all, I would just like relations to have backlinks from the object types using them.

F) Built-in relations like “Company” (an ‘object’ relation used e.g. in “Contact” objects) do not, and cannot be corrected to, be limited to “Company” objects only. So when choosing a Company we see the full list of existing objects, including images, etc. This applies to all built-in ‘object’ relations.

About the ETAs asked above: no intention of pressure here, really just asking!

Happy new year everyone!

1 Like

Hey @anykind , thanks for posting! I think it would be better to split your post into its own topic in the General Discussion category, and maybe the Adress the Community subcategory.

I will split the post for you, and add a link to the Feature request you are posting in. If you create new FR’s it would be great if you can link them here :slight_smile: .


First, I don’t have the built in “City” relation, but my account is a bit older, so that might be the reason… If you would use Tags to indicate which city/cities an event was located, there is no way to “link” that City-tag to any kind of other Object like a Country Object that I know of.

I think you should be able to create a Set based on that City relation by going to the Library, then opening the City relation and click “Create Set”. Now, for linking this to a Country, it depends on what you intend to do with this. If you want the cities and countries to be linked in the Graph so you can locate a country and see all cities that are within that country, you could maybe better create (custom) Object Types called “City” and “Country” and either:

  • Create a (custom) Relation of type “Object” called “Country” (and limit this Relation to only allow selection of Objects that are of type Country) and add this Relation to a Template for your City Object Type.
  • Create a (custom) Relation of type “Object” called “City” (and limit this Relation to only allow selection of Objects that are of type City) and add this Relation to a Template for your Country Object Type.

See the option when configuring a (custom) relation of a type “Object” to only allow Objects of a certain type to be selected.

Example with Company:

I haven’t tested this (I’m running a test build, and the Graph is not working for me at this moment), but you should be able to use either one or both City and/or Country Relations to link cities and countries.

Only downside I can see is that technically you can link one city to multiple countries which is probably only valid in a handful of cases :wink: . Indeed, creating a Feature Request is the way to go! (just did a quick search, can’t find anything similar right away…)

This kind of traversing is not yet easily possible. You could leverage the Graph to locate a country, and see which trips are connected to that country via a city. Also here, a FR is the way to go. Something like this is the closest I could find:

https://community.anytype.io/t/traversing-the-graph-via-queries/2375---

I agree, I hope you are willing to create a FR for this, too :wink: .

See the example I gave above. Note that I’m running a pre-release version, so this might not yet be possible in the version you have. If so, this is coming (soon)!


Happy new year!

PS: let me know if you prefer to have the title of this topic changed!

1 Like

A) Might be a bug or some kind of conflict. I’d wait for the next update to see if it resolves itself.
B) No can do. All object relations are many-to-many right now.
C) I’m guessing that this would be the parent-child style relation that they have in Notion, for instance? I think there is a feature request for that, but I wasn’t able to find it.
D) Seems like a roll-up indeed. I haven’t seen it mentioned anywhere, so I doubt that this would be prioritized any time soon unfortunately.
E) So if I’m understanding this correctly, you basically want a list of all the objects which are configured to use that relation to be shown in the relation object itself? Configure to use the relation meaning this?
image

F) This should be fixed in the next update.

2 Likes

Wait which post are you referring to and why are you splitting it?

Sorry, I mistakenly tagged you, while I should have tagged @anykind… Sorry! You can ignore this post :wink:

Oh okay no worries, I was confused! Happy new year!

1 Like