Function: org-roam-reflinks-get

org-roam-reflinks-get is a byte-compiled function defined in org-roam-mode.el.

Signature

(org-roam-reflinks-get NODE)

Documentation

Return the reflinks for NODE.

Source Code

;; Defined in ~/.emacs.d/elpa/org-roam-20260224.1637/org-roam-mode.el
(defun org-roam-reflinks-get (node)
  "Return the reflinks for NODE."
  (let ((refs (org-roam-db-query [:select :distinct [refs:ref links:source links:pos links:properties]
                                  :from refs
                                  :left-join links
                                  :where (= refs:node-id $s1)
                                  :and (= links:dest refs:ref)
                                  :union
                                  :select :distinct [refs:ref citations:node-id
                                                     citations:pos citations:properties]
                                  :from refs
                                  :left-join citations
                                  :where (= refs:node-id $s1)
                                  :and (= citations:cite-key refs:ref)]
                                 (org-roam-node-id node)))
        links)
    (pcase-dolist (`(,ref ,source-id ,pos ,properties) refs)
      (push (org-roam-populate
             (org-roam-reflink-create
              :source-node (org-roam-node-create :id source-id)
              :ref ref
              :point pos
              :properties properties)) links))
    links))