TriliumNext / Notes

Build your personal knowledge base with TriliumNext Notes
GNU Affero General Public License v3.0
668 stars 31 forks source link

(Feature request) template-Typed Attributes/Relationships #265

Open diyoyo opened 1 month ago

diyoyo commented 1 month ago

Describe feature

When defining a relation to another note, like for a Person template: #relation:FamilyRelatives="promoted,multi", it would be nice to be able to force the type of template of the accepted notes.

That way, when filling the 'form' for a Person, it will filter the auto-completion based on that forced template and avoid proposing notes that are not using the Person template too.

Additional Information

Example:

#relation:FamilyRelatives="promoted,multi,template=@Person"
#relation:livesIn="promoted,single,template=@City"

where @City could be automatically replaced by the noteId of the City template, or something to avoid collision between different City things.

rom1dep commented 1 month ago

I've been thinking about the same thing. Essentially, this idea is about setting a limit as to which are the permissible notes that a relationship can handle. I see two independent, generic and complementary ways how this can be achieved:

but then many questions arise when it comes to guaranteeing that relationships bounds are consistent (when moving/updating/deleting notes).