I have seen this in the Property Syntax section of the Org manual:
Properties can be inserted on buffer level. That means they apply before the first headline and can be inherited by all entries in a file. Property blocks defined before first headline needs to be located at the top of the buffer, allowing only comments above.
Org Roam is probably the only primary Org-related application that uses this feature tremendously, to set the Org Roam "note"s ID.
(PS: I don't use Org Roam myself, but I have seen quite a few examples.)
So an Org Roam file might look like:
:PROPERTIES:
:ID: 1e8ccec9-735d-41d0-b0cf-143d9c3e965d
:END:
#+title: Some Title
I believe that Org Roam sets ID this way because the Org built-in library org-id
supports this. If you require org-id
and eval (org-id-get)
in the above file, it will return "1e8ccec9-735d-41d0-b0cf-143d9c3e965d".
So I couldn't help but draw a parallel between the #+identifier
property created by denote (when denote-file-type
is nil or Org) and the :ID:
property used by Org Roam.
Here's an example file created by denote:
#+title: idtest2
#+date: [2022-06-10 Fri 13:44]
#+filetags: org-id
#+identifier: 20220610T134422
#+title
: ✔️ Canonical style of setting a file's title
#+date
: ✔️ Canonical style of setting a file's date
#+filetags
: ✔️ Canonical style of setting a file's tags
#+identifier
: ❌ Canonical style of setting a file's unique ID
But the good thing is that the #+identifier
value is indeed a unique ID. So that value doesn't need to be changed; it only needs to be presented in a different format.
Suggested Org format
:PROPERTIES:
:ID: 20220610T134422
:END:
#+title: idtest2
#+date: [2022-06-10 Fri 13:44]
#+filetags: org-id
Now if you eval (org-id-get)
in this file, it will return "20220610T134422"!
Another benefit: Enables linking of files using Org ID
Example file 1
:PROPERTIES:
:ID: 20220610T134323
:END:
#+title: idtest1
#+date: [2022-06-10 Fri 13:43]
#+filetags: org-id
Example file 2
:PROPERTIES:
:ID: 20220610T134422
:END:
#+title: idtest2
#+date: [2022-06-10 Fri 13:44]
#+filetags: org-id
[[id:20220610T134323]]
If your org ID extra files cache is updated (by evaluating (setq org-id-extra-files (directory-files-recursively default-directory "\.org$"))
), and if you put the cursor on that id:
link in idtest2 file and hit C-c C-o
, it will jump to the idtest1 file.