Difficulties in developing a UDC (or DDC) classifier

Hello! I have encountered difficulties in developing a thematic classification (UDC) system based on the use of Templater and Dataview plugins. Below I have provided a diagram that describes the objects involved in the classification system and the relationships between them.

The key object in this system is the snippet “Live filtering of dataviewjs table” created by [reaty](https:/ /forum.obsidian.md/u/reaty). As part of the classification system, this JS table is modified in such a way as to provide hierarchical selection of the UDC code in Suggester. The question remains open: how to implement such a hierarchical choice in tempalter, and is it even possible?

My idea is this: when you run the UDC theme creation template, after filling in the attribute values, special “Suggester note templates?” are automatically created, which inherit some of the attributes from the created theme. Subsequently, when the button for selecting a UDC topic (in a table or in an entity) is activated, the dialog menu of the basic Suggester note is launched. It contains the data obtained using the dataview request. Subtopics repeat this logic with the request.

Selecting the “Accept current topic” item will return the topic attributes: UDC code in the format #UDC/0/0/0, and if the object is an entity, then a UDC nested path will be inserted in the format UDCpath:: Topic/ Subtopic/…

Below are images showing what it should look like.


I made this menu using the code @holroy, which he provided in this post. This solution supports two-dimensional list, which is not suitable for this classification system. In addition, if you make a single template for all subtopics, this will lead to the creation of a huge structure into which it will be very inconvenient to insert new subtopics.

I for one have a hard time following the logic of what you want to achieve with this flowchart, other than the overall goal of selecting one (or more) templates. So even though the logic of your flowchart most likely could be copy one-to-one into Templater, I’m not sure it’s the best logic to implement.

With “best” that your setup is possibly not the simplest and most intuitive way to get your work done.

I’m also having a hard time seeing the connection to the live filtering of a dataview query, as in the thread you link to. That’s a script to be used for limiting down the result of a dataview query, but you seem to looking for a script to expand which template to choose/extend.

So for starters I would look into getting a clearer/simpler flowchart having a clearer top-to-bottom traversal, as your current flowcharts goes back and forth, and I’m not certain it doesn’t include loops.

Further more, I would try to explain what you mean with <<BUTTON>>, <<TEMPLATE>>, <<DATAVIEW>>, <<Exemplar>>, and so on. Are some of these queries to inserted or executed? Will your template create just one note, or multiple notes? What is the start and end points of your flowchart? Where if anywhere, do you need choices to make it go either way in your flowchart?

There are so many questions, and so few answers, so I’m not surprised noone else has answered this post yet. Give us clearer information, and hopefully a simpler flowchart, and someone might be able to help you out.

Hi @holroy. Thanks for the answer. I apologize for the very long answer, I didn’t have a chance to answer earlier. I agree that I asked the question incorrectly. The logic behind how this system works is really up for debate.

I will try to convey in a simplified way what I want to do. Essentially, without entering the table code, I want to enter a hashtag in the format #UDC/x/x/x (and selectively AND #UDC/y/y, OR, AND -#UDC/y/y/y and so on) thereby performing thematic filtering of entities. Filtering by secondary criteria in the WHERE field is already implemented in snippet @reaty, where the entire suggester list will not reach hundreds of options.

Due to the fact that the number of topics can easily exceed the conditional 300 pieces, choosing from a continuous list of suggesters will be extremely ineffective. Accordingly, I see two solutions to the issue.

  1. Manually using tp.system.prompt, first selecting the necessary hashtags in the UDC hierarchical directory. A less preferable option, since it requires more actions and opening notes (UDC topics), which will increase time consumption and reduce the availability of information.
  2. Automatic using tp.system.suggester, where topics are presented in hierarchical order. Selecting a subtopic will launch its suggester, the interface of which I showed in the images above. I will add that after selecting “Accept current topic” in the menu for the dynamic library table, there should be another suggester block that will ask “do you want to add/exclude another topic and so on (FROM arguments OR, AND #, AND -#) ". If you refuse to enter additional rules, suggester will return the hashtag code to the table in the FROM field. (At the same time, this block should not appear in Suggester when assigning a UDC topic to an entity)

Since I rethought the workings of this system a little, some details do not match the very first diagram. However, this did not change the general logic. I will reveal the meaning of the stereotypes <<BUTTON>>, <<TEMPLATE>>, <<DATAVIEW>>, <<Exemplar>> by attaching screenshots of actual notes, in conjunction with individual updated components of the first diagram. I’ll add that when I specified the <<Exemplar>> stereotype for the UDC suggester, I probably made a mistake, since this is also essentially a template generated by the more abstract UDC suggester template, the values into which are inserted automatically and dynamically. By dynamically, I mean that the classification system is not created at once, but gradually, growing with new topics as needed. Accordingly, creating topic 1.1.1. in topic 1.1. , it should appear in the 1.1 theme suggester.

"Note that the arrow with the end in the shape of a diamond means “Composition Link”, and the usual one is the flow of information "

Next, I include sequential flowcharts that describe the user’s interaction with the classification system, and I also include a demonstration of the components of the first diagram in the form of notes.

Next, regarding the issue of creating multiple notes from a single template. Yes, it is necessary to create several notes from one template IF you use my vision of hierarchical Suggester formation, in which when a UDC topic template is created by a UDC topic template, an instance of the Suggester template is automatically created, which is a reflection of this topic. The thing to keep in mind here is that a Suggester note is essentially also a template, which is created by the UDC topic template, in the form of an abstract Suggester template.

I don’t know if this can be implemented in Obsidian, and in fact this is a purely technical issue outside my competence, which is left in the hands of whoever wants to help me implement this system.

Next, I will formulate a number of questions that arose during the development of this system:

Primary questions

  1. How to add a variable to the FROM field (dv.pages) of a dynamic table that can be interacted with using a button and Suggester?
  2. How to create a Suggester that will dynamically receive hierarchically interrelated elements?
  3. How can I launch another Suggester from one Suggester, while remaining in the note in which this algorithm was launched?
  4. How to get the values of the selected topic from Suggester into the note in which this algorithm was run?
  5. How to separate Suggester algorithms for a library table and for entity classification? The library should be able to add several hashtag codes to the FROM field through logical operations, but not for an entity.

Secondary questions

  1. How to automatically calculate the UDC level based on the hashtag code hierarchy (#UDC/x/x/x => 3)?
  2. How to automatically perform arithmetic operations in Templater to calculate the UDC level of a subtopic and supertopic (3+1=4; 3-1=2)?
  3. How to remove the last subtopic in a hashtag code to find a supertopic (#UDC/x/x/x =>#UDC/x/x)?

Last “bonus” question

  1. If all of the above can be implemented, it would be cool to add the ability at the very beginning of the dialog in the Suggester scenario (when the first level topics are shown), to select the “favorite topics” option, the selection of which will display a solid list of all topics that have a “favorite” status in the metadata. This will multiply the efficiency of the classification system when focusing on a particular topic.

Conclusion

I hope I managed to clearly describe what I want to do. I should note that the logic of this system is universal. It means that it is possible to abstract from the UDC subject classifier in order to use this structure as a foundation for creating other classifiers based on other grounds. I believe that this system in case of technical realization will be extremely useful not only for me, but also for those people who want to create their own powerful PKM systems using DBMS.