Here what I did, may be I don’t understood your proposition
TABLE length(rows) as "\#" FROM "Ontology language"
FLATTEN file.outlinks as Outlink
WHERE startswith(meta(Outlink).path, "Term")
GROUP BY Outlink SORT length(rows) DESC
`=embed(this.file.outlinks)`
What I gave you is called an “inline query”. It stands alone. So don’t put it inside a table query or inside any code block.
You said you want the embeds at the end of your note. So at the bottom (end) of your note, put two blank lines and then paste the code. On a line all by itself.