Managing a global set of Abbreviations, Terms, and Definitions across multiple projects and documents

This solution was developed with the indispensable help of @holroy . Thank you! I’ll buy you a coffee.

What I wanted to do

I use Obsidian to assemble documents, each with its own folder full of chapters. The documents may be work-related or personal, and I prefer to keep all my notes in one vault, so they can share information.
Each document needs a table of Abbreviations, Terms (the phrase referred to) and Definitions (the actual meanings). Rather than keep separate lists of abbreviations, I have a set of notes tagged with abbreviation, and I use Dataview to display a list of the relevant items in each document.

Example abbreviation: BM (Abbreviation) = Business Manager (Term) = Person who manages business. (Definition)

The problem was that the same Abbreviation may have multiple meanings depending on the context, and I only wanted to display the items with the relevant context. For example, BM may mean Business Manager or Bowel Movement depending on the context, and it may not be appropriate to show all meanings in one document.

Here’s how it works.

Context Notes

These can be anything: documents, organisations, projects. The abbreviation links to them as the context for a specific definition.

Term Notes

These can be any note that defines the meaning. The filename is the Term, and the field summary contains a short summary of the definition. This can then be returned by Dataview. A more complete description can be in the note body.

Abbreviation notes

Abbreviation notes have the title as the abbreviation, and are tagged with abbreviation.

(Optional) The plugin Auto Note Mover organises these into a folder.
(Optional) The plugin Metadata Menu has a “file class” which is linked to the tag, so that all the Abbreviations have the relevant fields added. This also makes it easier to add and edit the metadata.

They also have the following frontmatter (example from BM):

---
tags:
  - abbreviation
contexts:
  - term: "[[Terminology/Breakfast Monitor]]"
    fileContexts:
      - "[[Organisations/International Union of Railways]]"
  - term: "[[Terminology/Bowel Movement]]"
    fileContexts:
      - "[[Projects/Podcasts/Coiled Spring/Podcast]]"
      - "[[Abbreviations/Puerile Jokes]]"
  - term: "[[Terminology/Business Manager]]"
    fileContexts:
      - "[[Projects/Another Project]]"
      - "[[Documentation Publishing Plan]]"
---

The frontmatter consists of one or more contexts, each with a single term, and one or more fileContexts. This allows you to say: “This Abbreviation means Term X in these contexts, and Term Y in these other contexts”.

In the body of the abbreviation note you can include the following query, which displays all the terms related to this abbreviation.

```dataview
TABLE WITHOUT ID ctx.term, ctx.term.summary, ctx.fileContexts
WHERE file = this.file
FLATTEN contexts as ctx

Displays this:

I really like the idea of separating the abbreviation from the definition, because there are many cases where an abbreviation has multiple meanings. It feels more elegant and (insert the Obsidian equivalent of “pythonic” here).

In use in a document

In each document I have a note called “Terms and Abbreviations” containing a dataview query like this example for the context “Podcast”:

TABLE WITHOUT ID file.name as "Abbreviation", ctx.term as "Term", ctx.term.summary as "Summary", ctx.fileContexts as "Context"
FROM #abbreviation
FLATTEN contexts AS ctx
WHERE contains(ctx.fileContexts, [[Podcast]])

(note that “[[Podcast]]” is not in quotes in the WHERE expression)

This would show the following abbreviations in use in the context of “[[Podcast]]”:

I could even skip the column showing contexts, because we know the abbreviation is relevant to the current context, and we may not care what other contexts it’s relevant in.

Now when I create a new document requiring a Terms and Abbreviations table, I just go through and link the relevant Abbreviation notes (or create them) to the new document context.

I’m working on easier ways to add the relevant frontmatter to multiple abbreviation notes, but in the meantime this works really well.

4 Likes

Can you describe how you define the nested object list in Metadata Menu?

Bit of a party pooper here.

I am in the midst of getting rid of my abbreviations that I used in MS Word for author names (RG for Robert Graves, RHA for Richard Hinckley Allen, JMJ for John Major Jenkins, etc.) to avoid repetition by mass replacing them (then in daily work I can use Typing Transformer to write in the abbreviations and print the long form into the document, although when you refer to the author a third time in the same document, one needs to remember to drop the first name or use initials for that). Reason being, I can run out of these abbreviations pretty quickly (as regards the Typing Transformer aliases) and they are not really accepted in scientific works I intend to publish.
I do run into the issue of having featured e.g. MA as an etymon (meaning earth, mother) and as an abbreviation for an author so I need to replace with context (MA writes/says/etc.) in order to keep the etymons as MA in the documents.

I do admit the solution used is nifty, but as all things, they need constant attention and what they really do is give us an excuse to learn something new we think we need or to tell ourselves we do everything we can to maximize Obsidian potential without facing the facts that all it really amounts to is a form of procrastination…

I also thought nested properties were still a feature requested or that there was a limitation quering them…? Not anymore?

oh it’s definitely a form of procrastination, but a fun one

Hi, sorry for delay

In Metadata menu:

  • contexts is an ObjectList
  • fileContexts is a MultiFile, with contexts as the parent
  • term is a File, with contexts as the parent

This is in a file class applied to files with the tag #abbreviation.
The file class metadata looks like this:

---
fields:
  - name: contexts
    type: ObjectList
    options:
      displayTemplate: ""
      itemDisplayTemplate: ""
    path: ""
    id: Y53zNz
  - name: term
    type: File
    options: {}
    path: Y53zNz
    id: YBJeaW
  - name: fileContexts
    type: MultiFile
    options: {}
    path: Y53zNz
    id: E6HPRS
version: "2.14"
limit: 20
mapWithTag: true
icon: package
tagNames:
  - abbreviation
filesPaths:
  - Abbreviations
bookmarksGroups: 
excludes: 
extends: 
savedViews: []
favoriteView: 
fieldsOrder:
  - Y53zNz
  - E6HPRS
  - YBJeaW
---

to revive an old thread. I have a folder of acronym files (one file per acronym). the top/header portion of each file looks like this:

---
tags: acronym, location
acronym: ABQ
definition: Albuquerque
date: 20240221
---

this would be a file named ABQ.md. if there is a duplicate (which i have Many) then each successive file name will be appended with a number or put into a separate folder. I have a template to quickly format and move the file to the correct folder when i create a new link in a doc. This way i can put additional information in the body as well as link to others.

I then use a dataviewjs query to generate a list. I can filter the list by tags for various types of lists:

```dataviewjs
dv.header(2, dv.date('today'));

const queryStr = '#acronym and -"Templates" and -#maths and -#slang';
const Num = 70;
acros = dv.pages(queryStr);
dv.header(2, "Number of Acronyms: " + acros.values.length);

let limited = acros.limit(Num).sort(item => item.acronym, 'asc');
let mapped =  limited.map(
  limited => ["[[" +limited.file.folder+"/"+limited.file.name+ "|" + 
  limited.acronym +"]]", limited.definition, 
  limited.tags.toString().replace(/^[^,]+,? */, '').trim()]
  );

dv.table(["Acronym", "Definition", "Tags"], mapped);

this generates a table with links to each acronym, the definition and the tags each in separate columns. I can then export the generated table to csv file (using semicolon as the delimiter instead of comma) that is easily imported into excel to share with others that are not familiar with obsidian.

my trouble is that i have well over 4000 acronyms now (each in their own file) and the dataviewjs query takes about 5 minutes. I’ve tried to speed this up (eg limiting the number of the query prior to sorting); the “mapped” line takes the longest amount of time by far.

What are your thoughts on this method? any thoughts/ideas on how to speed this up?